日期:2014-05-16 浏览次数:20537 次
mkdir -p /var/log/cassandra mkdir -p /var/lib/cassandra
seed_provider: # Addresses of hosts that are deemed contact points. # Cassandra nodes use this list of hosts to find each other and learn # the topology of the ring. You must change this if you are running # multiple nodes! - class_name: org.apache.cassandra.locator.SimpleSeedProvider parameters: # seeds is actually a comma-delimited list of addresses. # Ex: "<ip1>,<ip2>,<ip3>" - seeds: "127.0.0.1, 10.1.1.11, 10.1.1.12" #这里写上性能比较稳定的seed服务器 listen_address: 10.1.1.12 #可以空着,表示本机IP地址 rpc_address: 0.0.0.0 #允许任何地址的程序前来访问本数据库
cassandra -f
bin/nodetool -host 10.1.1.11 -p 7199 ring
bin/cassandra-cli -h 127.0.0.1 -p 9160
[default@unknown] create keyspace Keyspace1; ece86bde-dc55-11df-8240-e700f669bcfc [default@unknown] use Keyspace1; Authenticated to keyspace: Keyspace1 [default@Keyspace1] create column family Users with comparator=UTF8Type and default_validation_class=UTF8Type and key_validation_class=UTF8Type; 737c7a71-dc56-11df-8240-e700f669bcfc [default@KS1] set Users[jsmith][first] = 'John'; Value inserted. [default@KS1] set Users[jsmith][last] = 'Smith'; Value inserted. [default@KS1] set Users[jsmith][age] = long(42); Value inserted. [default@KS1] get Users[jsmith];