Elasticsearch discovery with the Cloud-AWS plugin

The Amazon Web Service (AWS) Cloud plugin uses the AWS API for unicast discovery.

Install the plugin on all of your nodes:

sudo bin/plugin install cloud-aws

Edit elasticsearch.yml

# ---------------------------------- Cluster -----------------------------------
#
cluster.name: default
#
# ------------------------------------ Node ------------------------------------
#
node.name: es-server
node.max_local_storage_nodes: 1
#
# ----------------------------------- Paths ------------------------------------
#
path.conf: /etc/elasticsearch
path.data: /mnt/elasticsearch/disk0
path.logs: /var/log/elasticsearch
#
# ----------------------------------- Memory -----------------------------------
#
bootstrap.mlockall: true
#
# ---------------------------------- Network -----------------------------------
#
network.host: _ec2:privateIpv4_
http.port: 9200
#
# ---------------------------------- Gateway -----------------------------------
#
#
# --------------------------------- Discovery ----------------------------------
#
discovery.zen.ping.multicast.enabled: false
discovery.zen.minimum_master_nodes: 2
#
# ---------------------------------- Various -----------------------------------
#
action.destructive_requires_name: true
cloud.node.auto_attributes: true
#
# -------------------------- Custom Configuration --------------------------
#
cloud.aws.region: us-east-1
cloud.aws.access_key: <AWS_ACCESS_KEY>
cloud.aws.secret_key: <AWS_SECRET_KEY>
cluster.routing.allocation.awareness.attributes: aws_availability_zone
cluster.routing.allocation.awareness.force.zone.values: ["us-east-1a", "us-east-1c", "us-east-1d", "us-east-1e"]
discovery.ec2.availability_zones: ["us-east-1a", "us-east-1c", "us-east-1d", "us-east-1e"]
discovery.ec2.groups: ["sg-12345"]
discovery.ec2.host_type: private_ip
discovery.ec2.ping_timeout: 3s
 
# https://www.elastic.co/guide/en/elasticsearch/plugins/current/cloud-aws-discovery.html#cloud-aws-discovery-filtering
discovery.ec2.tag.es_cluster: <custom_tag_example>

discovery.type: ec2
plugin.madatory: cloud-aws

Leave a Reply

Your email address will not be published. Required fields are marked *