You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Anton Koshevoy <no...@gmail.com> on 2015/06/08 15:22:12 UTC

Restoring all cluster from snapshots

Hello all.

I need to transfer and start the copy of production cluster in a test environment. My steps:

- nodetool snapshot -t `hostname`-#{cluster_name}-#{timestamp} -p #{jmx_port}
- nodetool ring -p #{jmx_port} | grep `/sbin/ifconfig eth0 | grep 'inet addr' | awk -F: '{print $2}' | awk '{print $1}'` | awk '{ print $NF }' | tr '\\n' ',' | sudo tee /etc/cassandra/#{cluster_name}.conf/tokens.txt
- rsync snapshots to the backup machine
- copy files to the 2 test servers in the same folders as on production.
- sudo rm -rf /db/cassandra/cr/data0*/system/*
- paste list of initial_token from step 2 to the cassandra.yaml file on each server
- start both test servers.

And instead of gigabytes of my keyspaces I see only:

Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address       Load       Tokens  Owns (effective)  Host ID                               Rack
UN  10.40.231.3   151.06 KB  256     100.0%            c505db2f-d14a-4044-949f-cb952ec022f6  RACK01
UN  10.40.231.31  134.59 KB  256     100.0%            12879849-ade0-4dcb-84c0-abb3db996ba7  RACK01

And any mentions about my keyspaces here:

[cqlsh 5.0.1 | Cassandra 2.1.3 | CQL spec 3.2.0 | Native protocol v3]
Use HELP for help.
cqlsh>
cqlsh> describe keyspaces

system_traces  system
cqlsh>

What Do I miss in this process?

Re: Restoring all cluster from snapshots

Posted by Alain RODRIGUEZ <ar...@gmail.com>.
I think you just have to do a "DESC KEYSPACE mykeyspace;" from one node of
the production cluster then copy the output and import it in your dev
cluster using "cqlsh -f output.cql".

Take care at the start of the output you might want to change DC names, RF
or strategy.

Also, if you don't want to restart nodes you can load data by using
"nodetool refresh mykeyspace mycf"

C*heers

Alain

2015-06-08 22:42 GMT+02:00 Anton Koshevoy <no...@gmail.com>:

> Rob, thanks for the answer.
>
> I just follow instruction from
> http://docs.datastax.com/en/cassandra/2.1/cassandra/operations/ops_snapshot_restore_new_cluster.html
>
> If not to remove system table data, the test cluster starts interfering
> to a production cluster. How Can I avoid this situation?
>
>
>
> On June 8, 2015 at 9:48:30 PM, Robert Coli (rcoli@eventbrite.com) wrote:
>
>  On Mon, Jun 8, 2015 at 6:22 AM, Anton Koshevoy <no...@gmail.com> wrote:
>
>>  - sudo rm -rf /db/cassandra/cr/data0*/system/*
>>
>
> This removes the schema. You can't load SSTables for column families which
> don't exist.
>
>  =Rob
>
>

Re: Restoring all cluster from snapshots

Posted by Robert Coli <rc...@eventbrite.com>.
On Mon, Jun 8, 2015 at 2:52 PM, Sanjay Baronia <
sanjay.baronia@triliodata.com> wrote:

>  Yes, you shouldn’t delete the system directory. Next steps are
> …reconfigure the test cluster with new IP addresses, clear the gossiping
> information and then boot the test cluster.
>

If you don't delete the system directory, you run the risk of the test
cluster nodes joining the source cluster.

Just start a single node on the new cluster, empty, and create the schema
on it.

Then do the rest of the process.

=Rob

RE: Restoring all cluster from snapshots

Posted by Sanjay Baronia <sa...@triliodata.com>.
Yes, you shouldn’t delete the system directory. Next steps are …reconfigure the test cluster with new IP addresses, clear the gossiping information and then boot the test cluster.

If you are running Cassandra on VMware,  then you may also want to look at this solution<http://www.triliodata.com/wp-content/uploads/2015/04/Cassandra-Trilio-Data-Sheet4.pdf> from Trilio Data, where you can create a Cassandra backup and restore it to a Test Cluster.

Regards,

Sanjay

_________________
Sanjay Baronia
VP of Product & Solutions Management
TrilioData
(c) 508-335-2306
sanjay.baronia@triliodata.com<ma...@triliodata.com>
[Trilio-Business Assurance_300 Pixels]<http://www.triliodata.com/>

Experience Trilio in action, please click here<mailto:info@triliodata.com?subject=Demo%20Request.> to request a demo today!

From: Anton Koshevoy [mailto:nowarry@gmail.com]
Sent: Monday, June 8, 2015 4:42 PM
To: user@cassandra.apache.org
Subject: Re: Restoring all cluster from snapshots

Rob, thanks for the answer.

I just follow instruction from http://docs.datastax.com/en/cassandra/2.1/cassandra/operations/ops_snapshot_restore_new_cluster.html

If not to remove system table data, the test cluster starts interfering to a production cluster. How Can I avoid this situation?




On June 8, 2015 at 9:48:30 PM, Robert Coli (rcoli@eventbrite.com<ma...@eventbrite.com>) wrote:
On Mon, Jun 8, 2015 at 6:22 AM, Anton Koshevoy <no...@gmail.com>> wrote:
- sudo rm -rf /db/cassandra/cr/data0*/system/*

This removes the schema. You can't load SSTables for column families which don't exist.

=Rob


Re: Restoring all cluster from snapshots

Posted by Anton Koshevoy <no...@gmail.com>.
Rob, thanks for the answer.

I just follow instruction from http://docs.datastax.com/en/cassandra/2.1/cassandra/operations/ops_snapshot_restore_new_cluster.html

If not to remove system table data, the test cluster starts interfering to a production cluster. How Can I avoid this situation?



On June 8, 2015 at 9:48:30 PM, Robert Coli (rcoli@eventbrite.com) wrote:

On Mon, Jun 8, 2015 at 6:22 AM, Anton Koshevoy <no...@gmail.com> wrote:
- sudo rm -rf /db/cassandra/cr/data0*/system/*

This removes the schema. You can't load SSTables for column families which don't exist.
 
=Rob


Re: Restoring all cluster from snapshots

Posted by Robert Coli <rc...@eventbrite.com>.
On Mon, Jun 8, 2015 at 6:22 AM, Anton Koshevoy <no...@gmail.com> wrote:

> - sudo rm -rf /db/cassandra/cr/data0*/system/*
>

This removes the schema. You can't load SSTables for column families which
don't exist.

=Rob