cassandraã«ææ¦ ãã®2 ã¤ã³ã¹ãã¼ã«
èªåã®éçºæ©(Debian lenny)ã«cassandraç°å¢ãæ§ç¯ãã¦ã¿ã¾ãã。
è²ã ã¯ã¾ã£ãã®ã§ãã、ã¨ãããã、ãã¾ããã£ãæ¹æ³ã¯ä»¥ä¸ã®éã。
1. Javaç°å¢ã®ã¤ã³ã¹ãã¼ã«
ãã®è¨äºãæ¸ãã¦ããæç¹ã®ææ°stableçãã¼ã¸ã§ã³ã0.5.1ã§ãã。
http://incubator.apache.org/cassandra/
ãããã¦ã³ãã¼ãããã°ããã®ã§ãã、
http://www.apache.org/dyn/closer.cgi?path=/incubator/cassandra/0.5.1/apache-cassandra-0.5.1-bin.tar.gz
ã®ãã¼ã¸ã«è¡¨ç¤ºãããæ¥æ¬ã®ãã©ã¼ãµã¤ãã«ã¯、
ææ°çããªãã®ã、404 not foundã«ãªã£ãã®ã§、
http://www.apache.org/mirrors/
ããé©å½ã«httpãµã¤ããé¸ãã§、
incubator -> cassandra -> 0.5.1
ã¨ãã©ã«ããéããã°tar.gzãè¦ã¤ããã¾ã。
http://ftp.kddilabs.jp/infosystems/apache/incubator/cassandra/0.4.1/apache-cassandra-0.4.1-src.tar.gz
3. 解å
-f ã§èµ·åãã¦ããã°、åæ¢ããã¨ãã¯、Ctrl + c ã§åæ¢ã§ãã¾ã。
ä¸åº¦åæ¢ãã¦ã、å度起åãã¦、getããã°、ä¸åº¦ä¿åãã¦ãããã¼ã¿ã
ã¡ããã¨åãããã¨ã確èªãã¾ãã。
ãããã使ãåãã¦ã¿ã¾ã。
åè:
http://wiki.apache.org/cassandra/CassandraCli
http://wiki.apache.org/cassandra/API
http://wiki.apache.org/cassandra/GettingStarted
ã½ã¼ã¹ã«å«ã¾ãã¦ããREADME.txt
è²ã ã¯ã¾ã£ãã®ã§ãã、ã¨ãããã、ãã¾ããã£ãæ¹æ³ã¯ä»¥ä¸ã®éã。
1. Javaç°å¢ã®ã¤ã³ã¹ãã¼ã«
$ sudo aptitude install openjdk-6-jdk openjdk-6-jre2. ã½ã¼ã¹çcassandraã®ãã¦ã³ãã¼ã
$ which java
/usr/bin/java
$ which javac
/usr/bin/java
$ java -version java version "1.6.0_0" OpenJDK Runtime Environment (build 1.6.0_0-b11)
OpenJDK Client VM (build 1.6.0_0-b11, mixed mode, sharing)
ãã®è¨äºãæ¸ãã¦ããæç¹ã®ææ°stableçãã¼ã¸ã§ã³ã0.5.1ã§ãã。
http://incubator.apache.org/cassandra/
ãããã¦ã³ãã¼ãããã°ããã®ã§ãã、
http://www.apache.org/dyn/closer.cgi?path=/incubator/cassandra/0.5.1/apache-cassandra-0.5.1-bin.tar.gz
ã®ãã¼ã¸ã«è¡¨ç¤ºãããæ¥æ¬ã®ãã©ã¼ãµã¤ãã«ã¯、
ææ°çããªãã®ã、404 not foundã«ãªã£ãã®ã§、
http://www.apache.org/mirrors/
ããé©å½ã«httpãµã¤ããé¸ãã§、
incubator -> cassandra -> 0.5.1
ã¨ãã©ã«ããéããã°tar.gzãè¦ã¤ããã¾ã。
http://ftp.kddilabs.jp/infosystems/apache/incubator/cassandra/0.4.1/apache-cassandra-0.4.1-src.tar.gz
3. 解å
$ wget 'http://ftp.kddilabs.jp/infosystems/apache/incubator/cassandra/0.5.1/apache-cassandra-0.5.1-src.tar.gz'4. ããããã®æºå
$ tar xvzf apache-cassandra-0.5.1-src.tar.gz
$ cd apache-cassandra-0.5.1-src/
$ ant
(ç¥)
BUILD SUCCESSFUL
Total time: 23 seconds
$ sudo mkdir -p /var/log/cassandra5. èµ·å
$ sudo chown -R `whoami` /var/log/cassandra
$ sudo mkdir -p /var/lib/cassandra
$ sudo chown -R `whoami` /var/lib/cassandra
$ chmod +x bin/cassandra bin/cassandra-cli
$ bin/cassandra -f6. å¥ã®ã¿ã¼ããã«ããcassandra-cliã§åä½ç¢ºèª
$ bin/cassandra-cli --host localhost --port 9160ã¨ããããã§、ç¡äºã«åãã¾ãã。
cassandra> set Keyspace1.Standard1['jsmith']['first'] = 'John'
Value inserted.
cassandra> set Keyspace1.Standard1['jsmith']['last'] = 'Smith'
Value inserted.
cassandra> set Keyspace1.Standard1['jsmith']['age'] = '42'
Value inserted.
cassandra> get Keyspace1.Standard1['jsmith']
(column=age, value=42; timestamp=1249930062801)
(column=first, value=John; timestamp=1249930053103)
(column=last, value=Smith; timestamp=1249930058345)
Returned 3 rows.
cassandra>
-f ã§èµ·åãã¦ããã°、åæ¢ããã¨ãã¯、Ctrl + c ã§åæ¢ã§ãã¾ã。
ä¸åº¦åæ¢ãã¦ã、å度起åãã¦、getããã°、ä¸åº¦ä¿åãã¦ãããã¼ã¿ã
ã¡ããã¨åãããã¨ã確èªãã¾ãã。
ãããã使ãåãã¦ã¿ã¾ã。
åè:
http://wiki.apache.org/cassandra/CassandraCli
http://wiki.apache.org/cassandra/API
http://wiki.apache.org/cassandra/GettingStarted
ã½ã¼ã¹ã«å«ã¾ãã¦ããREADME.txt