Need to upgrade Elasticsearch , Kibana installed with docker compose from 7.10 to 7.17
This document
shares other methods but not containers installed/started with docker compose - swarm.
Is their a steps by step documentation for the same?
Not one that we provide sorry.
Generally with docker containers you would just point the compose file to the new image, and then restart it.
Need to do complete installation of the new image 7.17 as was done for 7.10 & then point to it?
According to my understanding, first of all you'd better take a snapshot, and volumes have to use the original location, then modify the image tag, and finally docker-compose up, remember that you should use docker-compose stop to end the container at the beginning, not Use docker-compose down. If you're still worried, you can take a test.
Can you share the steps to modify the image tag?
It's very simple, assuming you use the following docker-compose.yml to deploy, then just execute docker-compose stop, end the container, then modify elasticsearch:7.10 to elasticsearch:7.17.6, and finally open the container again docker-compose up.
version: '3.6'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.10
container_name: es-docker
environment:
- node.name=es-docker
- cluster.name=es-single-node
- discovery.type=single-node
- bootstrap.memory_lock=false
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- esdata:/usr/share/elasticsearch/data
ports:
- 9200:9200
- 9300:9300
networks:
- elastic
volumes:
esdata:
driver: local
networks:
elastic:
driver: bridge
ahh, thanks. yeah it's really simple and i was going around places.
One last query, during last step, i get below error. Where all should i rename containers es01/02/03/kib01 so it recreate the containers? I want to retain the data and all other stuff, just upgrade to 7.17.
"Status: Downloaded newer image for docker.elastic.co/kibana/kibana:7.17.6
Creating es03 ... error
Creating es01 ...
Creating kib01 ...
Creating es02 ...
Creating es02 ... error
ner to be able to reuse that name.
ERROR: for es02 Cannot create container for service es02: Conflict. The container name "/es02" is already in use by container "". You have to remove (or rename) that contaiCreating kib01 ... error
Creating es01 ... error
ERROR: for kib01 Cannot create container for service kibana: Conflict. The container name "/kib01" is already in use by container "". You have to remove (or rename) that container to be able to reuse that name.
ERROR: for es01 Cannot create container for service es01: Conflict. The container name "/es01" is already in use by container "". You have to remove (or rename) that container to be able to reuse that name.
ERROR: for es03 Cannot create container for service es03: Conflict. The container name "/es03" is already in use by container "". You have to remove (or rename) that container to be able to reuse that name.
I guess you should run docker container ls to see if the container is still running and delete the es01-03 and kib01 containers.
But there is another note, in cluster mode, there will be a clusterId, elastic data is bound to it, you need to let es recognize it and generate new coverage, I have not tested the cluster upgrade, you'd better do a test first.
In another environment, docker-compose.yml image mentions the version as below and there is no .env file as well. Where should i update the version number in such a case to upgrade ES?
image: docker.elastic.co/elasticsearch/elasticsearch:${VERSION}
Create a new environment variable value VERSION, or write it in the .env
file.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.