How to upgrade ElasticSearch In `docker-compose.yml`

  • According to Upgrade Elasticsearch | Elastic Installation and Upgrade Guide [8.1] | Elastic , if I wish to update the ElasticSearch instance started within docker-compose.yml, do I just need to stop all The insert data works, change the version of the image in docker-compose.yml, then docker compose pull, docker compose up -d two steps, the merge and upgrade of /usr/share/elasticsearch/data and /usr/share/elasticsearch/config in volumes does not need me to deal with it?

  • Suppose such a docker-compose.yml file exists. I would like to switch the image from elastic/elasticsearch:8.1.1-amd64 to elastic/elasticsearch:8.1.2-amd64, or just change the environment, but I'm not sure if I only need to do the above steps, The steps of official website for the documentation look complicated.

  • At the moment I see that it seems that all I need is to change the image version of kibana, and then use bin/elasticsearch-create-enrollment-token -s kibana in the cluster to generate a registration token for kibana.

  • Hope someone can provide some hints.

version: "3.8"
services:
  elasticsearch-node01:
    image: elastic/elasticsearch:8.1.1-amd64
    environment:
      ES_SETTING_BOOTSTRAP_MEMORY__LOCK: true
      ES_SETTING_CLUSTER_NAME: "test-elasticsearch"
      ELASTIC_PASSWORD: "A84D1234-1234-A123-8B12-0FADA1234567"
      ES_JAVA_OPTS: "-Xms4g -Xmx4g"
    volumes:
      - elasticsearch-data01:/usr/share/elasticsearch/data
      - elasticsearch-config01:/usr/share/elasticsearch/config:rw
    ports:
      - "9200:9200"
      - "9300:9300"
    ulimits:
      memlock:
        soft: -1
        hard: -1
 kibana-node01:
    image: elastic/kibana:8.1.1
    ports:
      - "5601:5601"
    volumes:
      - kibana-data01:/usr/share/kibana/data
volumes:
  elasticsearch-data01:
    driver: local
  elasticsearch-config01:
    driver: local
 kibana-data01:
    driver: local

If Kibana is registered with Elasticsearch and everything works with 8.1.1, then you only need to change

to image: elastic/kibana:8.1.2 and image: elastic/elasticsearch:8.1.2-amd64. Elasticsearch and Kibana will handle any upgrades it might need to do internally.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.