Docker images for Kibana are available from the Elastic Docker registry. The base image is ubuntu:20.04. A list of all published Docker images and tags…
①Install Docker. Visit Get Docker to install Docker for your environment.
{“@timestamp”:”2025-04-27T03:52:15.877Z”, “log.level”:”ERROR”, “message”:”node validation exception\n[1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch. For more information see [https://www.elastic.co/docs/deploy-manage/deploy/self-managed/bootstrap-checks?version=9.0]\nbootstrap check failure [1] of [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]; for more information see [https://www.elastic.co/docs/deploy-manage/deploy/self-managed/bootstrap-checks?version=9.0#bootstrap-checks-max-map-count]”, “ecs.version”: “1.2.0”,”service.name”:”ES_ECS”,”event.dataset”:”elasticsearch.server”,”process.thread.name”:”main”,”log.logger”:”org.elasticsearch.bootstrap.Elasticsearch”,”elasticsearch.node.name”:”3ec751148616″,”elasticsearch.cluster.name”:”docker-cluster”}
docker: Error response from daemon: Conflict. The container name “/es01” is already in use by container “bcb10939605af661ac8d6f3e5b6b97fbc7ab5c604f1964a70d359265d5c94120”. You have to remove (or rename) that container to be able to reuse that name
と出るので、docker rm es01でコンテナを消します。
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bcb10939605a docker.elastic.co/elasticsearch/elasticsearch:9.0.0 "/bin/tini -- /usr/l…" 41 minutes ago Exited (78) 41 minutes ago es01
docker rm es01
es01
そしたら再度docker runを叩きます。
ドカドカとメッセージがでてきますが、その中に
Password for the elastic user (reset with bin/elasticsearch-reset-password -u elastic): ぱすわーど
とElacticSearchの初期パスワードが発行されますのでコレをメモっておきます。
続いて
~ Copy the following enrollment token and paste it into Kibana in your browser (valid for the next 30 minutes):とーくん
docker logs es01 | grep "WARN"
...
{"@timestamp":"2025-04-27T05:12:54.499Z", "log.level": "WARN", "message":"this node is locked into cluster UUID [hKWpHYMgRnGbbfk_6L2LmA] but [cluster.initial_master_nodes] is set to [0e04dbe110af]; remove this setting to avoid possible data loss caused by subsequent cluster bootstrap attempts; for further information see https://www.elastic.co/docs/deploy-manage/deploy/self-managed/important-settings-configuration?version=9.0#initial_master_nodes", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"main","log.logger":"org.elasticsearch.cluster.coordination.ClusterBootstrapService","elasticsearch.node.name":"0e04dbe110af","elasticsearch.cluster.name":"docker-cluster"}
...
「[cluster.initial_master_nodes] is set to [0e04dbe110af];」ということで、master_nodesの設定周りがおかしいっぽいので「elasticsearch.yml」を見てみます。
docker exec -it es01 cat /usr/share/elasticsearch/config/elasticsearch.yml
cluster.name: "docker-cluster"
network.host: 0.0.0.0
#----------------------- BEGIN SECURITY AUTO CONFIGURATION -----------------------
#
# The following settings, TLS certificates, and keys have been automatically
# generated to configure Elasticsearch security features on 27-04-2025 04:58:57
#
# --------------------------------------------------------------------------------
# Enable security features
xpack.security.enabled: true
xpack.security.enrollment.enabled: true
# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:
enabled: true
keystore.path: certs/http.p12
# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
enabled: true
verification_mode: certificate
keystore.path: certs/transport.p12
truststore.path: certs/transport.p12
# Create a new cluster with the current node only
# Additional nodes can still join the cluster later
cluster.initial_master_nodes: ["0e04dbe110af"]
#----------------------- END SECURITY AUTO CONFIGURATION -------------------------
Have you wondered if you could just use http://localhost:9200 as the environment variable? The answer is no, and that’s because Kibana will just query its localhost network for port 9200, and Elasticsearch IS NOT on the same machine our Kibana is. It’ll just fail with the message: Unable to retrieve version information from Elasticsearch nodes. connect ECONNREFUSED 127.0.0.1:9200.
Docker images for Logstash are available from the Elastic Docker registry. The base image is Red Hat Universal Base Image 9 Minimal. A list of all published…