How to get list of all Keyspaces in Cassandra by using CQL
Keyspaces table from system_schema keyspace can be used to get the list of all keyspaces in Cassandra.Let's create couple of Keyspaces by using below scripts and then we will use Keyspaces table from system_schema keyspace to see the details of keyspaces.
CQLSH:techbrotherstutorials> CREATE keyspace tbs
WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor' : 2}
AND durable_writes = true;
AND durable_writes = true;
CQLSH:techbrotherstutorials> CREATE keyspace tbs1
WITH REPLICATION = {'class': 'NetworkTopologyStrategy', 'DC1' : 2, 'DC2' : 1}
AND durable_writes = false;
AND durable_writes = false;
Once you will run above statements, it will create two keyspaces TBS and TBS1.
Let's use the below statement to get information about all the Keyspaces.
CQLSH:techbrotherstutorials> SELECT * FROM system_schema.keyspaces;
By executing above statement in CQL shell, Keyspace Name, Is Duruable Write Enable or not and replication configuration information will be shown.
Aivivu - đại lý chuyên vé máy bay trong nước và quốc tế
ReplyDeletevé máy bay đi Mỹ giá rẻ
giá vé từ mỹ về việt nam
ve may bay tu canada ve viet nam
đặt vé về việt nam từ nhật
mua ve may bay tu han quoc ve viet nam
Vé máy bay từ Đài Loan về Việt Nam
các khách sạn cách ly ở hà nội
ve may bay chuyen gia nuoc ngoai sang Viet Nam
Thanks you
ReplyDelete