How to disable security (username/password) on Elasticsearch Docker container?
Asked Answered
A

2

20

I would like to run the Dockerized version of Elasticsearch without username/password based security (I use other means, like AWS security groups).

How do I disable username/password security in Elasticsearch Docker?

Airdry answered 31/10, 2017 at 12:8 Comment(0)
A
45

Docker

Simply add the xpack.security.enabled=false env var:

docker run \
       -p 9200:9200 \
       -p 9300:9300 \
       -e "discovery.type=single-node" \
       -e "xpack.security.enabled=false" \
       docker.elastic.co/elasticsearch/elasticsearch:5.6.3

Ansible

When running the container using Ansible's docker_container, some yaml idiosyncrasies forces you to use 0 instead of false:

env:
  discovery.type: "single-node"
  xpack.security.enabled: 0
  ..
Airdry answered 31/10, 2017 at 12:8 Comment(3)
are you sure setting it to 0 works? I get an exception that it must be a string.Guttle
false worked for me.Electrotechnology
In my docker-compose, in environment section I had to put "false" as a string; false resulted in a build error (services.storage.environment.xpack.security.enabled contains false, which is an invalid type, it should be a string, number, or a null), and 0 resulted in a runtime error (java.lang.IllegalStateException: failed to load plugin class [org.elasticsearch.xpack.security.Security).Mackler
S
0

Remember to set this 👇 env, to run ElasticSearch in non-production mode

       -e "discovery.type=single-node" \
Shawnee answered 10/8, 2023 at 7:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.