Docker-error: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories

Hello every one
i'm new with elasticsearsh
Those are the steps that i followed :slight_smile:

  • docker pull elasticsearch:5.2.2

  • docker run -d --name=ElasticSearch --restart=unless-stopped -v /myfolder/elasticsearch/config:/usr/share/elasticsearch/config -v /var/docker/containers/elasticsearch/data:/usr/share/elasticsearch/data -p 9200:9200 -p 9300:9300 -e ES_JAVA_OPTS="-Xms8g -Xmx8g" elasticsearch

  • docker ps :
    e1425864a03c elasticsearch "/docker-entrypoin..." 4 hours ago Up 3 hours 0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp ElasticSearch

after that i want to access , myadresse ip :9200 but i got no thing

  • docker logs e1425864a03c

ERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories
ERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories
ERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories
ERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories

What's wrong in those steps , also i don't know how can i add the log4j2.properties

It is because you've overwritten the config directory completely with another external directory /myfolder/elasticsearch/config and the log4j2.properties lives there.

I recommend that you overwrite only the elasticsearch.yml as described here https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docker.html#_b_bind_mounted_configuration instead of the whole config directory.

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