Scaling my cluster back down


(Karl Baum) #1

In an attempt to index 200 million documents as quickly as possible, i scaled my elasticsearch cluster up to 31 instances and my index consists of 20 shards and 1 replica. Everything is going well but my question is can I scale the cluster down once i am done indexing? What happens if i drop down to let's say 5-10 elasticsearch instances within the cluster?

thx.

-karl


(Shay Banon) #2

Thats not a problem, those shards will get rebalanced into the remaining nodes. When you scale down, make sure to shutdown nodes one at a time, and wait for a green status between nodes being shutdown (we, you can shutdown nodes up to the replica count of the index without the chance of missing shards, note missing, and not loosing data, the data can still be recovered if you start the node back up).

On Friday, June 24, 2011 at 4:48 PM, Karl Baum wrote:

In an attempt to index 200 million documents as quickly as possible, i scaled my elasticsearch cluster up to 31 instances and my index consists of 20 shards and 1 replica. Everything is going well but my question is can I scale the cluster down once i am done indexing? What happens if i drop down to let's say 5-10 elasticsearch instances within the cluster?

thx.

-karl


(Karl Baum) #3

Interesting, in my case I have 20 shards but only one replica. Is that a replica per shard? If so, then can I safely shut down 20 instance?

Thanks for your help!

Sent from my iPhone

On Jun 24, 2011, at 9:50 AM, Shay Banon shay.banon@elasticsearch.com wrote:

Thats not a problem, those shards will get rebalanced into the remaining nodes. When you scale down, make sure to shutdown nodes one at a time, and wait for a green status between nodes being shutdown (we, you can shutdown nodes up to the replica count of the index without the chance of missing shards, note missing, and not loosing data, the data can still be recovered if you start the node back up).
On Friday, June 24, 2011 at 4:48 PM, Karl Baum wrote:

In an attempt to index 200 million documents as quickly as possible, i scaled my elasticsearch cluster up to 31 instances and my index consists of 20 shards and 1 replica. Everything is going well but my question is can I scale the cluster down once i am done indexing? What happens if i drop down to let's say 5-10 elasticsearch instances within the cluster?

thx.

-karl


(Chris Berkhout) #4

You want to shut down one instance at a time.

Each of your shards is on two nodes (the original on one and the
replica on the other).

If you shut down two nodes, you may take out both copies of a shard
before it has a chance to regenerate.

Cheers,
Chris

On Fri, Jun 24, 2011 at 10:57 PM, Karl Baum karl.baum@gmail.com wrote:

Interesting, in my case I have 20 shards but only one replica. Is that a
replica per shard? If so, then can I safely shut down 20 instance?
Thanks for your help!

Sent from my iPhone
On Jun 24, 2011, at 9:50 AM, Shay Banon shay.banon@elasticsearch.com
wrote:

Thats not a problem, those shards will get rebalanced into the remaining
nodes. When you scale down, make sure to shutdown nodes one at a time, and
wait for a green status between nodes being shutdown (we, you can shutdown
nodes up to the replica count of the index without the chance of missing
shards, note missing, and not loosing data, the data can still be recovered
if you start the node back up).

On Friday, June 24, 2011 at 4:48 PM, Karl Baum wrote:

In an attempt to index 200 million documents as quickly as possible, i
scaled my elasticsearch cluster up to 31 instances and my index consists of
20 shards and 1 replica. Everything is going well but my question is can I
scale the cluster down once i am done indexing? What happens if i drop down
to let's say 5-10 elasticsearch instances within the cluster?

thx.

-karl


(Shay Banon) #5

Yep, what Chris said :). You can scale down to even 2 nodes (and those shards will be allocated on both).

On Friday, June 24, 2011 at 6:09 PM, Chris Berkhout wrote:

You want to shut down one instance at a time.

Each of your shards is on two nodes (the original on one and the
replica on the other).

If you shut down two nodes, you may take out both copies of a shard
before it has a chance to regenerate.

Cheers,
Chris

On Fri, Jun 24, 2011 at 10:57 PM, Karl Baum <karl.baum@gmail.com (mailto:karl.baum@gmail.com)> wrote:

Interesting, in my case I have 20 shards but only one replica. Is that a
replica per shard? If so, then can I safely shut down 20 instance?
Thanks for your help!

Sent from my iPhone
On Jun 24, 2011, at 9:50 AM, Shay Banon <shay.banon@elasticsearch.com (mailto:shay.banon@elasticsearch.com)>
wrote:

