Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ElasticSearch java.io.IOException: failed to read ... in docker

I tried to reassemble a container for elasticsearch on docker with deffirents version but I still have this error.

 org.elasticsearch.bootstrap.StartupException: ElasticsearchException[java.io.IOException: failed to read [id:1, legacy:false, file:/usr/share/elasticsearch/data/nodes/0/_state/node-1.st]]; nested: IOException[failed to read [id:1, legacy:false, file:/usr/share/elasticsearch/data/nodes/0/_state/node-1.st]]; nested: IllegalArgumentException[[node_meta_data] unknown field [node_version], parser not found];

This is my config DockerFile for elasticsearch:

ur_elasticsearch:
  container_name: "ur_elasticsearch"
  image: docker.elastic.co/elasticsearch/elasticsearch:5.3.1
  environment:
    - xpack.security.enabled=false
    - http.host=0.0.0.0
    - transport.host=127.0.0.1
  ports:
    - "9200:9200"
  volumes:
    - ./db-files/elasticsearch-data:/usr/share/elasticsearch/data
  healthcheck:
    test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"]
    interval: 60s
    timeout: 30s
    retries: 3
  • docker version: 19.03.5, build 633a0ea838
  • docker-compose version : 1.24.0, build 0aa59064
  • Ubuntu 18.04.3 LTS
like image 555
Mido Avatar asked Nov 05 '25 07:11

Mido


1 Answers

It looks like you are using a volume from your previous version of elasticsearch.

Try to change your ./db-files/elasticsearch-data to something new. Like ./db-files/elasticsearch-data-2 or remove old volume with docker volume rm.

Use docker volume ls to find out which volume needs to be removed.

like image 78
Volex Avatar answered Nov 07 '25 10:11

Volex



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!