在使用docker部署ES 集群时遇到了一些问题,自己记录一下
集群启动成功后有一个节点加入不了集群
failed to validate incoming join request from node Caused by: org.elasticsearch.cluster.coordination.CoordinationStateRejectedException: This node previously joined a cluster with UUID [Kzs2RYf-Qe6Y5VWrtmSrQw] and is now trying to join a different cluster with UUID [eRJNKjZjRfCpXJZbavulUQ]. This is forbidden and usually indicates an incorrect discovery or cluster bootstrapping configuration. Note that the cluster UUID persists across restarts and can only be changed by deleting the contents of the node’s data paths [] which will also remove any data held by this node.
原因:推测是因为该节点之前启动过ES,已经创建了data文件夹,与要加入的集群冲突。
解决:因为该节点之前已经启动过,有历史数据没有清理,把该节点的data文件夹删了,再次启动就行
容器启动失败,Xpack问题(包括集群状态问题)
容器启动默认是以root用户启动的,需要注意权限问题,直接递归给相关目录授予权限
chmod -R 777 data
只开启一个节点的xpack功能,另一个节点不能加入改es集群,取消xpack功能,又可以加入,问题出现在哪里?
所有节点都要配置xpack
导入索引数据时,如果索引状态显示为红色(red),则需要安装IK分词插件解决(先安装ik分词再导入数据)
索引数据未成功显示时,先停止容器,删除nodes,重新导入数据
[root@elk-node3 elasticsearch2]# ls conf data log plugins [root@elk-node3 elasticsearch2]# cd plugins/ [root@elk-node3 plugins]# ls elasticsearch-analysis-ik-7.17.13 [root@elk-node3 plugins]# cd elasticsearch-analysis-ik-7.17.13/ [root@elk-node3 elasticsearch-analysis-ik-7.17.13]# ls commons-codec-1.9.jar config httpclient-4.5.2.jar plugin-descriptor.properties commons-logging-1.2.jar elasticsearch-analysis-ik-7.16.3.jar httpcore-4.4.4.jar plugin-security.policy