incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean McCully <sean_mccu...@yahoo.com>
Subject Re: How to make cassandra reconize SSTable after reinstall?
Date Sat, 12 Oct 2013 22:59:41 GMT

On Friday, October 11, 2013 02:56:09 PM Pin Siang Tan wrote:
> Hi
> 
> I have a single node Cassandra running datastax distribution. I reinstall
> Cassandra and updated Cassandra.yaml data_file_directories.
> 
> But now I run nodetool cfstats I got SSTable count: 0
> 
> This is the output of nodetool cfstats
> 
> Keyspace: kairosdbRead Count: 0Read Latency: NaN ms.
> Write Count: 0
> Write Latency: NaN ms.
> Pending Tasks: 0
>     Table: data_points
>     SSTable count: 0
>     Space used (live), bytes: 0
>     Space used (total), bytes: 0
>     SSTable Compression Ratio: 0.0
>     Number of keys (estimate): 0
>     Memtable cell count: 0
>     Memtable data size, bytes: 0
>     Memtable switch count: 0
>     Read count: 0
>     Read latency, micros: NaN ms.
>     Write count: 0
>     Write latency, micros: NaN ms.
>     Pending tasks: 0
>     Bloom filter false positives: 0
>     Bloom filter false ratio: 0.00000
>     Bloom filter space used, bytes: 0
>     Compacted partition minimum size, bytes: 0
>     Compacted partition maximum size, bytes: 0
>     Compacted partition mean size, bytes: 0
> 
> nodetool repair command doesn't help either.

/So this is one of the features of Polites (https://github.com/seanmccully/polites.git) 
that I posted to the users list a few days ago.  Note, you'll want to make sure that the 
settings (config.py) are configured correctly for your use case./

As part of my ongoing testing and development with this project, I just ran through 
this scenario. Where I setup a Cassandra Node, create a keyspace (mykeyspace) and 
Table with some data, and then blow away that Node and Create
a brand new node.  

I start Cassandra and Polites with the following command,

* $ polites --command server*

/I can then use the client command to see that Cassandra and Polites are running as 
expected./

*$ polites --command client*
/<xml><status>Running</status></xml>/
/<xml><auto-snapshot>True</auto-snapshot><last-snapshot>None</last-
snapshot></xml>/

/Then for sanity,  I check through nodetool that my keyspace and table exist./
*$ ./bin/nodetool cfstats*

/----------------/
/Keyspace: mykeyspace/
/        Read Count: 0/
/        Read Latency: NaN ms./
/        Write Count: 3/
/        Write Latency: 0.489 ms./
/        Pending Tasks: 0/
/                Table: users/
/                SSTable count: 1/
/                Space used (live), bytes: 4826/
/                Space used (total), bytes: 4826/
/                SSTable Compression Ratio: 0.4984025559105431/
/                Number of keys (estimate): 128/
/                Memtable cell count: 0/
/                Memtable data size, bytes: 0/
/                Memtable switch count: 1/
/                Read count: 0/
/                Read latency, micros: NaN ms./
/                Write count: 3/
/                Write latency, micros: NaN ms./
/                Pending tasks: 0/
/                Bloom filter false positives: 0/
/                Bloom filter false ratio: 0.00000/
/                Bloom filter space used, bytes: 16/
/                Compacted partition minimum size, bytes: 87/
/                Compacted partition maximum size, bytes: 124/
/                Compacted partition mean size, bytes: 117/

I then create a snapshot, where it is stored somewhere I can access later.
*$ polites --command client snapshot*
/<xml><snapshot>True</snapshot></xml>/

I check the status again,
*$ polites --command client*
/<xml><status>Running</status></xml>/
/<xml><auto-snapshot>True</auto-snapshot><last-
snapshot>1381615872717</last-snapshot></xml>/

I blow away the entire node and create a brand new Cassandra node.
On the new node with Polites running, I make sure that Polites can see the snapshot I 
created earlier.

*$ polites --command client*
/<xml><status>Running</status></xml>/
/<xml><auto-snapshot>True</auto-snapshot><last-
snapshot>1381615872717</last-snapshot></xml>/

I then use the restore command to restore from that snapshot,
*$ polites --command client restore*

And then for sanity, I make sure that I see the keyspace and table exist with nodetool 
and then check that my data is still sane.

*$ bin/nodetool cfstats*
/----------------/
/Keyspace: mykeyspace/
/        Read Count: 0/
/        Read Latency: NaN ms./
/        Write Count: 0/
/        Write Latency: NaN ms./
/        Pending Tasks: 0/
/                Table: users/
/                SSTable count: 1/
/                Space used (live), bytes: 4826/
/                Space used (total), bytes: 4826/
/                SSTable Compression Ratio: 0.4984025559105431/
/                Number of keys (estimate): 128/
/                Memtable cell count: 0/
/                Memtable data size, bytes: 0/
/                Memtable switch count: 0/
/                Read count: 0/
/                Read latency, micros: NaN ms./
Mime
View raw message