2013-05-17 28 views

Trả lời

85

Rất đơn giản . Chỉ cần nhập lệnh này trong vỏ cqlsh của bạn và tận hưởng

select * from system.schema_keyspaces; 

Trong C * 3.x, chúng tôi chỉ đơn giản là có thể sử dụng

describe keyspaces 
+0

thấy rằng hướng dẫn được liệt kê ở dưới cùng của này: http://www.datastax.com/docs/1.1/dml/using_cql – Crowie

+5

Bảng system.schema_keyspaces dường như đã được gỡ bỏ khỏi c * 3.x loạt – BSB

39

Chỉ cần cố gắng này:

describe keyspaces 


Tuy nhiên bạn có thể cần thông số kỹ thuật của khoảng sau (thay vì those mentioned một mình Crowie)

[cqlsh 4.1.1 | Cassandra 2.0.6 | CQL spec 3.1.1 | Thrift giao thức 19.39.0]

4

Cách đúng với C * loạt 3.x là:

List<KeyspaceMetadata> keyspaces = Cluster.getMetadata().getKeyspaces() 

Sau đó sử dụng getName() trên trường KeyspaceMetadata.

7
cqlsh> select * from system_schema.keyspaces; 

keyspace_name  | durable_writes | replication 
--------------------+----------------+------------------------------------------------------------------------------------- 
     system_auth |   True | {'class': 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '1'} 
     system_schema |   True |        {'class': 'org.apache.cassandra.locator.LocalStrategy'} 
system_distributed |   True | {'class': 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '3'} 
      system |   True |        {'class': 'org.apache.cassandra.locator.LocalStrategy'} 
     system_traces |   True | {'class': 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '2'} 
Các vấn đề liên quan