Thats not a problem, those shards will get rebalanced into the remaining
nodes. When you scale down, make sure to shutdown nodes one at a time, and
wait for a green status between nodes being shutdown (we, you can shutdown
nodes up to the replica count of the index without the chance of missing
shards, note missing, and not loosing data, the data can still be recovered
if you start the node back up).

On Friday, June 24, 2011 at 4:48 PM, Karl Baum wrote:

In an attempt to index 200 million documents as quickly as possible, i
scaled my elasticsearch cluster up to 31 instances and my index consists of
20 shards and 1 replica. Everything is going well but my question is can I
scale the cluster down once i am done indexing? What happens if i drop down
to let's say 5-10 elasticsearch instances within the cluster?

thx.

-karl


(Karl Baum) #6

Wow, that is really amazing. Should i be paying attention to disk space during this process?

Sent from my iPad

On Jun 24, 2011, at 11:31 AM, Shay Banon shay.banon@elasticsearch.com wrote:

Yep, what Chris said :). You can scale down to even 2 nodes (and those shards will be allocated on both).
On Friday, June 24, 2011 at 6:09 PM, Chris Berkhout wrote:

You want to shut down one instance at a time.

Each of your shards is on two nodes (the original on one and the
replica on the other).

If you shut down two nodes, you may take out both copies of a shard
before it has a chance to regenerate.

Cheers,
Chris

On Fri, Jun 24, 2011 at 10:57 PM, Karl Baum karl.baum@gmail.com wrote:

Interesting, in my case I have 20 shards but only one replica. Is that a
replica per shard? If so, then can I safely shut down 20 instance?
Thanks for your help!

Sent from my iPhone
On Jun 24, 2011, at 9:50 AM, Shay Banon shay.banon@elasticsearch.com
wrote:

Thats not a problem, those shards will get rebalanced into the remaining
nodes. When you scale down, make sure to shutdown nodes one at a time, and
wait for a green status between nodes being shutdown (we, you can shutdown
nodes up to the replica count of the index without the chance of missing
shards, note missing, and not loosing data, the data can still be recovered
if you start the node back up).

On Friday, June 24, 2011 at 4:48 PM, Karl Baum wrote:

In an attempt to index 200 million documents as quickly as possible, i
scaled my elasticsearch cluster up to 31 instances and my index consists of
20 shards and 1 replica. Everything is going well but my question is can I
scale the cluster down once i am done indexing? What happens if i drop down
to let's say 5-10 elasticsearch instances within the cluster?

thx.

-karl


(Shay Banon) #7

Yes, you need to make sure that you are not overloading the cluster by making it too small.

On Friday, June 24, 2011 at 7:33 PM, Karl Baum wrote:

Wow, that is really amazing. Should i be paying attention to disk space during this process?

Sent from my iPad

On Jun 24, 2011, at 11:31 AM, Shay Banon <shay.banon@elasticsearch.com (mailto:shay.banon@elasticsearch.com)> wrote:

Yep, what Chris said :). You can scale down to even 2 nodes (and those shards will be allocated on both).

On Friday, June 24, 2011 at 6:09 PM, Chris Berkhout wrote:

You want to shut down one instance at a time.

Each of your shards is on two nodes (the original on one and the
replica on the other).

If you shut down two nodes, you may take out both copies of a shard
before it has a chance to regenerate.

Cheers,
Chris

On Fri, Jun 24, 2011 at 10:57 PM, Karl Baum <karl.baum@gmail.com (mailto:karl.baum@gmail.com)> wrote:

Interesting, in my case I have 20 shards but only one replica. Is that a
replica per shard? If so, then can I safely shut down 20 instance?
Thanks for your help!

Sent from my iPhone
On Jun 24, 2011, at 9:50 AM, Shay Banon <shay.banon@elasticsearch.com (mailto:shay.banon@elasticsearch.com)>
wrote:

Thats not a problem, those shards will get rebalanced into the remaining
nodes. When you scale down, make sure to shutdown nodes one at a time, and
wait for a green status between nodes being shutdown (we, you can shutdown
nodes up to the replica count of the index without the chance of missing
shards, note missing, and not loosing data, the data can still be recovered
if you start the node back up).

On Friday, June 24, 2011 at 4:48 PM, Karl Baum wrote:

In an attempt to index 200 million documents as quickly as possible, i
scaled my elasticsearch cluster up to 31 instances and my index consists of
20 shards and 1 replica. Everything is going well but my question is can I
scale the cluster down once i am done indexing? What happens if i drop down
to let's say 5-10 elasticsearch instances within the cluster?

thx.

-karl


(system) #8