es无法加入集群

发现有2台服务器4月中旬就要到期了,上面的业务量属实挺小的,没有续费必要。直接合并到其他节点可以节省成本

把lv2节点的elasticsearch迁移到新节点lv7,发现无法加入集群了

在这里插入图片描述

iCYdhj0R-m0A}{ccMEAELgTWu9pvE1fTH2Og}{172.18.142.49}{172.18.142.49:9300}{ml.machine_memory=16544047104, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true}]; ]
[2025-04-02T20:01:19,668][INFO ][o.e.d.z.ZenDiscovery     ] [node-1] failed to send join request to master [{node-1}{Lehwm7ZHSNiCYdhj0R-m0A}{ccMEAELgTWu9pvE1fTH2Og}{172.18.142.49}{172.18.142.49:9300}{ml.machine_memory=16544047104, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true}], reason [RemoteTransportException[[node-1][172.18.142.49:9300][internal:discovery/zen/join]]; nested: ConnectTransportException[[node-1][172.17.0.1:9300] handshake failed. unexpected remote node {node-1}{Lehwm7ZHSNiCYdhj0R-m0A}{ccMEAELgTWu9pvE1fTH2Og}{172.18.142.49}{172.18.142.49:9300}{ml.machine_memory=16544047104, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true}]; ]
[2025-04-02T20:01:22,782][INFO ][o.e.d.z.ZenDiscovery     ] [node-1] failed to send join request to master [{node-1}{Lehwm7ZHSNiCYdhj0R-m0A}{ccMEAELgTWu9pvE1fTH2Og}{172.18.142.49}{172.18.142.49:9300}{ml.machine_memory=16544047104, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true}], reason [RemoteTransportException[[node-1][172.18.142.49:9300][internal:discovery/zen/join]]; nested: ConnectTransportException[[node-1][172.17.0.1:9300] handshake failed. unexpected remote node {node-1}{Lehwm7ZHSNiCYdhj0R-m0A}{ccMEAELgTWu9pvE1fTH2Og}{172.18.142.49}{172.18.142.49:9300}{ml.machine_memory=16544047104, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true}]; ]
[2025-04-02T20:01:25,873][INFO ][o.e.d.z.ZenDiscovery     ] [node-1] failed to send join request to master [{node-1}{Lehwm7ZHSNiCYdhj0R-m0A}{ccMEAELgTWu9pvE1fTH2Og}{172.18.142.49}{172.18.142.49:9300}{ml.machine_memory=16544047104, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true}], reason [RemoteTransportException[[node-1][172.18.142.49:9300][internal:discovery/zen/join]]; nested: ConnectTransportException[[node-1][172.17.0.1:9300] handshake failed. unexpected remote node {node-1}{Lehwm7ZHSNiCYdhj0R-m0A}{ccMEAELgTWu9pvE1fTH2Og}{172.18.142.49}{172.18.142.49:9300}{ml.machine_memory=16544047104, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true}]; ]
[2025-04-02T20:01:26,592][INFO ][o.e.x.s.a.AuthenticationService] [node-1] Authentication of [elastic] was terminated by realm [reserved] - failed to authenticate user [elastic]
[2025-04-02T20:01:28,760][INFO ][o.e.x.s.a.AuthenticationService] [node-1] Authentication of [elastic] was terminated by realm [reserved] - failed to authenticate user [elastic]
[2025-04-02T20:01:28,875][INFO ][o.e.x.s.a.AuthenticationService] [node-1] Authentication of [elastic] was terminated by realm [reserved] - failed to authenticate user [elastic]
[2025-04-02T20:01:28,970][INFO ][o.e.d.z.ZenDiscovery     ] [node-1] failed to send join request to master [{node-1}{Lehwm7ZHSNiCYdhj0R-m0A}{ccMEAELgTWu9pvE1fTH2Og}{172.18.142.49}{172.18.142.49:9300}{ml.machine_memory=16544047104, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true}], reason [RemoteTransportException[[node-1][172.18.142.49:9300][internal:discovery/zen/join]]; nested: ConnectTransportException[[node-1][172.17.0.1:9300] handshake failed. unexpected remote node {node-1}{Lehwm7ZHSNiCYdhj0R-m0A}{ccMEAELgTWu9pvE1fTH2Og}{172.18.142.49}{172.18.142.49:9300}{ml.machine_memory=16544047104, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true}]; ]
[2025-04-02T20:01:29,513][INFO ][o.e.x.s.a.AuthenticationService] [node-1] Authentication of [elastic] was terminated by realm [reserved] - failed to authenticate user [elastic]
[2025-04-02T20:01:31,345][INFO ][o.e.x.s.a.AuthenticationService] [node-1] Authentication of [elastic] was terminated by realm [reserved] - failed to authenticate user [elastic]
[2025-04-02T20:01:32,071][INFO ][o.e.d.z.ZenDiscovery     ] [node-1] failed to send join request to master [{node-1}{Lehwm7ZHSNiCYdhj0R-m0A}{ccMEAELgTWu9pvE1fTH2Og}{172.18.142.49}{172.18.142.49:9300}{ml.machine_memory=16544047104, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true}], reason [RemoteTransportException[[node-1][172.18.142.49:9300][internal:discovery/zen/join]]; nested: ConnectTransportException[[node-1][172.17.0.1:9300] handshake failed. unexpected remote node {node-1}{Lehwm7ZHSNiCYdhj0R-m0A}{ccMEAELgTWu9pvE1fTH2Og}{172.18.142.49}{172.18.142.49:9300}{ml.machine_memory=16544047104, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true}]; ]
[2025-04-02T20:01:32,295][INFO ][o.e.x.s.a.AuthenticationService] [node-1] Authentication of [elastic] was terminated by realm [reserved] - failed to authenticate user [elastic]
[2025-04-02T20:01:33,077][INFO ][o.e.x.s.a.AuthenticationService] [node-1] Authentication of [elastic] was terminated by realm [reserved] - failed to authenticate user [elastic]
[2025-04-02T20:01:33,928][INFO ][o.e.x.s.a.AuthenticationService] [node-1] Authentication of [elastic] was terminated by realm [reserved] - failed to authenticate user [elastic]
[2025-04-02T20:01:34,038][INFO ][o.e.x.s.a.AuthenticationService] [node-1] Authentication of [elastic] was terminated by realm [reserved] - failed to authenticate user [elastic]
[2025-04-02T20:01:35,176][INFO ][o.e.d.z.ZenDiscovery     ] [node-1] failed to send join request to master [{node-1}{Lehwm7ZHSNiCYdhj0R-m0A}{ccMEAELgTWu9pvE1fTH2Og}{172.18.142.49}{172.18.142.49:9300}{ml.machine_memory=16544047104, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true}], reason [RemoteTransportException[[node-1][172.18.142.49:9300][internal:discovery/zen/join]]; nested: ConnectTransportException[[node-1][172.17.0.1:9300] handshake failed. unexpected remote node {node-1}{Lehwm7ZHSNiCYdhj0R-m0A}{ccMEAELgTWu9pvE1fTH2Og}{172.18.142.49}{172.18.142.49:9300}{ml.machine_memory=16544047104, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true}]; ]
[2025-04-02T20:01:35,377][INFO ][o.e.x.s.a.AuthenticationService] [node-1] Authentication of [elastic] was terminated by realm [reserved] - failed to authenticate user [elastic]
[2025-04-02T20:01:36,514][INFO ][o.e.x.s.a.AuthenticationService] [node-1] Authentication of [elastic] was terminated by realm [reserved] - failed to authenticate user [elastic]
[2025-04-02T20:01:38,276][INFO ][o.e.d.z.ZenDiscovery     ] [node-1] failed to send join request to master [{node-1}{Lehwm7ZHSNiCYdhj0R-m0A}{ccMEAELgTWu9pvE1fTH2Og}{172.18.142.49}{172.18.142.49:9300}{ml.machine_memory=16544047104, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true}], reason [RemoteTransportException[[node-1][172.18.142.49:9300][internal:discovery/zen/join]]; nested: ConnectTransportException[[node-1][172.17.0.1:9300] handshake failed. unexpected remote node {node-1}{Lehwm7ZHSNiCYdhj0R-m0A}{ccMEAELgTWu9pvE1fTH2Og}{172.18.142.49}{172.18.142.49:9300}{ml.machine_memory=16544047104, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true}]; ]

1.先看看配置,除了node-name不一样外,3个节点的配置都是一样的

[root@lv7 elasticsearch-6.8.11]# yy config/elasticsearch.yml
cluster.name: lv-cluster
node.name: node-1
node.master: true
node.data: true
network.host: 0.0.0.0
http.port: 9201
discovery.zen.ping.unicast.hosts: ["lv2", "lv8", "lv9"]
discovery.zen.minimum_master_nodes: 2
http.cors.enabled: true 
http.cors.allow-origin: "*"
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.truststore.path: /data1/lv/elastic-stack/elasticsearch-6.8.11/config/certs/elastic-certificates.p12
xpack.security.transport.ssl.keystore.path: /data1/lv/elastic-stack/elasticsearch-6.8.11/config/certs/elastic-certificates.p12

存在了一个问题:

  1. 节点自环问题
    • 配置中 network.host: 0.0.0.0 可能导致节点误认自身IP
    • 日志显示节点尝试加入自己(172.18.142.49:9300

之前的运维还是比较偷懒的,后面把配置文件调整为。

[root@lv7 config]# yy elasticsearch.yml
cluster.name: lv-cluster
node.name: node-1
node.master: false
node.data: true
network.host: 172.18.142.48
transport.tcp.port: 9300
http.port: 9201
discovery.zen.ping.unicast.hosts: ["172.18.142.49:9300", "172.18.142.50:9300"]
discovery.zen.minimum_master_nodes: 2
http.cors.enabled: true 
http.cors.allow-origin: "*"
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: /data1/lv/elastic-stack/elasticsearch-6.8.11/config/certs/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: /data1/lv/elastic-stack/elasticsearch-6.8.11/config/certs/elastic-certificates.p12
# 明确绑定IP,禁止使用0.0.0.0
network.host: 172.18.142.49  # lv7的真实IP
transport.tcp.port: 9300     # 确保集群通信端口一致

# 使用IP而非主机名(避免DNS问题)
discovery.zen.ping.unicast.hosts: ["172.18.142.50:9300", "172.18.142.51:9300"]  # lv8/lv9的IP

# lv7不作为主节点,应为现在的es master是lv8
node.master: false
node.data: true
discovery.zen.minimum_master_nodes: 2  # 总master节点数/2 + 1

最后加入成功

最后加入成功

在这里插入图片描述

### Elasticsearch 8.13 集群添加第三个节点失败解决方案 当尝试向现有的Elasticsearch集群中添加新的节点时,可能会遇到各种问题。为了成功地将新节点加入到版本为8.13Elasticsearch集群中,需遵循一系列特定的操作流程。 #### 检查网络连接性和发现机制配置 确保所有节点之间的网络通信正常工作,并且能够互相解析主机名。修改`/apps/elasticsearch-8.13.2/config/elasticsearch.yml`文件中的`network.host`参数以便允许外部访问[^1]: ```yaml network.host: 0.0.0.0 ``` 另外,在同一份配置文件内定义种子节点列表用于初始化集群成员间的相互识别: ```yaml discovery.seed_hosts: ["host1", "host2"] cluster.initial_master_nodes: ["node-name"] # 替换成实际master资格节点的名字 ``` #### 设置一致的安全策略 如果启用了安全性功能,则需要保证新增加的节点拥有相同的证书和密钥材料。可以通过命令行工具创建这些必要的安全资源[^3]: ```bash elasticsearch-certutil cert --ca elastic-stack-ca.p12 ``` 这一步骤会生成适用于整个堆栈组件的身份验证资料,包括客户端和服务端SSL/TLS加密所需的公私钥对以及相应的X.509证书。 #### 同步配置变更至全网 完成上述调整之后,记得重启现有服务实例使更改生效;同时也要确认防火墙规则不会阻止各节点间所需端口上的流量交换活动。 对于具体错误信息,请提供更详细的日志片段来帮助定位潜在原因。通常情况下,通过以上措施可以有效提高新节点顺利融入既定集群的成功率。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值