【es8】docker安装es8+kibana8

1.docker拉取安装包

docker pull elasticsearch:8.12.2
docker pull kibana:8.12.2

2.安装es8

单点部署

# 创建网络
docker network create es-net
# 运行容器
docker run -it \
--name es \
--net es-net \
--restart=always \
-p 8000:9200 \
-p 8001:9300 \
-e "discovery.type=single-node" \
elasticsearch:8.12.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`):
  Esip1jxWlRPBHXMujGxK

ℹ️  HTTP CA certificate SHA-256 fingerprint:
  c68d0f58b4523c51dd1cdc927b56f4a52f8929e9cde086a316bfd60c24798255

ℹ️  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):
  eyJ2ZXIiOiI4LjEyLjIiLCJhZHIiOlsiMTcyLjE4LjAuMjo5MjAwIl0sImZnciI6ImM2OGQwZjU4YjQ1MjNjNTFkZDFjZGM5MjdiNTZmNGE1MmY4OTI5ZTljZGUwODZhMzE2YmZkNjBjMjQ3OTgyNTUiLCJrZXkiOiJwOGluSG84QkI0SG1LUDNxY2ZrUzpQdlBNbVB1SVFteXlDeS1EQnlwZmxBIn0=

ℹ️ 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):
  eyJ2ZXIiOiI4LjEyLjIiLCJhZHIiOlsiMTcyLjE4LjAuMjo5MjAwIl0sImZnciI6ImM2OGQwZjU4YjQ1MjNjNTFkZDFjZGM5MjdiNTZmNGE1MmY4OTI5ZTljZGUwODZhMzE2YmZkNjBjMjQ3OTgyNTUiLCJrZXkiOiJwc2luSG84QkI0SG1LUDNxY2ZrUzpOU1hJbU5iRFJCeXJybjhuOE9tdUV3In0=

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

修改配置文件

# 把配置文件copy出来
docker cp es:/usr/share/elasticsearch/config/elasticsearch.yml ./

# =====添加如下配置=====
# 开启跨域
http.cors.enabled: true
# 所有人访问
http.cors.allow-origin: "*"
# ======================

# =====修改如下配置为false=====
xpack.security.enabled: false
xpack.security.http.ssl:
  enabled: false
# ======================


# 把配置文件copy回去
docker cp elasticsearch.yml es:/usr/share/elasticsearch/config/

# 重启服务
docker restart es

3.安装kibana

docker run -d \
  --name kib \
    --network=es-net \
    -p 8002:5601 \
kibana:8.13.0

修改配置文件

docker cp kib:/usr/share/kibana/config/kibana.yml ./

# ========添加配置
#设置中文
i18n.locale: "zh-CN"
#关闭csp
csp.strict: false
# ========

docker cp kibana.yml kib:/usr/share/kibana/config/

docker restart kib

启动后遇到一个kib后台错误,无法验证令牌连接到es

es write EPROTO C02754C0847F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:354:
# 查看es的ip地址
docker network inspect es-net

"e64dc922a7cdb9528bdf2f724f9846f99349234cc2a467a3f3e838de246dde41": {
                "Name": "es",
                "EndpointID": "91a8a618a1eb01eac18fd53c5a6a76beecd9ca44e8678f632908a530b6f73ac0",
                "MacAddress": "02:42:ac:12:00:02",
                "IPv4Address": "172.18.0.2/16",
                "IPv6Address": ""
            }
# 将kib的配置文件进行修改
elasticsearch.hosts: [ "http://172.18.0.2:9200" ]

docker cp kibana.yml  kib:/usr/share/kibana/config/

在这里插入图片描述

参考1
参考2
参考3
参考4
参考5

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值