Hazelcast supports EC2 Auto Discovery. It is useful when you do not want to provide or you cannot provide the list of possible IP addresses.
To configure your cluster to use EC2 Auto Discovery, set the following configuration elements. Please refer to the aws element section for the full description of the EC2 Auto Discovery configuration elements.
enabled
attribute of the multicast
element to "false", and set the enabled
attribute of the tcp-ip
element to "false".enabled
attribute of the aws
element to "true".aws
element, provide your credentials (access and secret key), your region, etc.The following is an example declarative configuration.
<hazelcast>
...
<properties>
<property name="hazelcast.discovery.enabled">true</property>
</properties>
...
<network>
...
<join>
<multicast enabled="false"></multicast>
<tcp-ip enabled="false"></tcp-ip>
<aws enabled="true">
<access-key>my-access-key</access-key>
<secret-key>my-secret-key</secret-key>
<region>us-west-1</region>
<host-header>ec2.amazonaws.com</host-header>
<security-group-name>hazelcast-sg</security-group-name>
<tag-key>type</tag-key>
<tag-value>hz-nodes</tag-value>
</aws>
</join>
When needed, Hazelcast can log the events for the instances that exist in a region. To see what has happened or to trace the activities while forming the cluster, change the log level in your logging mechanism to FINEST
or DEBUG
. After this change, you can also see in the generated log whether the instances are accepted or rejected, and the reason the instances were rejected. Note that changing the log level in this way may affect the performance of the cluster. Please see the Logging Configuration section for information on logging mechanisms.
RELATED INFORMATION
You can download the white paper "Hazelcast on AWS: Best Practices for Deployment" from Hazelcast.com.