内容目录
Create Network and Volume:
docker network create elastic
docker volume create elasticsearch
Create Container:
docker run -itd --name elasticsearch \
--publish 9200:9200 --net elastic \
--env discovery.type=single-node \
--env xpack.security.authc.api_key.enabled=true \
--volume='elasticsearch:/usr/share/elasticsearch/data' \
docker.elastic.co/elasticsearch/elasticsearch:8.4.3
This will generate a lot of installation logs:
Then enter the container.
docker exec -it elasticsearch bash
Open the /bin
directory.
Execute the command to reset the password:
./elasticsearch-setup-passwords interactive
Run the command to check if the connection is successful:
curl -u elastic http://localhost:9200/
Install Kibana:
docker run --name kibana \
-itd \
--publish 5601:5601 --net elastic \
--env ELASTICSEARCH_USERNAME=kibana_system \
--env ELASTICSEARCH_PASSWORD='your_password' \
docker.elastic.co/kibana/kibana:8.4.3
If the password is set too simply, you will see:
Error: [config validation of [elasticsearch].password]: expected value of type [string] but got [number]
In this case, you need to modify each user's password.
./elasticsearch-reset-password -u kibana_system
Then copy the generated password, replace it in the command, and recreate Kibana.
Finally, open port 5601 to access Kibana.
文章评论