Skip to content

Instantly share code, notes, and snippets.

@xeraa
Created February 11, 2022 17:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save xeraa/ababb066ccc94cef01bb6e7b11dd10a2 to your computer and use it in GitHub Desktop.
Save xeraa/ababb066ccc94cef01bb6e7b11dd10a2 to your computer and use it in GitHub Desktop.
Elastic 8.0 security by default: Minimal setup with Docker for a 3 node cluster + Kibana
// Start the first node and keep the generated security credentials handy
docker run -e ES_JAVA_OPTS="-Xms1g -Xmx1g" -p 9200:9200 -it docker.elastic.co/elasticsearch/elasticsearch:8.0.0
// Check if the node has started correctly
curl --insecure --user elastic https://localhost:9200/
// Add your second node
docker run -e ENROLLMENT_TOKEN="..." -e ES_JAVA_OPTS="-Xms1g -Xmx1g" -it docker.elastic.co/elasticsearch/elasticsearch:8.0.0
// Check if it has joined the cluster
curl --insecure --user elastic https://localhost:9200/_cat/nodes
// Add the third node
docker run -e ENROLLMENT_TOKEN="" -e ES_JAVA_OPTS="-Xms1g -Xmx1g" -it docker.elastic.co/elasticsearch/elasticsearch:8.0.0
// Start Kibana and enroll it in the cluster
docker run -e SERVER_PUBLICBASEURL="..." -p 5601:5601 -it docker.elastic.co/kibana/kibana:8.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment