https://www.docker.elastic.co/r/elasticsearch?limit=50&offset=400&show_snapshots=false
docker network create elastic
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.3.2
这里在运行的时候设置ES的java_opts , discovery.type=single-node 单点模式
docker run -e ES_JAVA_OPTS="-Xms256m -Xmx256m" -e "discovery.type=single-node" --name es-node01 --net elastic -p 9200:9200 -p 9300:9300 -t docker.elastic.co/elasticsearch/elasticsearch:8.3.2
...
----------------------------------------------------------------------------------------------------------------------------
-> Elasticsearch security features have been automatically configured!
-> Authentication is enabled and cluster connections are encrypted.
-> Password for the elastic user (reset with `bin/elasticsearch-reset-password -u elastic`):
SvuY++qbLxwj*c+U_5Gm
-> HTTP CA certificate SHA-256 fingerprint:
8f160e2f8a672896f0d7fa819b15281018f8771d704f80d949e49159dbce0741
-> Configure Kibana to use this cluster:
* Run Kibana and click the configuration link in the terminal when Kibana starts.
* Copy the following enrollment token and paste it into Kibana in your browser (valid for the next 30 minutes):
eyJ2ZXIiOiI4LjMuMiIsImFkciI6WyIxNzIuMjUuMC4yOjkyMDAiXSwiZmdyIjoiOGYxNjBlMmY4YTY3Mjg5NmYwZDdmYTgxOWIxNTI4MTAxOGY4NzcxZDcwNGY4MGQ5NDllNDkxNTlkYmNlMDc0MSIsImtleSI6ImVOOE8zWUVCclRGNndwTlhoYXNXOlZVV0xLMzJyUWQ2SnpFS2dWWW8zMFEifQ==
-> Configure other nodes to join this cluster:
* Copy the following enrollment token and start new Elasticsearch nodes with `bin/elasticsearch --enrollment-token <token>` (valid for the next 30 minutes):
eyJ2ZXIiOiI4LjMuMiIsImFkciI6WyIxNzIuMjUuMC4yOjkyMDAiXSwiZmdyIjoiOGYxNjBlMmY4YTY3Mjg5NmYwZDdmYTgxOWIxNTI4MTAxOGY4NzcxZDcwNGY4MGQ5NDllNDkxNTlkYmNlMDc0MSIsImtleSI6ImV0OE8zWUVCclRGNndwTlhoYXRvOkV3WXpWZWxmU2hpYjlXOUlucmxnVUEifQ==
If you're running in Docker, copy the enrollment token and run:
`docker run -e "ENROLLMENT_TOKEN=" docker.elastic.co/elasticsearch/elasticsearch:8.3.2`
----------------------------------------------------------------------------------------------------------------------------
...
https://ip:9200, 后输入 用户: elastic
密码:SvuY++qbLxwj*c+U_5Gm
(上面打印出的)
{
“name” : “376cbb59a1ba”,
“cluster_name” : “docker-cluster”,
“cluster_uuid” : “OEf4xN4QRZWMgS_lGWaNSQ”,
“version” : {
“number” : “8.3.2”,
“build_type” : “docker”,
“build_hash” : “8b0b1f23fbebecc3c88e4464319dea8989f374fd”,
“build_date” : “2022-07-06T15:15:15.901688194Z”,
“build_snapshot” : false,
“lucene_version” : “9.2.0”,
“minimum_wire_compatibility_version” : “7.17.0”,
“minimum_index_compatibility_version” : “7.0.0”
},
“tagline” : “You Know, for Search”
}
docker run --link YOUR_ELASTICSEARCH_CONTAINER_NAME_OR_ID:elasticsearch -p 5601:5601 docker.elastic.co/kibana/kibana:{version}
docker run --name kib-01 --link es-node01:elasticsearch --net elastic -p 5601:5601 docker.elastic.co/kibana/kibana:8.3.2
root@lsJdqPY6je:~# docker run --rm -p 8080:8080 -itd --name mem-tomcat8.5.20 register.me.ltd/tomcat:8.5.20
24dcfd9debe231cfbacc0337153b14260ba98559e2c4d813d3d3b74b28dcd9b8
root@lsJdqPY6je:~# docker run --name kib-01 --link es-node01:elasticsearch --net elastic -p 5601:5601 docker.elastic.co/kibana/kibana:8.3.2
[2022-07-08T09:12:33.062+00:00][INFO ][plugins-service] Plugin "cloudSecurityPosture" is disabled.
[2022-07-08T09:12:33.214+00:00][INFO ][http.server.Preboot] http server running at http://0.0.0.0:5601
[2022-07-08T09:12:33.260+00:00][INFO ][plugins-system.preboot] Setting up [1] plugins: [interactiveSetup]
[2022-07-08T09:12:33.262+00:00][INFO ][preboot] "interactiveSetup" plugin is holding setup: Validating Elasticsearch connection configuration…
[2022-07-08T09:12:33.298+00:00][INFO ][root] Holding setup until preboot stage is completed.
i Kibana has not been configured.
Go to http://0.0.0.0:5601/?code=564214 to get started.
Your verification code is: 564 214
docker exec -it es-node01 /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
root@lsJdqPY6je:~# docker exec -it es-node01 /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
eyJ2ZXIiOiI4LjMuMiIsImFkciI6WyIxNzIuMjUuMC4yOjkyMDAiXSwiZmdyIjoiNzliYTQyYjc3Yzc2YjIxZWNiNmNlMjZkYzIwNTBkZTFhNTQ1ZTliYjY0ODVlNmYyYzU1M2Y1YzYyMDBhNWRkMCIsImtleSI6ImNTQm0zSUVCdEtmaEF1cEZvbTI2Oldxb3RZX3BOUVdTakhIUVVaR2hGcncifQ==
root@lsJdqPY6je:~#
可以用用户名elastic 密码SvuY++qbLxwj*c+U_5Gm 进行登录,elastic的用户名和密码elasticsearch启动的时候控制台有打印。
-> Password for the elastic user (reset with bin/elasticsearch-reset-password -u elastic
):
SvuY++qbLxwj*c+U_5Gm