elastic设置密码

1.修改配置文件elasticsearch.yml

es为我的个人容器名称请按需修改


xpack.security.enabled: true


重启es 
 docker restart es

2.进入容器内部

docker exec -it es bash

#此处设置可关闭https
xpack.security.http.ssl:
  enabled: false 

进入容器后执行此命令
elasticsearch-reset-password -u username -i --url https://localhost:9200

下面是更改密过程中的交互

elasticsearch@3549332a5380:~/bin$ elasticsearch-reset-password -u elastic -i --url https://localhost:9200This tool will reset the password of the [elastic] user.
You will be prompted to enter the password.
Please confirm that you would like to continue [y/N]y

Enter password for [elastic]: 
Re-enter password for [elastic]: 
Passwords do not match.
Try again.
Enter password for [elastic]: 
Re-enter password for [elastic]: 
Password for the [elastic] user successfully reset

个人完整的文件如下


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 22-02-2024 13:23:21
#
# --------------------------------------------------------------------------------

# 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: false #关闭https
  keystore.path: certs/http.p12

# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
  enabled: false
  verification_mode: certificate
  keystore.path: certs/transport.p12
  truststore.path: certs/transport.p12
#----------------------- END SECURITY AUTO CONFIGURATION -------------------------


3. 访问es

访问地址 http://ip:port

按照账号密码输入即可访问
在这里插入图片描述

在这里插入图片描述

4.kibana配置如下

https://blog.csdn.net/qq_52594679/article/details/136257664?spm=1001.2014.3001.5501

  • 13
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值