Skip to content

Document update process for Docker deployments #112231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

toby-sutor
Copy link
Contributor

Add a section that describes on how to update Elasticsearch when running on Docker
@toby-sutor toby-sutor added >docs General docs changes Team:Docs Meta label for docs team labels Aug 27, 2024
Copy link
Contributor

Documentation preview:

@elasticsearchmachine
Copy link
Collaborator

@toby-sutor please enable the option "Allow edits and access to secrets by maintainers" on your PR. For more information, see the documentation.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-docs (Team:Docs)

@elasticsearchmachine elasticsearchmachine added the external-contributor Pull request authored by a developer outside the Elasticsearch team label Aug 27, 2024
Copy link
Contributor

@leemthompo leemthompo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some formatting fixes, the numbered list one, for example, will fail docs build. :)

@@ -764,3 +764,47 @@ To resolve this error:
path rather than the keystore file's path. For an example, see
<<docker-keystore-bind-mount>>.
. Retry the command.

==== Updating or Upgrading the Elasticsearch version running on Docker
Copy link
Contributor

@leemthompo leemthompo Aug 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
==== Updating or Upgrading the Elasticsearch version running on Docker
[discrete]
[[docker-update-upgrade-elasticsearch-version]]
==== Updating or upgrading the Elasticsearch version running on Docker

Comment on lines +771 to +797
1. Pull the new version of the Elasticsearch Docker image from Elastic's Docker registry using the `docker pull` command. Replace `x.y.z` with the version number you want to update to.
----
docker pull docker.elastic.co/elasticsearch/elasticsearch:x.y.z
----

2. Stop the currently running Elasticsearch container. Replace `container_name` with the name or ID of your Elasticsearch container.
----
docker stop container_name
----

3. Once the container has stopped, remove it. This will not delete your data if you have correctly mapped your data directory to a volume outside of the container.
----
docker rm container_name
----

4. Start a new container using the new image. Make sure to use the same volume mappings and configuration settings as the old container to ensure that your data and configuration are preserved. Replace `container_name` with the name you want for your new container.
----
docker run --name container_name -p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" \
-v path_to_data_volume:/usr/share/elasticsearch/data \
-v path_to_config_volume:/usr/share/elasticsearch/config \
docker.elastic.co/elasticsearch/elasticsearch:x.y.z
----

Adjust the `-p` flags for port mappings, `-e` for environment variables, and `-v` for volume mappings as needed based on your setup.

5. After the new container starts, verify that Elasticsearch is running the new version by querying the root URL of your Elasticsearch instance.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Pull the new version of the Elasticsearch Docker image from Elastic's Docker registry using the `docker pull` command. Replace `x.y.z` with the version number you want to update to.
----
docker pull docker.elastic.co/elasticsearch/elasticsearch:x.y.z
----
2. Stop the currently running Elasticsearch container. Replace `container_name` with the name or ID of your Elasticsearch container.
----
docker stop container_name
----
3. Once the container has stopped, remove it. This will not delete your data if you have correctly mapped your data directory to a volume outside of the container.
----
docker rm container_name
----
4. Start a new container using the new image. Make sure to use the same volume mappings and configuration settings as the old container to ensure that your data and configuration are preserved. Replace `container_name` with the name you want for your new container.
----
docker run --name container_name -p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" \
-v path_to_data_volume:/usr/share/elasticsearch/data \
-v path_to_config_volume:/usr/share/elasticsearch/config \
docker.elastic.co/elasticsearch/elasticsearch:x.y.z
----
Adjust the `-p` flags for port mappings, `-e` for environment variables, and `-v` for volume mappings as needed based on your setup.
5. After the new container starts, verify that Elasticsearch is running the new version by querying the root URL of your Elasticsearch instance.
. Pull the new version of the Elasticsearch Docker image from Elastic's Docker registry using the `docker pull` command. Replace `x.y.z` with the version number you want to update to.
----
docker pull docker.elastic.co/elasticsearch/elasticsearch:x.y.z
----
+
. Stop the currently running Elasticsearch container. Replace `container_name` with the name or ID of your Elasticsearch container.
----
docker stop container_name
----
+
. Once the container has stopped, remove it. This will not delete your data if you have correctly mapped your data directory to a volume outside of the container.
----
docker rm container_name
----
+
. Start a new container using the new image. Make sure to use the same volume mappings and configuration settings as the old container to ensure that your data and configuration are preserved. Replace `container_name` with the name you want for your new container.
----
docker run --name container_name -p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" \
-v path_to_data_volume:/usr/share/elasticsearch/data \
-v path_to_config_volume:/usr/share/elasticsearch/config \
docker.elastic.co/elasticsearch/elasticsearch:x.y.z
----
+
Adjust the `-p` flags for port mappings, `-e` for environment variables, and `-v` for volume mappings as needed based on your setup.
+
. After the new container starts, verify that Elasticsearch is running the new version by querying the root URL of your Elasticsearch instance.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list will still be numbered FYI just need the +s to keep items connected

