ES 配置集群 ,配置单节点可以访问,配置三个节点后就报master找不到

Elasticsearch | 作者 LearnDH | 发布于2019年01月25日 | 阅读数:436

还请各位大牛解答,谢谢,三台机器都能使用ping + ip 都能ping到,使用http访问
  http://192.168.75.188:9200/_cat/nodes?v
结果:
{"error":{"root_cause":[{"type":"master_not_discovered_exception","reason":null}],"type":"master_not_discovered_exception","reason":null},"status":503}
 
三个集群的配置:cluster.name: my-es

node.name: node-1
node.master: true
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

network.host: 192.168.75.189

http.port: 9200

discovery.zen.ping.unicast.hosts: ["192.168.75.189","192.168.75.188","192.168.75.186"]

discovery.zen.minimum_master_nodes: 2

http.cors.enabled: true
http.cors.allow-origin: "*"

-------------------------------------------------------------------------------------------------
cluster.name: my-es

node.name: node-2
node.master: true
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

network.host: 192.168.75.188

http.port: 9200

discovery.zen.ping.unicast.hosts: ["192.168.75.189","192.168.75.188","192.168.75.186"]

discovery.zen.minimum_master_nodes: 2

http.cors.enabled: true
http.cors.allow-origin: "*"
---------------------------------------------------
cluster.name: my-es

node.name: node-3
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

network.host: 192.168.75.186

http.port: 9200

discovery.zen.ping.unicast.hosts: ["192.168.75.189","192.168.75.188","192.168.75.186"]

discovery.zen.minimum_master_nodes: 2

http.cors.enabled: true
http.cors.allow-origin: "*"
 
这是三台机器的http访问信息

{ "name" : "node-1", "cluster_name" : "my-es", "cluster_uuid" : "_na_", "version" : { "number" : "6.5.4", "build_flavor" : "default", "build_type" : "rpm", "build_hash" : "d2ef93d", "build_date" : "2018-12-17T21:17:40.758843Z", "build_snapshot" : false, "lucene_version" : "7.5.0", "minimum_wire_compatibility_version" : "5.6.0", "minimum_index_compatibility_version" : "5.0.0" }, "tagline" : "You Know, for Search" }
 

{ "name" : "node-2", "cluster_name" : "my-es", "cluster_uuid" : "_na_", "version" : { "number" : "6.5.4", "build_flavor" : "default", "build_type" : "rpm", "build_hash" : "d2ef93d", "build_date" : "2018-12-17T21:17:40.758843Z", "build_snapshot" : false, "lucene_version" : "7.5.0", "minimum_wire_compatibility_version" : "5.6.0", "minimum_index_compatibility_version" : "5.0.0" }, "tagline" : "You Know, for Search" }
 

{ "name" : "node-3", "cluster_name" : "my-es", "cluster_uuid" : "_na_", "version" : { "number" : "6.5.4", "build_flavor" : "default", "build_type" : "rpm", "build_hash" : "d2ef93d", "build_date" : "2018-12-17T21:17:40.758843Z", "build_snapshot" : false, "lucene_version" : "7.5.0", "minimum_wire_compatibility_version" : "5.6.0", "minimum_index_compatibility_version" : "5.0.0" }, "tagline" : "You Know, for Search" }
 
 
 
 
/var/log/elasticsearch/my-es.log  下的异常错误 

[2019-01-25T12:07:58,749][WARN ][r.suppressed             ] [node-1] path: /_xpack/monitoring/_bulk, params: {system_id=kibana, system_api_version=6, interval=10000ms}
org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];[SERVICE_UNAVAILABLE/2/no master];
        at org.elasticsearch.cluster.block.ClusterBlocks.globalBlockedException(ClusterBlocks.java:166) ~[elasticsearch-6.5.4.jar:6.5.4]
        at org.elasticsearch.cluster.block.ClusterBlocks.globalBlockedRaiseException(ClusterBlocks.java:152) ~[elasticsearch-6.5.4.jar:6.5.4]
        at org.elasticsearch.xpack.monitoring.action.TransportMonitoringBulkAction.doExecute(TransportMonitoringBulkAction.java:56) ~[?:?]
        at org.elasticsearch.xpack.monitoring.action.TransportMonitoringBulkAction.doExecute(TransportMonitoringBulkAction.java:36) ~[?:?]
        at org.elasticsearch.action.support.TransportAction.doExecute(TransportAction.java:143) ~[elasticsearch-6.5.4.jar:6.5.4]
        at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:167) ~[elasticsearch-6.5.4.jar:6.5.4]
        at org.elasticsearch.xpack.security.action.filter.SecurityActionFilter.apply(SecurityActionFilter.java:126) ~[?:?]
        at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:165) ~[elasticsearch-6.5.4.jar:6.5.4]
        at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:139) ~[elasticsearch-6.5.4.jar:6.5.4]
        at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:81) ~[elasticsearch-6.5.4.jar:6.5.4]
        at org.elasticsearch.client.node.NodeClient.executeLocally(NodeClient.java:87) ~[elasticsearch-6.5.4.jar:6.5.4]
        at org.elasticsearch.client.node.NodeClient.doExecute(NodeClient.java:76) ~[elasticsearch-6.5.4.jar:6.5.4]
        at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:395) ~[elasticsearch-6.5.4.jar:6.5.4]
        at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:71) ~[elasticsearch-6.5.4.jar:6.5.4]
        at org.elasticsearch.xpack.monitoring.rest.action.RestMonitoringBulkAction.lambda$doPrepareRequest$0(RestMonitoringBulkAction.java:103) ~[?:?]
        at org.elasticsearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:97) [elasticsearch-6.5.4.jar:6.5.4]
        at org.elasticsearch.xpack.security.rest.SecurityRestFilter.handleRequest(SecurityRestFilter.java:72) [x-pack-security-6.5.4.jar:6.5.4]
        at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:239) [elasticsearch-6.5.4.jar:6.5.4]
        at org.elasticsearch.rest.RestController.tryAllHandlers(RestController.java:335) [elasticsearch-6.5.4.jar:6.5.4]
        at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:173) [elasticsearch-6.5.4.jar:6.5.4]
 
 
 
已邀请:

weizijun - 专注elasticsearch三十年

赞同来自:

network.host: 0.0.0.0
三个节点都这样配置看能否正常启动

God_lockin

赞同来自:

用telnet ip port试试?有可能集群之间的端口没开

zqc0512 - andy zhou

赞同来自:

这玩意感觉你3台机器都单独的啊,都没有成集群呢。
 

zqc0512 - andy zhou

赞同来自:

看日志里面有选举Master日志的么?
 

zqc0512 - andy zhou

赞同来自:

你看这3台机器之间 9200 9300 端口通不通,一般都是网拦截了。
 

fanmo3yuan

赞同来自:

改成这个试试  network.host:_site_

LearnDH

赞同来自:

感谢大家,之前的问题自己已经解决,因为这个虚拟机是克隆过来的,所以需要将另外两个节点中的data目录下的所有文件删除即可。
https://blog.csdn.net/gamer_gy ... 77189  附带这个链接,有详细解读一些坑

要回复问题请先登录注册