You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Juan Manuel Formoso <jf...@gmail.com> on 2013/09/16 19:14:25 UTC

How can I switch from multiple disks to a single disk?

Because I ran out of space when shuffling, I was forced to add multiple
disks on my Cassandra nodes.

When I finish compacting, cleaning up, and repairing, I'd like to remove
them and return to one disk per node.

What is the procedure to make the switch?
Can I just kill cassandra, move the data from one disk to the other, remove
the configuration for the second disk, and re-start cassandra?

I assume files will not have the same name and thus not be overwritten, is
this the case? Does it pick it up just like that?

Thanks

-- 
*Juan Manuel Formoso
*Senior Geek
http://twitter.com/juanformoso
http://seniorgeek.com.ar
LLAP

Re: How can I switch from multiple disks to a single disk?

Posted by Robert Coli <rc...@eventbrite.com>.
On Tue, Sep 17, 2013 at 5:57 PM, Juan Manuel Formoso <jf...@gmail.com>wrote:

> Thanks! But, shouldn't I be able to just stop Cassandra, copy the files,
> change the config and restart? Why should I drain?


If you drain, you reduce to zero the chance of having some problem with the
SSTables flushed as a result of the restart.

However you are correct that you probably do not "need" to do so... :D

=Rob

Re: How can I switch from multiple disks to a single disk?

Posted by Juan Manuel Formoso <jf...@gmail.com>.
Thanks! But, shouldn't I be able to just stop Cassandra, copy the files,
change the config and restart? Why should I drain?

My RF+consistency level can handle one replica down (I forgot to mention
that in my OP, apologies)

Would it work in theory?

On Tuesday, September 17, 2013, Robert Coli wrote:

> On Tue, Sep 17, 2013 at 4:01 PM, Juan Manuel Formoso <jformoso@gmail.com<javascript:_e({}, 'cvml', 'jformoso@gmail.com');>
> > wrote:
>
>> Anyone who knows for sure if this would work?
>
>
> Sankalp Kohli (whose last name is phonetically awesome!) has pointed you
> in the correct direction.
>
> To be a bit more explicit :
>
> 1) determine if sstable names are unique across drives (they should be)
> 2) pre-copy all sstables from all source drives to target single drive
> 3) drain and stop cassandra
> 4) re-copy all sstables from all source drives to target single drive,
> with --delete or equivalent option to rsync such that you delete any files
> missing from source drives due to compaction in the interim
> 5) start cassandra with new conf file with single drive
> 6) if it doesn't work for some unforseen reason, you still have all your
> sstables in the old dirs, so just revert the conf file and fail back
>
> =Rob
>
>

-- 
*Juan Manuel Formoso
*Senior Geek
http://twitter.com/juanformoso
http://seniorgeek.com.ar
LLAP

Re: How can I switch from multiple disks to a single disk?

Posted by Robert Coli <rc...@eventbrite.com>.
On Tue, Sep 17, 2013 at 4:01 PM, Juan Manuel Formoso <jf...@gmail.com>wrote:

> Anyone who knows for sure if this would work?


Sankalp Kohli (whose last name is phonetically awesome!) has pointed you in
the correct direction.

To be a bit more explicit :

1) determine if sstable names are unique across drives (they should be)
2) pre-copy all sstables from all source drives to target single drive
3) drain and stop cassandra
4) re-copy all sstables from all source drives to target single drive, with
--delete or equivalent option to rsync such that you delete any files
missing from source drives due to compaction in the interim
5) start cassandra with new conf file with single drive
6) if it doesn't work for some unforseen reason, you still have all your
sstables in the old dirs, so just revert the conf file and fail back

=Rob

Re: How can I switch from multiple disks to a single disk?

Posted by Juan Manuel Formoso <jf...@gmail.com>.
Anyone who knows for sure if this would work?

Thanks!

On Monday, September 16, 2013, sankalp kohli wrote:

> I think you can do by moving all the sstables under one drive. I am not
> sure though. The sstables names should be unique across drives.
>
>
> On Mon, Sep 16, 2013 at 10:14 AM, Juan Manuel Formoso <jformoso@gmail.com<javascript:_e({}, 'cvml', 'jformoso@gmail.com');>
> > wrote:
>
>> Because I ran out of space when shuffling, I was forced to add multiple
>> disks on my Cassandra nodes.
>>
>> When I finish compacting, cleaning up, and repairing, I'd like to remove
>> them and return to one disk per node.
>>
>> What is the procedure to make the switch?
>> Can I just kill cassandra, move the data from one disk to the other,
>> remove the configuration for the second disk, and re-start cassandra?
>>
>> I assume files will not have the same name and thus not be overwritten,
>> is this the case? Does it pick it up just like that?
>>
>> Thanks
>>
>> --
>> *Juan Manuel Formoso
>> *Senior Geek
>> http://twitter.com/juanformoso
>> http://seniorgeek.com.ar
>> LLAP
>>
>
>

-- 
*Juan Manuel Formoso
*Senior Geek
http://twitter.com/juanformoso
http://seniorgeek.com.ar
LLAP

Re: How can I switch from multiple disks to a single disk?

Posted by sankalp kohli <ko...@gmail.com>.
I think you can do by moving all the sstables under one drive. I am not
sure though. The sstables names should be unique across drives.


On Mon, Sep 16, 2013 at 10:14 AM, Juan Manuel Formoso <jf...@gmail.com>wrote:

> Because I ran out of space when shuffling, I was forced to add multiple
> disks on my Cassandra nodes.
>
> When I finish compacting, cleaning up, and repairing, I'd like to remove
> them and return to one disk per node.
>
> What is the procedure to make the switch?
> Can I just kill cassandra, move the data from one disk to the other,
> remove the configuration for the second disk, and re-start cassandra?
>
> I assume files will not have the same name and thus not be overwritten, is
> this the case? Does it pick it up just like that?
>
> Thanks
>
> --
> *Juan Manuel Formoso
> *Senior Geek
> http://twitter.com/juanformoso
> http://seniorgeek.com.ar
> LLAP
>

How can I switch from multiple disks to a single disk?

Posted by Juan Manuel Formoso <jf...@gmail.com>.
Because I ran out of space when shuffling, I was forced to add multiple
disks on my Cassandra nodes.

When I finish compacting, cleaning up, and repairing, I'd like to remove
them and return to one disk per node.

What is the procedure to make the switch?
Can I just kill cassandra, move the data from one disk to the other, remove
the configuration for the second disk, and re-start cassandra?

I assume files will not have the same name and thus not be overwritten, is
this the case? Does it pick it up just like that?

Thanks

-- 
*Juan Manuel Formoso
*Senior Geek
http://twitter.com/juanformoso
http://seniorgeek.com.ar
LLAP



-- 
*Juan Manuel Formoso
*Senior Geek
http://twitter.com/juanformoso
http://seniorgeek.com.ar
LLAP