3

我目前正在将集群升级到 6.1,并且无法让节点在启动时相互发现。三个单独的节点启动但随后陷入循环:

[2018-01-08T11:33:01,421][WARN ][o.e.d.z.ZenDiscovery     ] [ip-10-xxx-xxx-xxx] not enough master nodes discovered during pinging (found [[Candidate{node={ip-10-xxx-xxx-xxx}{gMlxxxxxRW-74axxxQ8V-3x}{6gBBYZxxxxxxxon=-1}]], but needed [2]), pinging again

我的配置的相关部分是:

# Use the AWS private IP as self identifier
http.host: _ec2:privateIp_
network.host: _ec2:privateIp_
http.bind_host: 0.0.0.0
network.bind_host: 0.0.0.0

discovery.zen.hosts_provider: ec2
# These are expanded in my CloudFormation template
discovery.ec2.tag.Stack: @@STACK
discovery.ec2.tag.App: @@APP
discovery.ec2.tag.Stage: @@STAGE

打开调试以进行发现(使用logger.org.elasticsearch.discovery.ec2: "TRACE")为我提供了一些发现过程失败的证据:

[2018-01-08T11:32:58,419][TRACE][o.e.d.e.AwsEc2UnicastHostsProvider] [ip-10-xxx-xxx-xxx] building dynamic unicast discovery nodes...
[2018-01-08T11:32:58,420][DEBUG][o.e.d.e.AwsEc2UnicastHostsProvider] [ip-10-xxx-xxx-xxx] using dynamic discovery nodes []
4

1 回答 1

5

经过进一步调试,我发现文档不正确。

端点设置的文档说:“要连接的 ec2 服务端点。这将由 ec2 客户端根据实例位置自动计算出来,但可以明确指定。”

不幸的是,这不是真的,在https://github.com/elastic/elasticsearch/issues/27464有一个未解决的问题。

logger.com.amazonaws.request: "DEBUG"在进一步排除故障时,我在我的 elasticsearch 配置中打开了 AWS 日志记录。这在日志文件中提供了一个条目,说明它正在联系 us-east-1,尽管实例位于 eu-west-1 中:

[2018-01-08T12:26:40,029][DEBUG][c.a.request              ] Sending Request: POST https://ec2.us-east-1.amazonaws.com / Parameters: ({"Action":["DescribeInstances"],"Version":["2016-11-15"] ...<snip>

看起来他们已经意识到并且可能会修复它以使插件的行为与文档匹配(请参阅https://github.com/elastic/elasticsearch/issues/27924),但同时修复是明确设置端点使用类似的东西:

discovery.ec2.endpoint: ec2.eu-west-1.amazonaws.com
于 2018-01-08T12:49:12.787 回答