ElasticSearch备考 -- 集群配置常见问题

一、集群开启xpack安全配置后无法启动

在配置文件中增加 xpack.security.enabled: true 后无法启动,日志中提示如下

复制代码
Transport SSL must be enabled if security is enabled. Please set [xpack.security.transport.ssl.enabled] to [true] or disable security by setting [xpack.security.enabled] to [false]

1)需要在配置文件中,开启ssl传输,并且配置加密秘钥路径

复制代码
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.client_authentication: required
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12

2)通过如下命令创建CA

复制代码
./bin/elasticsearch-certutil ca 

3)颁发证书

复制代码
./bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12 

执行成功后后在节点路径中会增加 elastic-certificates.p12 和 elastic-stack-ca.p12 文件,

4)将这两个文件移动到 config 目录中

执行完成以上步骤后在重启服务,便可以成功

注意:如果执行启动命令还是有问题,或者在某个节点无法链接到集群,建议把data目录的中文件全部删除,在执行启动命令

二、设置用户密码失败

使用 ./elasticsearch-setup-passwords auto 设置密码失败,报错信息如下

复制代码
Unexpected response code [503] from calling PUT http://127.0.0.1:9200/_security/user/apm_system/_password?pretty
Cause: Cluster state has not been recovered yet, cannot write to the [null] index

Possible next steps:
* Try running this tool again.
* Try running with the --verbose parameter for additional messages.
* Check the elasticsearch logs for additional error details.
* Use the change password API manually. 


ERROR: Failed to set password for user [apm_system].

原因:集群没有正常启动,需要保证集群为启动状态后

三、跨集群查询失败

夸集群查询必须在集群中节点增加一个角色 remote_cluster_client_role,在官方文档中有提示说明,地址如下:Node | Elasticsearch Guide [8.1] | Elastic。这一点需要注意

送一波福利:

福利一

有需要内推JD的同学,可以私信或留言,我帮您内推,流程快!!!

有需要内推JD的同学,可以私信或留言,我帮您内推,流程快!!!

有需要内推JD的同学,可以私信或留言,我帮您内推,流程快!!!

福利二

福利三

相关推荐
小Tomkk1 分钟前
数据库 变更和版本控制管理工具 --Bytebase 安装部署(linux 安装篇)
linux·运维·数据库·ci/cd·bytebase
赌博羊1 分钟前
ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32‘ not found
linux·运维·gnu
rannn_11122 分钟前
【苍穹外卖|Day4】套餐页面开发(新增套餐、分页查询、删除套餐、修改套餐、起售停售)
java·spring boot·后端·学习
消失的旧时光-194329 分钟前
Linux 入门核心命令清单(工程版)
linux·运维·服务器
艾莉丝努力练剑36 分钟前
【Linux:文件】Ext系列文件系统(初阶)
大数据·linux·运维·服务器·c++·人工智能·算法
张人玉36 分钟前
VisionPro 定位与卡尺测量学习笔记
笔记·学习·计算机视觉·vsionprp
小天源39 分钟前
Cacti在Debian/Ubuntu中安装及其使用
运维·ubuntu·debian·cacti
倒流时光三十年1 小时前
SpringBoot 数据库同步 Elasticsearch 性能优化
数据库·spring boot·elasticsearch
Trouvaille ~1 小时前
【Linux】TCP Socket编程实战(一):API详解与单连接Echo Server
linux·运维·服务器·网络·c++·tcp/ip·socket
觉醒大王1 小时前
强女思维:着急,是贪欲外显的相。
java·论文阅读·笔记·深度学习·学习·自然语言处理·学习方法