错误一:
[2022-04-01T19:49:21,583][INFO ][o.e.c.c.JoinHelper ] [es2] failed to join {es3}{CFmzQaz2Rru5Tk0Fw9F4pw }{zy-w5eiBTO2KwJxS3DSrTg}{192.168.0.5}{192.168.0.5:9300}{cdfhilmrstw}{ml.machine_memory=3973537792, xpack.ins talled=true, ml.max_jvm_size=536870912} with JoinRequest{sourceNode={es2}{CFmzQaz2Rru5Tk0Fw9F4pw}{L6T1dV9RQAW rHL6V6uDqqw}{192.168.0.6}{192.168.0.6:9300}{cdfhilmrstw}{ml.machine_memory=3973550080, xpack.installed=true, ml.max_jvm_size=536870912}, minimumTerm=33, optionalJoin=Optional.empty}
org.elasticsearch.transport.RemoteTransportException: [es3][192.168.0.5:9300][internal:cluster/coordination/j oin]
Caused by: java.lang.IllegalArgumentException: can't add node {es2}{CFmzQaz2Rru5Tk0Fw9F4pw}{L6T1dV9RQAWrHL6V6 uDqqw}{192.168.0.6}{192.168.0.6:9300}{cdfhilmrstw}{ml.machine_memory=3973550080, xpack.installed=true, ml.max _jvm_size=536870912}, found existing node {es3}{CFmzQaz2Rru5Tk0Fw9F4pw}{zy-w5eiBTO2KwJxS3DSrTg}{192.168.0.5}{ 192.168.0.5:9300}{cdfhilmrstw}{ml.machine_memory=3973537792, xpack.installed=true, ml.max_jvm_size=536870912} with the same id but is a different node instance
我把ES3上的Elasticsearch整个文件夹复制到了ES2上,出现了这个错误,错误原因也比较明显:
with the same id but is a different node instance
解决办法:
把Elasticsearch目录下的data文件夹下内容删除即可解决。
我在删除data目录之后又在root用户下创建了该目录,出现如下
错误二:
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [/home/software/elasticsearch/data]; maybe these locations are not writable or multiple nodes were started on the same data path?
这个是因为我粗心,没有把data目录的权限赋予es用户。
解决办法:
chown -R es:es /home/elasticsearch/data
启动成功: