Cassandra

とりあえず起動した。

GettingStartedにしたがって、conf/storage-conf.xml中のCommitLogDirectory、DataFileDirectories(この2つは別のディレクトリにする必要がある)、conf/log4j.properties中のlog4j.appender.R.Fileを書き換えて

http://wiki.apache.org/cassandra/GettingStarted

bin\cassandra.bat -f とかすればよい。

C:\Users\okano\Documents\apache-cassandra-0.6.1-bin.tar\apache-cassandra-0.6.1>bin\cassandra.bat -f
Starting Cassandra Server
Listening for transport dt_socket at address: 8888
 INFO 00:44:30,897 Auto DiskAccessMode determined to be standard
 INFO 00:44:31,504 Saved Token not found. Using 23982774398267016031766049682099076494
 INFO 00:44:31,505 Saved ClusterName not found. Using Test Cluster
 INFO 00:44:31,543 Creating new commitlog segment C:\Users\okano\Documents\apache-cassandra-0.6.1-bin.tar\apache-cassand
274197471543.log
 INFO 00:44:31,717 Starting up server gossip
 INFO 00:44:31,836 Binding thrift service to localhost/127.0.0.1:9160
 INFO 00:44:31,843 Cassandra starting up...

標準で付属しているクライアントから操作してみる。

http://wiki.apache.org/cassandra/CassandraCli

C:\Users\okano\Documents\apache-cassandra-0.6.1-bin.tar\apache-cassandra-0.6.1>bin\cassandra-cli -host localhost -port 9160
Starting Cassandra Client
Connected to: "Test Cluster" on localhost/9160
Welcome to cassandra CLI.

Type 'help' or '?' for help. Type 'quit' or 'exit' to quit.
cassandra> set Keyspace1.Standard2['jsmith']['first'] = 'John'
Value inserted.
cassandra> set Keyspace1.Standard2['jsmith']['last'] = 'Smith'
Value inserted.
cassandra> set Keyspace1.Standard2['jsmith']['age'] = '42'
Value inserted.
cassandra> get Keyspace1.Standard2['jsmith']
=> (column=last, value=Smith, timestamp=1274198550822000)
=> (column=first, value=John, timestamp=1274198512609000)
=> (column=age, value=42, timestamp=1274198574371000)
Returned 3 results.
cassandra>

データを書き込むと、まずCommitLogとして書かれているみたい。
停止、再起動してもファイルに書かれたデータを読み直して、データが復元されていた。
DataFileは、再起同時にCommitLogから書き写されている??ような挙動に見えた。


備忘のためリンク
http://www.slideshare.net/akuwano/cassandra-4098052?type=powerpoint