a docker compose file to create elastic search container
docker-compose up
If you are creating the container for the first time, please follow these actions after the container has been created (More Information):
-
reset password On Linux:
docker exec -it es01 /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic docker exec -it es01 /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
On Windows:
docker exec -it es01 //usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic docker exec -it es01 //usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
store password after run first command
-
copy crt file
docker cp es01:/usr/share/elasticsearch/config/certs/http_ca.crt .
-
Use the crt file and the credentials (elastic:your_password) to send requests to the Elasticsearch service.
e.g.curl --cacert http_ca.crt -u elastic:your_password https://localhost:9200
docker-compose down