RE: Backup restore with a different name

2016-11-04 Thread Michael Laws
Hi Jens – I put together a couple of simple scripts a couple of years ago
that might do exactly what you need.  These leverage nodetool snapshot and
sstableloader to create keyspace snapshots, collect up all the necessary
SSTable files in an easy-to-move file, rename the keyspace, restore it to
the same or a different cluster, etc.  Might be useful…
https://github.com/AppliedInfrastructure/cassandra-snapshot-tools



Mike



*From:* Jens Rantil [mailto:jens.ran...@tink.se]
*Sent:* Wednesday, November 2, 2016 2:21 PM
*To:* Cassandra Group <user@cassandra.apache.org>
*Subject:* Backup restore with a different name



Hi,



Let's say I am periodically making snapshots of a table, say "users", for
backup purposes. Let's say a developer makes a mistake and corrupts the
table. Is there an easy way for me to restore a replica, say
"users_20161102", of the original table for the developer to looks at the
old copy?



Cheers,

Jens



-- 

Jens Rantil

Backend engineer

Tink AB



Email: jens.ran...@tink.se

Phone: +46 708 84 18 32

Web: www.tink.se



Facebook <https://www.facebook.com/#!/tink.se> Linkedin
<http://www.linkedin.com/company/2735919?trk=vsrp_companies_res_photo=VSRPsearchId%3A1057023381369207406670%2CVSRPtargetId%3A2735919%2CVSRPcmpt%3Aprimary>
 Twitter <https://twitter.com/tink>


Re: Backup restore with a different name

2016-11-03 Thread kurt Greaves
On 2 November 2016 at 22:10, Jens Rantil  wrote:

> I mean "exposing that state for reference while keeping the (corrupt)
> current state in the live cluster".


The following should work:


   1. Create a new table with the same schema but different name (in the
   same or a different keyspace).
   2. Rename all the snapshotted SSTables to match the *new* table name.
   3. Copy SSTables into new table directory.
   4. nodetool refresh or restart Cassandra.


Kurt Greaves
k...@instaclustr.com
www.instaclustr.com


Re: Backup restore with a different name

2016-11-03 Thread Rajath Subramanyam
Hi Jens,

Looks like what you need is an "any point in time" recovery solution. I
suggest that you go back to the snapshot that you issued that was closest
to "20161102" and restore that snapshot using the bulk loader to a new
table called "users_20161102". If you need to recover precisely to a
particular timestamp, you might have to parse every row in the SSTable and
filter out some rows.

Btw, we at Datos IO are working on exactly this solution. We have built a
data protection software for scale-out databases called RecoverX. We also
support Cassandra. One of the features that RecoverX supports is a repair
free recovery/restore that allows you to go back any point in time.

If you need more information, visit our website datos.io or drop us a note
at i...@datos.io, joe.schwa...@datos.io.

Hope this helps.

Full disclaimer: I am an engineer at Datos.io.

Regards,
Rajath


Rajath Subramanyam


On Wed, Nov 2, 2016 at 3:10 PM, Jens Rantil  wrote:

> Bryan,
>
> On Wed, Nov 2, 2016 at 11:38 AM, Bryan Cheng 
> wrote:
>
>> do you mean restoring the cluster to that state, or just exposing that
>> state for reference while keeping the (corrupt) current state in the live
>> cluster?
>
>
> I mean "exposing that state for reference while keeping the (corrupt)
> current state in the live cluster".
>
> Cheers,
> Jens
>
> --
> Jens Rantil
> Backend engineer
> Tink AB
>
> Email: jens.ran...@tink.se
> Phone: +46 708 84 18 32
> Web: www.tink.se
>
> Facebook  Linkedin
> 
>  Twitter 
>


Re: Backup restore with a different name

2016-11-02 Thread Jens Rantil
Bryan,

On Wed, Nov 2, 2016 at 11:38 AM, Bryan Cheng  wrote:

> do you mean restoring the cluster to that state, or just exposing that
> state for reference while keeping the (corrupt) current state in the live
> cluster?


I mean "exposing that state for reference while keeping the (corrupt)
current state in the live cluster".

Cheers,
Jens

-- 
Jens Rantil
Backend engineer
Tink AB

Email: jens.ran...@tink.se
Phone: +46 708 84 18 32
Web: www.tink.se

Facebook  Linkedin

 Twitter 


Re: Backup restore with a different name

2016-11-02 Thread Jens Rantil
Thanks Anubhav,

Looks like a Java project without any documentation whatsoever ;) How do I
use the tool? What does it do?

Cheers,
Jens

On Wed, Nov 2, 2016 at 11:36 AM, Anubhav Kale <anubhav.k...@microsoft.com>
wrote:

> You would have to build some logic on top of what’s natively supported.
>
>
>
> Here is an option: https://github.com/anubhavkale/CassandraTools/
> tree/master/BackupRestore
>
>
>
>
>
> *From:* Jens Rantil [mailto:jens.ran...@tink.se]
> *Sent:* Wednesday, November 2, 2016 2:21 PM
> *To:* Cassandra Group <user@cassandra.apache.org>
> *Subject:* Backup restore with a different name
>
>
>
> Hi,
>
>
>
> Let's say I am periodically making snapshots of a table, say "users", for
> backup purposes. Let's say a developer makes a mistake and corrupts the
> table. Is there an easy way for me to restore a replica, say
> "users_20161102", of the original table for the developer to looks at the
> old copy?
>
>
>
> Cheers,
>
> Jens
>
>
>
> --
>
> Jens Rantil
>
> Backend engineer
>
> Tink AB
>
>
>
> Email: jens.ran...@tink.se
>
> Phone: +46 708 84 18 32
>
> Web: www.tink.se
> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.tink.se%2F=02%7C01%7CAnubhav.Kale%40microsoft.com%7Cb96c56bb385a4b769ef508d403662a7c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636137184724447397=Vg7mNwD7Wcvyui1HSugueVv4GAc7961mWXUYMR0cE%2B4%3D=0>
>
>
>
> Facebook
> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.facebook.com%2F%23!%2Ftink.se=02%7C01%7CAnubhav.Kale%40microsoft.com%7Cb96c56bb385a4b769ef508d403662a7c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636137184724457399=JD11Q5%2FlsE0nUZLoq%2FTI3tYKh3nZgNnlU8uCSBOJEOQ%3D=0>
>  Linkedin
> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.linkedin.com%2Fcompany%2F2735919%3Ftrk%3Dvsrp_companies_res_photo%26trkInfo%3DVSRPsearchId%253A1057023381369207406670%252CVSRPtargetId%253A2735919%252CVSRPcmpt%253Aprimary=02%7C01%7CAnubhav.Kale%40microsoft.com%7Cb96c56bb385a4b769ef508d403662a7c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636137184724457399=z3yBN1NQpgEfjR2G5O4mwWE5GVw1ziIgj80v2%2FBIkB4%3D=0>
>  Twitter
> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2Ftink=02%7C01%7CAnubhav.Kale%40microsoft.com%7Cb96c56bb385a4b769ef508d403662a7c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636137184724457399=yo9FEAlRW6LdH5fsm4YdZoYLn6VvSt0h0iZCSEl2avY%3D=0>
>



-- 
Jens Rantil
Backend engineer
Tink AB

Email: jens.ran...@tink.se
Phone: +46 708 84 18 32
Web: www.tink.se

Facebook <https://www.facebook.com/#!/tink.se> Linkedin
<http://www.linkedin.com/company/2735919?trk=vsrp_companies_res_photo=VSRPsearchId%3A1057023381369207406670%2CVSRPtargetId%3A2735919%2CVSRPcmpt%3Aprimary>
 Twitter <https://twitter.com/tink>


Re: Backup restore with a different name

2016-11-02 Thread Bryan Cheng
Hi Jens,

When you refer to restoring a snapshot for a developer to look at, do you
mean restoring the cluster to that state, or just exposing that state for
reference while keeping the (corrupt) current state in the live cluster?

You may find these useful:
https://docs.datastax.com/en/cassandra/2.1/cassandra/operations/ops_backup_snapshot_restore_t.html
https://docs.datastax.com/en/cassandra/2.1/cassandra/operations/ops_snapshot_restore_new_cluster.html

Additionally, AFAIK the snapshot files are just SSTables, so any utility
that can examine them (for example, sstable2json) should work on those
files as well.

On Wed, Nov 2, 2016 at 2:20 PM, Jens Rantil  wrote:

> Hi,
>
> Let's say I am periodically making snapshots of a table, say "users", for
> backup purposes. Let's say a developer makes a mistake and corrupts the
> table. Is there an easy way for me to restore a replica, say
> "users_20161102", of the original table for the developer to looks at the
> old copy?
>
> Cheers,
> Jens
>
> --
> Jens Rantil
> Backend engineer
> Tink AB
>
> Email: jens.ran...@tink.se
> Phone: +46 708 84 18 32
> Web: www.tink.se
>
> Facebook  Linkedin
> 
>  Twitter 
>


RE: Backup restore with a different name

2016-11-02 Thread Anubhav Kale
You would have to build some logic on top of what’s natively supported.

Here is an option: 
https://github.com/anubhavkale/CassandraTools/tree/master/BackupRestore


From: Jens Rantil [mailto:jens.ran...@tink.se]
Sent: Wednesday, November 2, 2016 2:21 PM
To: Cassandra Group <user@cassandra.apache.org>
Subject: Backup restore with a different name

Hi,

Let's say I am periodically making snapshots of a table, say "users", for 
backup purposes. Let's say a developer makes a mistake and corrupts the table. 
Is there an easy way for me to restore a replica, say "users_20161102", of the 
original table for the developer to looks at the old copy?

Cheers,
Jens

--
Jens Rantil
Backend engineer
Tink AB

Email: jens.ran...@tink.se<mailto:jens.ran...@tink.se>
Phone: +46 708 84 18 32
Web: 
www.tink.se<https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.tink.se%2F=02%7C01%7CAnubhav.Kale%40microsoft.com%7Cb96c56bb385a4b769ef508d403662a7c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636137184724447397=Vg7mNwD7Wcvyui1HSugueVv4GAc7961mWXUYMR0cE%2B4%3D=0>

Facebook<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.facebook.com%2F%23!%2Ftink.se=02%7C01%7CAnubhav.Kale%40microsoft.com%7Cb96c56bb385a4b769ef508d403662a7c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636137184724457399=JD11Q5%2FlsE0nUZLoq%2FTI3tYKh3nZgNnlU8uCSBOJEOQ%3D=0>
 
Linkedin<https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.linkedin.com%2Fcompany%2F2735919%3Ftrk%3Dvsrp_companies_res_photo%26trkInfo%3DVSRPsearchId%253A1057023381369207406670%252CVSRPtargetId%253A2735919%252CVSRPcmpt%253Aprimary=02%7C01%7CAnubhav.Kale%40microsoft.com%7Cb96c56bb385a4b769ef508d403662a7c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636137184724457399=z3yBN1NQpgEfjR2G5O4mwWE5GVw1ziIgj80v2%2FBIkB4%3D=0>
 
Twitter<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2Ftink=02%7C01%7CAnubhav.Kale%40microsoft.com%7Cb96c56bb385a4b769ef508d403662a7c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636137184724457399=yo9FEAlRW6LdH5fsm4YdZoYLn6VvSt0h0iZCSEl2avY%3D=0>


Backup restore with a different name

2016-11-02 Thread Jens Rantil
Hi,

Let's say I am periodically making snapshots of a table, say "users", for
backup purposes. Let's say a developer makes a mistake and corrupts the
table. Is there an easy way for me to restore a replica, say
"users_20161102", of the original table for the developer to looks at the
old copy?

Cheers,
Jens

-- 
Jens Rantil
Backend engineer
Tink AB

Email: jens.ran...@tink.se
Phone: +46 708 84 18 32
Web: www.tink.se

Facebook  Linkedin

 Twitter