# Getting an ElasticSearch Cluster to Green (Cluster Setup on OS X)

**URL:** <https://discuss.elastic.co/t/getting-an-elasticsearch-cluster-to-green-cluster-setup-on-os-x/8735>\
**Category:** Elasticsearch\
**Created:** [August 14, 2012, 2:23am UTC](https://discuss.elastic.co/t/getting-an-elasticsearch-cluster-to-green-cluster-setup-on-os-x/8735 "2012-08-14T02:23:06Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_James](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_james/32/2768_2.png) [@David\_James](https://discuss.elastic.co/u/David_James)\
**Post date:** [August 14, 2012, 2:23am UTC](https://discuss.elastic.co/t/getting-an-elasticsearch-cluster-to-green-cluster-setup-on-os-x/8735/1 "2012-08-14T02:23:06Z")

</div>

I would appreciate some help here or over on StackOverflow... Thanks! -David

Getting an ElasticSearch Cluster to Green (Cluster Setup on OS X)

> <https://stackoverflow.com/questions/11944915/getting-an-elasticsearch-cluster-to-green-cluster-setup-on-os-x>

I have installed ElasticSearch on Mac OS X using Homebrew[https://github.com/mxcl/homebrew/blob/master/Library/Formula/elasticsearch.rb](https://github.com/mxcl/homebrew/blob/master/Library/Formula/elasticsearch.rb).  
It works. The cluster started off with "green" health[http://www.elasticsearch.org/guide/reference/api/admin-cluster-health.html](http://www.elasticsearch.org/guide/reference/api/admin-cluster-health.html).  
However, right after adding data, it has gone to "yellow".

The cluster health is status is: green, yellow or red. On the shard level,  
a red status indicates that the specific shard is not allocated in the  
cluster, yellow means that the primary shard is allocated but replicas are  
not, and green means that all shards are allocated. The index level status  
is controlled by the worst shard status. The cluster status is controlled  
by the worst index status.

So, my replica shards are not allocated. How do I allocate them? (I'm  
thinking out loud.)

According to Shay on "I keep getting cluster health status of Yellow"[http://elasticsearch-users.115913.n3.nabble.com/I-keep-getting-cluster-health-status-of-Yellow-td929520.html](http://elasticsearch-users.115913.n3.nabble.com/I-keep-getting-cluster-health-status-of-Yellow-td929520.html):  
"the shard allocation mechanism does not allocate a shard and its replica  
on the same node, though it does allocate different shards on the same  
node. So, you will need two nodes to get cluster state of green."

So, I need to start up a second node. I did this by:

cd ~/Library/LaunchAgents/  
cp homebrew.mxcl.elasticsearch.plist homebrew.mxcl.elasticsearch-2.plist  
launchctl load -wF ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch-2.plist

Now I have "Korvus" on [http://localhost:9200/](http://localhost:9200/) and "Iron Monger" on  
[http://localhost:9201/](http://localhost:9201/). Woot. But, I don't see any indications that they  
know about each other. How do I connect / introduce them to each other?

Note: I read Zen Discovery[http://www.elasticsearch.org/guide/reference/modules/discovery/zen.html](http://www.elasticsearch.org/guide/reference/modules/discovery/zen.html),  
but do not feel enlightened yet.

--

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 14, 2012, 2:46am UTC](https://discuss.elastic.co/t/getting-an-elasticsearch-cluster-to-green-cluster-setup-on-os-x/8735/2 "2012-08-14T02:46:07Z")

</div>

If I correctly understood your concern, you started one node, then create an index with default settings and you see a yellow cluster.

If you are just testing ES on your laptop, I suggest to work with yellow cluster or to modify your index settings to have replica=0 (your cluster will be Green).

When you start a second node with default settings, all nodes automagicaly discover each others.  
But, you wrote that you copied first es dir to second es dir. Ok. But, you should remove data dir before starting the second node. I don't know if there's any side effect if you also copy data dir...

HTH  
David

--

Le 14 août 2012 à 04:23, David James [davidcjames@gmail.com](mailto:davidcjames@gmail.com) a écrit :

> I would appreciate some help here or over on StackOverflow... Thanks! -David
> 
> Getting an Elasticsearch Cluster to Green (Cluster Setup on OS X)  
> [macos - Getting an ElasticSearch Cluster to Green (Cluster Setup on OS X) - Stack Overflow](http://stackoverflow.com/questions/11944915/getting-an-elasticsearch-cluster-to-green)
> 
> I have installed Elasticsearch on Mac OS X using Homebrew. It works. The cluster started off with "green" health. However, right after adding data, it has gone to "yellow".
> 
> The cluster health is status is: green, yellow or red. On the shard level, a red status indicates that the specific shard is not allocated in the cluster, yellow means that the primary shard is allocated but replicas are not, and green means that all shards are allocated. The index level status is controlled by the worst shard status. The cluster status is controlled by the worst index status.
> 
> So, my replica shards are not allocated. How do I allocate them? (I'm thinking out loud.)
> 
> According to Shay on "I keep getting cluster health status of Yellow": "the shard allocation mechanism does not allocate a shard and its replica on the same node, though it does allocate different shards on the same node. So, you will need two nodes to get cluster state of green."
> 
> So, I need to start up a second node. I did this by:
> 
> cd ~/Library/LaunchAgents/  
> cp homebrew.mxcl.elasticsearch.plist homebrew.mxcl.elasticsearch-2.plist  
> launchctl load -wF ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch-2.plist  
> Now I have "Korvus" on [http://localhost:9200/](http://localhost:9200/) and "Iron Monger" onhttp://localhost:9201/. Woot. But, I don't see any indications that they know about each other. How do I connect / introduce them to each other?
> 
> Note: I read Zen Discovery, but do not feel enlightened yet.
> 
> --

--

---

<div class="post-metadata">

**Author:** ![David\_James](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_james/32/2768_2.png) [@David\_James](https://discuss.elastic.co/u/David_James)\
**Post date:** [August 14, 2012, 5:01am UTC](https://discuss.elastic.co/t/getting-an-elasticsearch-cluster-to-green-cluster-setup-on-os-x/8735/3 "2012-08-14T05:01:36Z")

</div>

Solved. Do not use `network.host: 127.0.0.1` Leave that line commented out  
to let it be automatically derived. The default `elasticsearch.yml` was  
correct. A configuration tweak by the Homebrew installer had incorrectly  
(IMO) specified the `127.0.0.1` loopback interface.

--

---

<div class="post-metadata">

**Author:** ![karmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karmi/32/44951_2.png) [@karmi](https://discuss.elastic.co/u/karmi)\
**Post date:** [August 14, 2012, 5:54am UTC](https://discuss.elastic.co/t/getting-an-elasticsearch-cluster-to-green-cluster-setup-on-os-x/8735/4 "2012-08-14T05:54:54Z")

</div>

Hi, if the only thing you would be after is a green cluster, then indeed  
setting `number_of_replicas : 1` is the correct way on a local system;  
see [https://github.com/elasticsearch/elasticsearch/blob/master/config/elasticsearch.yml#L111-115](https://github.com/elasticsearch/elasticsearch/blob/master/config/elasticsearch.yml#L111-115).

The Homebrew installer tweaks the `network.host` setting since  
elasticsearch would "freeze" when changing networks, getting new IP from  
router, etc etc on a laptop. Sounds like it should be improved, though --  
thanks for filing the issue with Homebrew.

Karel

P.S.  
A personal note: it's not very cool to crosspost the same question on the  
mailing list and StackOverflow...

On Tuesday, August 14, 2012 7:01:36 AM UTC+2, David James wrote:

> Solved. Do not use `network.host: 127.0.0.1` Leave that line commented out  
> to let it be automatically derived. The default `elasticsearch.yml` was  
> correct. A configuration tweak by the Homebrew installer had incorrectly  
> (IMO) specified the `127.0.0.1` loopback interface.

--

---

<div class="post-metadata">

**Author:** ![David\_James](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_james/32/2768_2.png) [@David\_James](https://discuss.elastic.co/u/David_James)\
**Post date:** [August 14, 2012, 4:14pm UTC](https://discuss.elastic.co/t/getting-an-elasticsearch-cluster-to-green-cluster-setup-on-os-x/8735/5 "2012-08-14T16:14:23Z")

</div>

Says who? I disagree. I didn't hide the cross-post. It isn't cool not  
finding the answers you need in _either place_. (BTW, SO was more helpful  
in this case.) I'm helping everyone out by sharing.

A personal note: it's not very cool to crosspost the same question on the

> mailing list and StackOverflow...

--

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 14, 2012, 5:52pm UTC](https://discuss.elastic.co/t/getting-an-elasticsearch-cluster-to-green-cluster-setup-on-os-x/8735/6 "2012-08-14T17:52:15Z")

</div>

My opinion on this is I don't like to use SO to get help as it's not described in the official help page: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help/)

My 2 cents.  
David 😉  
Twitter : @dadoonet / @elasticsearchfr

Le 14 août 2012 à 18:14, David James [davidcjames@gmail.com](mailto:davidcjames@gmail.com) a écrit :

> Says who? I disagree. I didn't hide the cross-post. It isn't cool not finding the answers you need in _either place_. (BTW, SO was more helpful in this case.) I'm helping everyone out by sharing.
> 
> ## A personal note: it's not very cool to crosspost the same question on the mailing list and StackOverflow...

--

---

<div class="post-metadata">

**Author:** ![David\_James](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_james/32/2768_2.png) [@David\_James](https://discuss.elastic.co/u/David_James)\
**Post date:** [August 14, 2012, 6:15pm UTC](https://discuss.elastic.co/t/getting-an-elasticsearch-cluster-to-green-cluster-setup-on-os-x/8735/7 "2012-08-14T18:15:57Z")

</div>

Wow. 🙂 You better not ask a friend or colleague either, because they are  
not listed on that page. 😛

Some perspectives:

1. You can use a user-moderated, editable, living Q&A system that doesn't  
suffer from the "threading" problem -- or you can go with "simple" (IMHO,  
not as good) mailing list technology. There are several good Q&A systems, I  
like StackOverflow myself.
2. From a "keep it public, archived, and available" POV, I suppose it  
_might_ be argued that it is easier to extract, archive, and transition  
Google Group content than SO content. I don't know -- haven't tried either  
myself. SO content is available under the Creative Commons Attribution  
Share Alike license -- not bad IMO. (See [Public Network Terms of Service - Stack Overflow](http://stackexchange.com/legal))
3. From a "commercial" POV, you can support Google (here) or Stack Exchange  
Inc (StackOverflow).

My opinion on this is I don't like to use SO to get help as it's not

> described in the official help page: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help/)

--

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [August 14, 2012, 6:25pm UTC](https://discuss.elastic.co/t/getting-an-elasticsearch-cluster-to-green-cluster-setup-on-os-x/8735/8 "2012-08-14T18:25:43Z")

</div>

On Tue, 2012-08-14 at 11:15 -0700, David James wrote:

> Wow. 🙂 You better not ask a friend or colleague either, because they  
> are not listed on that page. 😛

🙂

My feeling is that SO doesn't have the strong elasticsearch community,  
so by asking your question there, there is a good chance it'll be  
exposed to fewer people who really know what they're talking about.

That said, the formatting of SO and the durability of the answers means  
that I tend to spend more time answering questions there in greater  
detail, because its easy to link people asking the same question to the  
right answer in the future. (and its easier to search than google  
groups).

clint

--

---

<div class="post-metadata">

**Author:** ![karmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karmi/32/44951_2.png) [@karmi](https://discuss.elastic.co/u/karmi)\
**Post date:** [August 14, 2012, 6:35pm UTC](https://discuss.elastic.co/t/getting-an-elasticsearch-cluster-to-green-cluster-setup-on-os-x/8735/9 "2012-08-14T18:35:18Z")

</div>

On Tuesday, August 14, 2012 6:14:23 PM UTC+2, David James wrote:

Says who?

It was clearly marked as a personal note, so, “says me”. At the same time,  
I respect your disagreement.

The cross-posting of questions between GitHub issues, StackOverflow and  
Google Groups is rather unfortunate, in my personal opinion. My personal  
opinion is further supported by taking care of discussions related to the  
Tire Ruby client for elasticsearch.

As Clinton Gormley notes in the discussion below, StackOverflow is perfect  
for asking and answering higher level, conceptual questions, not cases like  
"I have a simple problem, now what".

In the grand scheme, it's a matter of which source of information wins in  
the Google fight -- if you're interested in a quick solution to a problem,  
the IRC is still hands down the most effective communication channel.

The mailing list is a perfect channel for the type of the question you  
originally asked, at the moment.

Karel

> 

--

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 14, 2012, 10:00pm UTC](https://discuss.elastic.co/t/getting-an-elasticsearch-cluster-to-green-cluster-setup-on-os-x/8735/10 "2012-08-14T22:00:52Z")

</div>

You're right. I never ask a colleague ! 😉  
No, just kidding.

Fact is I answer in the ML every day but I don't look at other places (SO). I should do it. I think I will. But by now, IMHO, I think that you will get less answers in SO than here.

But, if Shay and ES team are ok to consider SO as a good place to ask for help, it should be added to the help page.

David

--

Le 14 août 2012 à 20:15, David James [davidcjames@gmail.com](mailto:davidcjames@gmail.com) a écrit :

> Wow. 🙂 You better not ask a friend or colleague either, because they are not listed on that page. 😛
> 
> Some perspectives:
> 
> 1. You can use a user-moderated, editable, living Q&A system that doesn't suffer from the "threading" problem -- or you can go with "simple" (IMHO, not as good) mailing list technology. There are several good Q&A systems, I like StackOverflow myself.
> 2. From a "keep it public, archived, and available" POV, I suppose it _might_ be argued that it is easier to extract, archive, and transition Google Group content than SO content. I don't know -- haven't tried either myself. SO content is available under the Creative Commons Attribution Share Alike license -- not bad IMO. (See [Public Network Terms of Service - Stack Overflow](http://stackexchange.com/legal))
> 3. From a "commercial" POV, you can support Google (here) or Stack Exchange Inc (StackOverflow).
> 
> ## My opinion on this is I don't like to use SO to get help as it's not described in the official help page: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help/)

--

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [August 14, 2012, 10:25pm UTC](https://discuss.elastic.co/t/getting-an-elasticsearch-cluster-to-green-cluster-setup-on-os-x/8735/11 "2012-08-14T22:25:28Z")

</div>

I was asked on Stackoverflow about the JDBC river before and I will  
continue to encourage everyone to join the Elasticsearch community here to  
ask for help.

Scattering help resources for an open-source project hinders coherent  
documentation and support. Please keep follow this mailing list, enhance  
the docs, write useful recipes, beginner tutorials, cookbooks. Answering  
questions on places such as Stackoverflow will have a tendency to drain  
energy from the community.

My 2c.

Best regards,

Jörg

On Wednesday, August 15, 2012 12:00:52 AM UTC+2, David Pilato wrote:

> You're right. I never ask a colleague ! 😉  
> No, just kidding.
> 
> Fact is I answer in the ML every day but I don't look at other places  
> (SO). I should do it. I think I will. But by now, IMHO, I think that you  
> will get less answers in SO than here.
> 
> But, if Shay and ES team are ok to consider SO as a good place to ask for  
> help, it should be added to the help page.
> 
> David
> 
> --
> 
> Le 14 août 2012 à 20:15, David James \<[david...@gmail.com](mailto:david...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> Wow. 🙂 You better not ask a friend or colleague either, because they are  
> not listed on that page. 😛
> 
> Some perspectives:
> 
> 1. You can use a user-moderated, editable, living Q&A system that doesn't  
> suffer from the "threading" problem -- or you can go with "simple" (IMHO,  
> not as good) mailing list technology. There are several good Q&A systems, I  
> like StackOverflow myself.
> 2. From a "keep it public, archived, and available" POV, I suppose it  
> _might_ be argued that it is easier to extract, archive, and transition  
> Google Group content than SO content. I don't know -- haven't tried either  
> myself. SO content is available under the Creative Commons Attribution  
> Share Alike license -- not bad IMO. (See [Public Network Terms of Service - Stack Overflow](http://stackexchange.com/legal))
> 3. From a "commercial" POV, you can support Google (here) or Stack  
> Exchange Inc (StackOverflow).
> 
> My opinion on this is I don't like to use SO to get help as it's not
> 
> > described in the official help page: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help/)
> 
> --

--

---

<div class="post-metadata">

**Author:** ![David\_James](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_james/32/2768_2.png) [@David\_James](https://discuss.elastic.co/u/David_James)\
**Post date:** [August 14, 2012, 10:59pm UTC](https://discuss.elastic.co/t/getting-an-elasticsearch-cluster-to-green-cluster-setup-on-os-x/8735/12 "2012-08-14T22:59:02Z")

</div>

Thanks everyone for explaining your thoughts.

A vibrant community can and should engage and solve problems in various  
ways, places, and styles. Figuring out the "better" places and way to ask a  
question is an art. All channels are welcome. 🙂 SO isn't going anywhere.  
If we want to support getting Elasticsearch knowledge out there, it is an  
important part of the ecosystem.

Karel, what you write about SO "StackOverflow is perfect for asking and  
answering higher level, conceptual questions" is interesting, but I may  
disagree. SO does not encourage "conceptual" questions:

"You should only ask _practical_, _answerable_ questions based on _actual_problems that you face.

> _Chatty_, _open-ended_ questions _diminish_ the usefulness of our site  
> and push other questions off the front page. ... Your questions should be  
> reasonably scoped. ... If your motivation for asking the question is “I  
> would like to participate in a discussion about \_\_\_\_\_\_”, then you should  
> not be asking here." (from [Frequently Asked Questions - Stack Overflow](http://stackoverflow.com/faq))

I'll continue to share across various channels and forums. I tend to find  
that mailing lists still work better than SO for arbitrary conversations  
that don'f fit the Q&A pattern.

> 

--

---

<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:16am UTC](https://discuss.elastic.co/t/getting-an-elasticsearch-cluster-to-green-cluster-setup-on-os-x/8735/13 "2017-07-06T03:16:20Z")

</div>


