Skip to content

Instantly share code, notes, and snippets.

@dadoonet
Forked from xeraa/commands.sh
Created February 11, 2022 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dadoonet/942cecfa76fb935a0e4824228841aea1 to your computer and use it in GitHub Desktop.
Save dadoonet/942cecfa76fb935a0e4824228841aea1 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