0
votes

I created a Cassandra test node with a few keyspaces protected with the PasswordAuthenticator. While testing, I completely "broke" cassandra, in no way cassandra nor nodetool will start.

I want to create a fresh test server and import the old keyspaces. I have access to all the database files in /var/lib/cassandra/data/ , I still keep my user and password, etc.

How can I get the old keyspace structure from the files? I don't mind about the old data.

1

1 Answers

0
votes

Cassandra stores all schema elements in a system keyspace in schema_* tables:ls -l of /system

The problem with these tables that there's no easy way to convert it's contents back to human-readable cql3 schema.

As a trick to restore lost schema I suggest to use cqlsh history file located in ~/.cassandra/cqlsh_history. Just search this file for a latest DDL statement and reapply it to your new server.