Last active
September 1, 2023 14:38
-
-
Save RaniAgus/8dccd974b24e097ff48da83024777ab3 to your computer and use it in GitHub Desktop.
ElasticSearch Docker Env
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3.0" | |
| services: | |
| es: | |
| container_name: es-01 | |
| image: docker.elastic.co/elasticsearch/elasticsearch:8.8.1 | |
| restart: always | |
| networks: | |
| - elastic | |
| ports: | |
| - 9200:9200 | |
| - 9300:9300 | |
| volumes: | |
| - esdata:/usr/share/elasticsearch/data | |
| kib: | |
| container_name: kib-01 | |
| image: docker.elastic.co/kibana/kibana:8.8.1 | |
| restart: always | |
| networks: | |
| - elastic | |
| depends_on: | |
| - es | |
| ports: | |
| - 5601:5601 | |
| volumes: | |
| - kibconfig:/usr/share/kibana/config | |
| - kibdata:/usr/share/kibana/data | |
| networks: | |
| elastic: | |
| volumes: | |
| esdata: | |
| kibconfig: | |
| kibdata: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ES != yq -r .services.es.container_name docker-compose.yml | |
| KIB != yq -r .services.kib.container_name docker-compose.yml | |
| all: | |
| @echo "ES: $(ES)" | |
| @echo "KIB: $(KIB)" | |
| pass: | |
| docker exec -it $(ES) /usr/share/elasticsearch/bin/elasticsearch-reset-password -bsu elastic | |
| token: | |
| docker exec -it $(ES) /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana | |
| verify: | |
| docker cp $(ES):/usr/share/elasticsearch/config/certs/http_ca.crt . | |
| curl --cacert http_ca.crt -u elastic https://localhost:9200 | |
| rm http_ca.crt | |
| keystore: | |
| docker exec -it $(KIB) bin/kibana-keystore create | |
| docker exec -it $(KIB) bin/kibana-keystore add elasticsearch.username | |
| docker exec -it $(KIB) bin/kibana-keystore add elasticsearch.password |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment