我想在我的Cluster上配置1个Master和1个数据节点。我对配置文件进行了以下更改:
Master Config:
index.number_of_shards: 5
index.number_of_replicas: 1
node.master: true
node.data: false
cluster:
name: ES-Testing
node:
name: master # in our case this is set to the host IP with Chef
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["170.30.10.16"]
#threadpool.bulk.queue_size: 1000
script.disable_dynamic: false
#indices.store.throttle.type: none
#index.merge.policy.reclaim_deletes_weight: 3.0
#index.merge.policy.max_merge_at_once: 5
#index.merge.policy.segments_per_tier: 5
cluster.routing.operation.hash.type: org.elasticsearch.plugin.direct.DirectRoutingHash
indices.fielddata.cache.size: 40%
#discovery.zen.minimum_master_nodes: 1
Node conf:
index.number_of_shards: 5
index.number_of_replicas: 1
node.master: false
node.data: true
cluster:
name: ES-Testing
node:
name: node # in our case this is set to the host IP with Chef
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["170.30.10.16"]
#threadpool.bulk.queue_size: 1000
script.disable_dynamic: false
#indices.store.throttle.type: none
#index.merge.policy.reclaim_deletes_weight: 3.0
#index.merge.policy.max_merge_at_once: 5
#index.merge.policy.segments_per_tier: 5
cluster.routing.operation.hash.type: org.elasticsearch.plugin.direct.DirectRoutingHash
indices.fielddata.cache.size: 40%
#discovery.zen.minimum_master_nodes: 1
当我在主设备和节点上重启es时运行命令
Curl '<my_ip>:9200'
如果是master,它会显示预期的结果状态:200但是在节点的情况下 in给我状态:503错误。
这是我的节点日志文件:
[2016-03-16 09:46:50,934][INFO ][node ] [node] stopping ...
[2016-03-16 09:47:12,723][INFO ][node ] [node] version[1.7.1], pid[9504], build[b88f43f/2015-07-29T09:54:16Z]
[2016-03-16 09:47:12,724][INFO ][node ] [node] initializing ...
[2016-03-16 09:47:12,838][INFO ][plugins ] [node] loaded [elasticsearch-direct-routing-plugin], sites [HQ]
[2016-03-16 09:47:12,877][INFO ][env ] [node] using [1] data paths, mounts [[/ (/dev/xvda1)]], net usable_space [43.3gb], net total_space [49.2gb], types [ext3]
[2016-03-16 09:47:15,940][INFO ][node ] [node] initialized
[2016-03-16 09:47:15,940][INFO ][node ] [node] starting ...
[2016-03-16 09:47:16,040][INFO ][transport ] [node] bound_address {inet[/0.0.0.0:9300]}, publish_address {inet[/172.31.12.17:9300]}
[2016-03-16 09:47:16,049][INFO ][discovery ] [node] ES-Testing/ryRsicZLRR2qupBAoUY2rQ
[2016-03-16 09:47:46,049][WARN ][discovery ] [node] waited for 30s and no initial state was set by the discovery
[2016-03-16 09:47:46,054][INFO ][http ] [node] bound_address {inet[/0.0.0.0:9200]}, publish_address {inet[/172.31.12.17:9200]}
[2016-03-16 09:47:46,054][INFO ][node ] [node] started
如果我做错了,请告诉我。谢谢你的回复。
答案 0 :(得分:2)
在主节点配置中,您需要设置此
discovery.zen.ping.unicast.hosts: ["170.30.10.17"]
否则您的主人将永远无法发现数据节点。
最好是始终列出所有节点,以便更轻松地部署配置。
discovery.zen.ping.unicast.hosts: ["170.30.10.16", "170.30.10.17"]
此外,您可能需要在每个配置文件中设置network.host: <ip_of_host>
,以确保每个节点绑定到另一个节点可以看到的IP地址。
<强>更新强>
问题中缺少的一个信息是这两个主机在EC2上,因此:
cloud.aws.xyz
(即region
,access_key
,secret_key
)discovery.type: ec2
network.host
可以设置为_ec2_
discovery.zen.ping.unicast.hosts
可以被注释掉,因为它不需要答案 1 :(得分:0)
现在我遇到了这些错误。
[cluster.service] [master] detected_master [172.31.12.16] [Rbi6kBUcT4C8fXuuqsKKzQ] [ip-172-31-12-16.ec2.internal] [inet [/172.31.12.16:9300]] {data = false ,master = true},添加{[172.31.12.16] [Rbi6kBUcT4C8fXuuqsKKzQ] [ip-172-31-12-16.ec2.internal] [inet [/172.31.12.16:9300]] {data = false,master = true },},reason:zen-disco-receive(来自master [[172.31.12.16] [Rbi6kBUcT4C8fXuuqsKKzQ] [ip-172-31-12-16.ec2.internal] [inet [/172.31.12.16:9300]] { data = false,master = true}]) [2016-03-17 07:22:10,051] [INFO] [http] [master] bound_address {inet [/172.31.12.16:9201]},publish_address {inet [/172.31.12.16:9201]} [2016-03-17 07:22:10,052] [INFO] [node] [master]开始