Comment on lines +806 to +810
- Always back up your data before performing an update, especially for production environments.
- Review the Elasticsearch release notes for the new version to be aware of any breaking changes or required actions before or after the update.
- If you're using custom plugins or configurations, ensure they are compatible with the new version and reapply them if necessary.
- If you're running a cluster, you'll need to carefully plan the upgrade process to minimize downtime and ensure cluster stability. This often involves a rolling upgrade strategy.
- When using a `docker-compose.yml` make sure to update the desired version in the configuration file or the environment variable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Always back up your data before performing an update, especially for production environments.
- Review the Elasticsearch release notes for the new version to be aware of any breaking changes or required actions before or after the update.
- If you're using custom plugins or configurations, ensure they are compatible with the new version and reapply them if necessary.
- If you're running a cluster, you'll need to carefully plan the upgrade process to minimize downtime and ensure cluster stability. This often involves a rolling upgrade strategy.
- When using a `docker-compose.yml` make sure to update the desired version in the configuration file or the environment variable.
* Always back up your data before performing an update, especially for production environments.
* Review the Elasticsearch release notes for the new version to be aware of any breaking changes or required actions before or after the update.
* If you're using custom plugins or configurations, ensure they are compatible with the new version and reapply them if necessary.
* If you're running a cluster, you'll need to carefully plan the upgrade process to minimize downtime and ensure cluster stability. This often involves a rolling upgrade strategy.
* When using a `docker-compose.yml` make sure to update the desired version in the configuration file or the environment variable.

@leemthompo leemthompo added auto-backport-and-merge v8.15.0 v8.14.0 and removed external-contributor Pull request authored by a developer outside the Elasticsearch team labels Aug 27, 2024
@mark-vieira mark-vieira added auto-backport Automatically create backport pull requests when merged and removed auto-backport-and-merge labels Oct 4, 2024
@leemthompo
Copy link
Contributor

Important

Elastic documentation is migrating to Markdown for version 9.0+. See the migration guide for details.

ℹ️ What's happening?

  • Starting January 29, we will start closing all unmerged documentation PRs targeting main/master
  • We're migrating from AsciiDoc to Markdown for 9.0+
  • 9.0 docs will be frozen from January 29 until February 20 2024
  • NOTE: PRs that include both code and documentation changes will remain open

What do I need to do?

For <=8.x docs:

  1. Rebase your PR to target the relevant 8.x branch instead
  2. The content can remain in AsciiDoc format

For 9.0+ docs:

Option 1:

  • Draft docs in Markdown
  • Once migration freeze ends, find the relevant page in the new docs system and use the edit options to submit your changes

Option 2:

💡 Need help?

  1. For Elasticians: Ask in #docs Slack channel
  2. For external contributors: Open an issue in elastic/docs-content

@leemthompo
Copy link
Contributor

@toby-sutor any reason why this wasn't pursued? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged >docs General docs changes Team:Docs Meta label for docs team v8.14.0 v8.15.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants