You see, things can go worse... |
If you're using Cassandra to store your data, I guess you do it because they are a lot! In that case you wouldn't risk losing them because something went wrong... This post is a short rescue guide for Cassandra going a bit further from how to backup and restore your data (read this). This post is mostly concerned with more extreme situations where you restart your server to find out that your precious keyspace is not there!!! Don't panic! As you see in the picture (left) things can go much worse...
Before it happens
In order to avoid loss of data, it's good to keep a copy of your schema generation code somewhere. You can create it from within cqlsh (CQL Shell) or using the Cassandra Client (cassandra-cli). Export your KS generation code in a file and keep it under lock and key. For example, using cli, create a file called schema_export and add in it the following lines: