# Cluster set up on ec2

**URL:** <https://discuss.elastic.co/t/cluster-set-up-on-ec2/8868>\
**Category:** Elasticsearch\
**Created:** [August 28, 2012, 3:44am UTC](https://discuss.elastic.co/t/cluster-set-up-on-ec2/8868 "2012-08-28T03:44:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Y\_Lin](https://avatars.discourse-cdn.com/v4/letter/y/f1d935/32.png) [@Y\_Lin](https://discuss.elastic.co/u/Y_Lin)\
**Post date:** [August 28, 2012, 3:44am UTC](https://discuss.elastic.co/t/cluster-set-up-on-ec2/8868/1 "2012-08-28T03:44:00Z")

</div>

About 98 machines returned in discovery nodes list. Most of them don't have  
ES installed.

I tried to use groups to filter, but it doesn't work.

Here is my setting:  
discovery:  
type: ec2  
ec2:  
ping\_timeout: 5s  
groups: sgn2-stg-sss  
any\_group: false

I'm sure only 3 machines within the group. What should I do to filter out?

Thanks a lot

--

---

<div class="post-metadata">

**Author:** ![andreas\_chatzakis](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@andreas\_chatzakis](https://discuss.elastic.co/u/andreas_chatzakis)\
**Post date:** [August 28, 2012, 8:25am UTC](https://discuss.elastic.co/t/cluster-set-up-on-ec2/8868/2 "2012-08-28T08:25:29Z")

</div>

It might be an issue with your config file syntax (Indentation is important  
in yml syntax)  
I would add a space before the groups field:

discovery:  
type: ec2  
ec2:  
groups: sgn2-stg-sss

or make it explicit with:

discovery.ec2.groups: sgn2-stg-sss

If that fails can you share part of your logs?  
/usr/local/elasticsearch/logs/elasticsearch.log

Andreas

On Tuesday, August 28, 2012 6:44:00 AM UTC+3, Y Lin wrote:

> About 98 machines returned in discovery nodes list. Most of them don't  
> have ES installed.
> 
> I tried to use groups to filter, but it doesn't work.
> 
> Here is my setting:  
> discovery:  
> type: ec2  
> ec2:  
> ping\_timeout: 5s  
> groups: sgn2-stg-sss  
> any\_group: false
> 
> I'm sure only 3 machines within the group. What should I do to filter out?
> 
> Thanks a lot

--

---

<div class="post-metadata">

**Author:** ![max](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/max/32/2236_2.png) [@max](https://discuss.elastic.co/u/max)\
**Post date:** [August 31, 2012, 7:05am UTC](https://discuss.elastic.co/t/cluster-set-up-on-ec2/8868/3 "2012-08-31T07:05:30Z")

</div>

Hi,

we had at the beginning quite some troubles getting this right, maybe this  
helps you:  
we are using this settings for our ec2 cluster:

_discovery.type: ec2_

don't know if important for you, but when you are not in one of the us  
standard regions you should use something like this:  
_cloud.aws.region: eu-west-1_

I still don't know if it uses the name of the group or the group id, so we  
put in both and this works, just make sure that all of the machines in your  
cluster are in this group and that the AWS-account that you are using has  
the right to query the groups & machines 🙂  
_discovery.ecs.groups: sg-XXXXXX,_  
\*  
\*  
In your example the securitygroup has two "-" in it, are you sure this is  
the right one?

\*discovery.ec2.any\_group: false  
\*

and one of the most important settings was:  
_discovery.zen.ping.timeout: 5m_  
5 minutes is quite long, i know, but just to be save... we had big problems  
if shorter than 30 seconds, so we went the secure path 🙂

hope some of this may helps helped you, the logfile just gives you also  
good information where the problem could be.  
Max

Am Dienstag, 28. August 2012 10:25:29 UTC+2 schrieb andreas.chatzakis:

> It might be an issue with your config file syntax (Indentation is  
> important in yml syntax)  
> I would add a space before the groups field:
> 
> discovery:  
> type: ec2  
> ec2:  
> groups: sgn2-stg-sss
> 
> or make it explicit with:
> 
> discovery.ec2.groups: sgn2-stg-sss
> 
> If that fails can you share part of your logs?  
> /usr/local/elasticsearch/logs/elasticsearch.log
> 
> Andreas
> 
> On Tuesday, August 28, 2012 6:44:00 AM UTC+3, Y Lin wrote:
> 
> > About 98 machines returned in discovery nodes list. Most of them don't  
> > have ES installed.
> > 
> > I tried to use groups to filter, but it doesn't work.
> > 
> > Here is my setting:  
> > discovery:  
> > type: ec2  
> > ec2:  
> > ping\_timeout: 5s  
> > groups: sgn2-stg-sss  
> > any\_group: false
> > 
> > I'm sure only 3 machines within the group. What should I do to filter out?
> > 
> > Thanks a lot

--

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:14am UTC](https://discuss.elastic.co/t/cluster-set-up-on-ec2/8868/4 "2017-07-06T03:14:27Z")

</div>


