我必須在我的密鑰空間中創建多個列族。一種方法是逐個創建列族......但就我而言,我有大約100個列族,所以我不能一個接一個地做......所以有什麼辦法,我可以通過某種方式創建多個列族腳本可以爲我創建多個列家族在一個短?如何使用某些腳本創建多個列族?
create column family USER_DATA_SECOND_1
with comparator = 'UTF8Type'
and key_validation_class = 'CompositeType(DateType,UTF8Type)'
and default_validation_class = 'BytesType'
and gc_grace = 86400
create column family USER_DATA_SECOND_2
with comparator = 'UTF8Type'
and key_validation_class = 'CompositeType(DateType,UTF8Type)'
and default_validation_class = 'BytesType'
and gc_grace = 86400
create column family USER_DATA_SECOND_3
with comparator = 'UTF8Type'
and key_validation_class = 'CompositeType(DateType,UTF8Type)'
and default_validation_class = 'BytesType'
and gc_grace = 86400
....
....
....
create column family USER_DATA_SECOND_100
with comparator = 'UTF8Type'
and key_validation_class = 'CompositeType(DateType,UTF8Type)'
and default_validation_class = 'BytesType'
and gc_grace = 86400
而且還創造這些多列的家庭..假設,如果我需要再次下降,這些都列族則是如何再使用一些腳本後做?
下面是這樣的,我現在接一個,這不是我想要的創建列族從我的本地機器到我的分期卡珊德拉服務器一個..
C:\Apache Cassandra\apache-cassandra-1.2.3\bin>cassandra-cli -h sc-cdbhost01.vip.slc.qa.host.com
Starting Cassandra Client
Connected to: "Staging Cluster cass01" on sc-cdbhost01.vip.slc.qa.host.com/9160
Welcome to Cassandra CLI version 1.2.3
Type 'help;' or '?' for help.
Type 'quit;' or 'exit;' to quit.
[[email protected]] use profileks;
Authenticated to keyspace: profileks
[[email protected]] create column family USER_DATA_SECOND_1
... with comparator = 'UTF8Type'
... and key_validation_class = 'CompositeType(DateType,UTF8Type)'
... and default_validation_class = 'BytesType'
... and gc_grace = 86400;
27fe1848-c7de-3994-9289-486a9bbbf344
[[email protected]]
誰能幫我,這是否是否可以通過某種腳本創建多個列族,然後通過某種腳本刪除這些列族?
謝謝你的建議......你能用腳本提供一個簡單的例子嗎?我對腳本語言並不熟悉......這將幫助我更好地理解一個簡單的例子。謝謝.. – ferhan