nosql

[cassandra 2.0] terminal, cqlsh을 이용해서 간단한 정보 얻어오기 (active check)

'김용환' 2013. 11. 7. 10:51



cqlsh에서 간단하게 table을 하나 생성했다. 

cqlsh:userkeyspace> CREATE TABLE playlists (

               id      uuid,

               type    text,

              name    text,

              size    int,

              artist text,

              PRIMARY KEY (id, type, name, size)

             );




script를 통해서 describe table playlist을 얻어올 수 있다. 이를 통해서 cassandra node가 현재 active한지 파악을 간단하게 할 수 있다. 



echo 'use userkeyspace; describe table playlists; select count(*) from playlists;' | ./cqlsh -f /dev/stdin


CREATE TABLE playlists (

  id uuid,

  type text,

  name text,

  size int,

  artist text,

  PRIMARY KEY (id, type, name, size)

) WITH

  bloom_filter_fp_chance=0.010000 AND

  caching='KEYS_ONLY' AND

  comment='' AND

  dclocal_read_repair_chance=0.000000 AND

  gc_grace_seconds=864000 AND

  index_interval=128 AND

  read_repair_chance=0.100000 AND

  replicate_on_write='true' AND

  populate_io_cache_on_flush='false' AND

  default_time_to_live=0 AND

  speculative_retry='NONE' AND

  memtable_flush_period_in_ms=0 AND

  compaction={'class': 'SizeTieredCompactionStrategy'} AND

  compression={'sstable_compression': 'LZ4Compressor'};



 count

-------

     0


(1 rows)