elasticsearch Openstack实例上的Elasticsearch 7无法设置ES群集,elasticsearch,openstack,elasticsearch,Openstack" /> elasticsearch Openstack实例上的Elasticsearch 7无法设置ES群集,elasticsearch,openstack,elasticsearch,Openstack" />

elasticsearch Openstack实例上的Elasticsearch 7无法设置ES群集

elasticsearch Openstack实例上的Elasticsearch 7无法设置ES群集,elasticsearch,openstack,elasticsearch,Openstack,我正在尝试在Openstack上设置Elasticsearch集群。我有两个Openstack实例,每个实例都运行ES,并且这些实例能够相互ping并相互卷曲ES实例。但无论我如何配置Elasticsearch.yml文件,我似乎都无法让它们形成集群 我在这两种情况下都使用Elasticsearch 7.3.2。我在下面的配置中使用非浮动IP 实例1-Elasticsearch.yml cluster.name: my-cluster node.name: node-1 node.master:

我正在尝试在Openstack上设置Elasticsearch集群。我有两个Openstack实例,每个实例都运行ES,并且这些实例能够相互ping并相互卷曲ES实例。但无论我如何配置Elasticsearch.yml文件,我似乎都无法让它们形成集群

我在这两种情况下都使用Elasticsearch 7.3.2。我在下面的配置中使用非浮动IP

实例1-Elasticsearch.yml

cluster.name: my-cluster
node.name: node-1
node.master: true
node.data: true
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: [_local_,_site_]
http.port: 9200
discovery.seed_hosts: ["<INSTANCE1-IP>:9300", "<INSTANCE2-IP>:9300"]
cluster.initial_master_nodes: ["<INSTANCE2-IP>:9300"]
cluster.name: my-cluster
node.name: node-2
node.master: false
node.data: true
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: [_local_,_site_]
http.port: 9200
discovery.seed_hosts: ["<INSTANCE1-IP>:9300", "<INSTANCE2-IP>:9300"]
cluster.initial_master_nodes: ["<INSTANCE2-IP>:9300"]
cluster.name:我的群集
node.name:node-1
node.master:true
node.data:true
path.data:/var/lib/elasticsearch
path.logs:/var/log/elasticsearch
network.host:[\u本地,\u站点]
http.port:9200
discovery.seed_主机:[“:9300”,“:9300”]
cluster.initial_master_节点:[“:9300”]
实例2-Elasticsearch.yml

cluster.name: my-cluster
node.name: node-1
node.master: true
node.data: true
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: [_local_,_site_]
http.port: 9200
discovery.seed_hosts: ["<INSTANCE1-IP>:9300", "<INSTANCE2-IP>:9300"]
cluster.initial_master_nodes: ["<INSTANCE2-IP>:9300"]
cluster.name: my-cluster
node.name: node-2
node.master: false
node.data: true
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: [_local_,_site_]
http.port: 9200
discovery.seed_hosts: ["<INSTANCE1-IP>:9300", "<INSTANCE2-IP>:9300"]
cluster.initial_master_nodes: ["<INSTANCE2-IP>:9300"]
cluster.name:我的群集
node.name:node-2
node.master:false
node.data:true
path.data:/var/lib/elasticsearch
path.logs:/var/log/elasticsearch
network.host:[\u本地,\u站点]
http.port:9200
discovery.seed_主机:[“:9300”,“:9300”]
cluster.initial_master_节点:[“:9300”]
使用这些配置,主节点(Instance1)可以正常加载,但在检查第二个节点(Instance2)的运行状况时,我会得到一个主节点未发现异常(503)。有什么想法吗

检查节点2上的日志将显示以下信息:

[2019-10-01T09:45:53,126][DEBUG][o.e.a.a.c.h.TransportClusterHealthAction] [node-2] timed out while retrying [cluster:monitor/health] after failure (timeout [30s])
[2019-10-01T09:45:53,127][WARN ][r.suppressed             ] [node-2] path: /_cluster/health, params: {pretty=}
org.elasticsearch.discovery.MasterNotDiscoveredException: null
    at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction$3.onTimeout(TransportMasterNodeAction.java:251) [elasticsearch-7.3.2.jar:7.3.2]
    at org.elasticsearch.cluster.ClusterStateObserver$ContextPreservingListener.onTimeout(ClusterStateObserver.java:325) [elasticsearch-7.3.2.jar:7.3.2]
    at org.elasticsearch.cluster.ClusterStateObserver$ObserverClusterStateListener.onTimeout(ClusterStateObserver.java:252) [elasticsearch-7.3.2.jar:7.3.2]
    at org.elasticsearch.cluster.service.ClusterApplierService$NotifyTimeout.run(ClusterApplierService.java:572) [elasticsearch-7.3.2.jar:7.3.2]
    at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:688) [elasticsearch-7.3.2.jar:7.3.2]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
    at java.lang.Thread.run(Thread.java:835) [?:?]
[2019-10-01T09:45:59,754][WARN ][o.e.c.c.ClusterFormationFailureHelper] [node-2] master not discovered yet: have discovered [{node-2}{Sb2fOZEKR42_4sB2XnmShg}{LgJ0DLojSay7KV2_cXgdpw}{<INSTANCE2-IP>}{<INSTANCE2-IP>:9300}{di}{ml.machine_memory=33728778240, xpack.installed=true, ml.max_open_jobs=20}, {node-1}{HqONwd3fQHSWZxxEtctcog}{cu5KW146S8-04oBBCqL3QA}{<INSTANCE1-IP>}{<INSTANCE1-IP>:9300}{dim}{ml.machine_memory=33728778240, ml.max_open_jobs=20, xpack.installed=true}]; discovery will continue using [<INSTANCE2-IP>:9300] from hosts providers and [] from last-known cluster state; node term 0, last-accepted version 0 in term 0
[2019-10-01T09:45:53126][DEBUG][o.e.a.a.c.h.TransportClusterHealthAction][node-2]在失败后重试[cluster:monitor/health]时超时(超时[30s])
[2019-10-01T09:45:53127][WARN][r.supprested][node-2]路径:/_集群/运行状况,参数:{pretty=}
org.elasticsearch.discovery.MasterNotDiscoveredException:null
在org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction$3.onTimeout(TransportMasterNodeAction.java:251)[elasticsearch-7.3.2.jar:7.3.2]
在org.elasticsearch.cluster.ClusterStateObserver$ContextPreservingListener.onTimeout(ClusterStateObserver.java:325)[elasticsearch-7.3.2.jar:7.3.2]
在org.elasticsearch.cluster.ClusterStateObserver$ObserverClusterStateListener.onTimeout(ClusterStateObserver.java:252)[elasticsearch-7.3.2.jar:7.3.2]
在org.elasticsearch.cluster.service.ClusterApplierService$NotifyTimeout.run(ClusterApplierService.java:572)[elasticsearch-7.3.2.jar:7.3.2]
在org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:688)[elasticsearch-7.3.2.jar:7.3.2]
位于java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)[?:?]
位于java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)[?:?]
在java.lang.Thread.run(Thread.java:835)[?:?]
【10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-10-19:45:45:45:45:45:45:45:45:45:45:45:45:45:45:45:45:45:59755-5-5-5-5-5-5-5-5-5-{{:9300}{dim}{ml.machine_memory=33728778240,ml.max_open_jobs=20,xpack.installed=true}];发现将继续使用来自主机提供程序的[:9300]和来自上次已知群集状态的[];节点术语0,术语0中上次接受的版本0

多亏了这一点,我成功地解决了这个问题。这是更改一些配置和通过删除节点数据执行完全ES重启的混合

我采取了以下步骤:

1) 访问日志以识别错误:

sudo-i
cd/var/log/elasticsearch
cat my-cluster.log
3) 删除现有节点数据并在两个节点上重新启动Elasticsearch

sudo rm -rf /var/lib/elasticsearch
sudo service elasticsearch restart

node2上的日志说明了什么?将node-2日志添加到主日志中