docker 安装es8.x kibana8.x

由于 es 8.x 开始需要有了一些安全校验,直接用安装包安装很是复杂,安装了好几次都失败了,后来用了docker安装,真的是省事,快捷,准确,方便~~~

# 拉取镜像
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.2.3
docker pull docker.elastic.co/kibana/kibana:8.2.3
 
# 创建网络
docker network create elastic
 
# 启动 Elastic Search 8.2.3
docker run -it \
--name elasticsearch \
--net elastic \
--restart=always \
-p 9200:9200 \
-p 9300:9300 \
-e "discovery.type=single-node" \
docker.elastic.co/elasticsearch/elasticsearch:8.2.3
# 第一次的日志中会打印出默认用户elastic的初始密码,以及用于Kibana启动的enrollment token(半小时有效)注意保存
 
# 启动 Kibana 8.2.3
docker run \
--name kibana \
--net elastic \
-p 5601:5601 \
docker.elastic.co/kibana/kibana:8.2.3
# 第一次的日志中会打印出启动配置网址,在浏览器打开并输入enrollment token,等待完成配置
# 使用用户名elastic和之前保存的密码登录

第一次的日志中会打印出默认用户elastic的初始密码,以及用于Kibana启动的enrollment token

这里 是es首次启动时候的日志,需要把里面的一些认证复制出来!!!!!!!!!!!!!!!!!!!!!
后续会用到
我的是这样

-> 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`):
  oQFJLxEgn8O*IitG*BwR

->  HTTP CA certificate SHA-256 fingerprint:
  a1c398a7330cc27b30b1b3098f37595963624515069a2499b585c9cc5d76909c

->  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):
  eyJ2ZXIiOiI4LjIuMyIsImFkciI6WyIxNzIuMTguMC4yOjkyMDAiXSwiZmdyIjoiYTFjMzk4YTczMzBjYzI3YjMwYjFiMzA5OGYzNzU5NTk2MzYyNDUxNTA2OWEyNDk5YjU4NWM5Y2M1ZDc2OTA5YyIsImtleSI6IkVQeUFxWUVCRzRxM1hoY1ZZM3pHOkRUMVA0cUxIU2RpaTVaMjgtWDc4a1EifQ==

-> Configure other nodes to join this cluster:
* Copy the following enrollment token and start new Elasticsearch nodes with `bin/elasticsearch --enrollment-token ` (valid for the next 30 minutes):
  eyJ2ZXIiOiI4LjIuMyIsImFkciI6WyIxNzIuMTguMC4yOjkyMDAiXSwiZmdyIjoiYTFjMzk4YTczMzBjYzI3YjMwYjFiMzA5OGYzNzU5NTk2MzYyNDUxNTA2OWEyNDk5YjU4NWM5Y2M1ZDc2OTA5YyIsImtleSI6IkR2eUFxWUVCRzRxM1hoY1ZZM3l5OmEyQjE5c3RwUklHTl9KaEljWnJ6RmcifQ==

  If you're running in Docker, copy the enrollment token and run:
  `docker run -e "ENROLLMENT_TOKEN=" docker.elastic.co/elasticsearch/elasticsearch:8.2.3`

安装完kibana后,docker启动kibanan后也会输出一个地址,告诉你去配置,然后你复制到浏览器,改成kibana所在ip

会让你输入token 也就是
eyJ2ZXIiOiI4LjIuMyIsImFkciI6WyIxNzIuMTguMC4yOjkyMDAiXSwiZmdyIjoiYTFjMzk4YTczMzBjYzI3YjMwYjFiMzA5OGYzNzU5NTk2MzYyNDUxNTA2OWEyNDk5YjU4NWM5Y2M1ZDc2OTA5YyIsImtleSI6IkVQeUFxWUVCRzRxM1hoY1ZZM3pHOkRUMVA0cUxIU2RpaTVaMjgtWDc4a1EifQ==
这个中的token

->  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):
  eyJ2ZXIiOiI4LjIuMyIsImFkciI6WyIxNzIuMTguMC4yOjkyMDAiXSwiZmdyIjoiYTFjMzk4YTczMzBjYzI3YjMwYjFiMzA5OGYzNzU5NTk2MzYyNDUxNTA2OWEyNDk5YjU4NWM5Y2M1ZDc2OTA5YyIsImtleSI6IkVQeUFxWUVCRzRxM1hoY1ZZM3pHOkRUMVA0cUxIU2RpaTVaMjgtWDc4a1EifQ==
docker 安装es8.x kibana8.x_第1张图片
image.png

首次输入kibana需要配置,需要稍微等一下

然后输入用户名密码
用户名: elastic
密码: 就是es运行日志中打印出来的这段 中的 oQFJLxEgn8OIitGBwR

->  Password for the elastic user (reset with `bin/elasticsearch-reset-password -u elastic`):
  oQFJLxEgn8O*IitG*BwR
docker 安装es8.x kibana8.x_第2张图片
image.png

你可能感兴趣的:(linux,docker,elasticsearch,容器,运维,大数据)