首页 > 解决方案 > ElasticSearch java.io.IOException:无法在 docker 中读取 ...

问题描述

我试图在 docker 上用 deffirents 版本重新组装一个用于 elasticsearch 的容器,但我仍然有这个错误。

 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];

这是我为 elasticsearch 配置的 DockerFile:

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

标签: dockerelasticsearchdocker-compose

解决方案


看起来您正在使用以前版本的弹性搜索中的卷。

尝试将您的./db-files/elasticsearch-data更改为新的。喜欢./db-files/elasticsearch-data-2或删除旧卷docker volume rm.

用于docker volume ls找出需要删除的卷。


推荐阅读