使用AWS进行Elasticsearch自动发现

时间:2015-07-13 15:44:16

标签: elasticsearch amazon-ec2

您好,在亚马逊的Windows 2008上运行Elasticsearch 1.6.0和AWS插件2.6.0。

我有AWS plgin设置,我在日志中没有得到任何异常,但节点似乎无法互相切换。

bootstrap.mlockall: true
cluster.name: my-cluster
node.name: "ES MASTER 01"
node.data: false
node.master: true

plugin.mandatory: "cloud-aws"


cloud.aws.access_key: "AK...Z7Q"
cloud.aws.secret_key: "gKW...nAO"
cloud.aws.region: "us-east"

discovery.zen.minimum_master_nodes: 1
discovery.type: "ec2"
discovery.ec2.groups: "Elastic Search"
discovery.ec2.ping_timeout: "30s"
discovery.ec2.availability_zones: "us-east-1a"

discovery.zen.ping.multicast.enabled: false

日志:

[2015-07-13 15:02:19,346][INFO ][node                     ] [ES MASTER 01] version[1.6.0], pid[2532], build[cdd3ac4/2015-06-09T13:36:34Z]
[2015-07-13 15:02:19,346][INFO ][node                     ] [ES MASTER 01] initializing ...
[2015-07-13 15:02:19,378][INFO ][plugins                  ] [ES MASTER 01] loaded [cloud-aws], sites []
[2015-07-13 15:02:19,440][INFO ][env                      ] [ES MASTER 01] using [1] data paths, mounts [[(C:)]], net usable_space [6.8gb], net total_space [29.9gb], types [NTFS]
[2015-07-13 15:02:26,461][INFO ][node                     ] [ES MASTER 01] initialized
[2015-07-13 15:02:26,461][INFO ][node                     ] [ES MASTER 01] starting ...
[2015-07-13 15:02:26,851][INFO ][transport                ] [ES MASTER 01] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/172.30.0.123:9300]}
[2015-07-13 15:02:26,866][INFO ][discovery                ] [ES MASTER 01] my-cluster/SwhSDhiDQzq4pM8jkhIuzw
[2015-07-13 15:02:56,884][WARN ][discovery                ] [ES MASTER 01] waited for 30s and no initial state was set by the discovery
[2015-07-13 15:02:56,962][INFO ][http                     ] [ES MASTER 01] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/172.30.0.123:9200]}
[2015-07-13 15:02:56,962][INFO ][node                     ] [ES MASTER 01] started
[2015-07-13 15:03:13,455][INFO ][cluster.service          ] [ES MASTER 01] new_master [ES MASTER 01][SwhSDhiDQzq4pM8jkhIuzw][WIN-3Q4EH3B8H1O][inet[/172.30.0.123:9300]]{data=false, master=true}, reason: zen-disco-join (elected_as_master)
[2015-07-13 15:03:13,517][INFO ][gateway                  ] [ES MASTER 01] recovered [0] indices into cluster_state

1 个答案:

答案 0 :(得分:0)

当且仅当您的节点实例能够访问同一VPC上的ec2信息才能找到它应该加入的群集时,它肯定可以使用私有IP。

您可以将此发现权限设置为以下策略,并将其应用于您的IAM角色:

{ "Version": "2012-10-17", "Statement": [ { "Sid": "whatever", "Effect": "Allow", "Action": [ "s3:GetObject", "ec2:DescribeAvailabilityZones", "ec2:DescribeInstances", "ec2:DescribeRegions", "ec2:DescribeSecurityGroups", "ec2:DescribeTags" ], "Resource": [ "*" ] } ] }