Centos 6.3にCassandraデータベースをインストール
インストール手順下記
1.Java jdk1.7をダウンロード
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
例 jdk-7u17-linux-i586.tar.gz
2.ダウンロードが完了したら、jdkを解凍
tar -zxvf jdk-7u17-linux-i586.tar.gz
3.環境変数を設定
vim /etc/profile
ファイルの一番下に下記コードを追加
JAVA_HOME=/usr/local/jdk1.7.0_17
参考
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export PATH
export CLASSPATH
4. 設定を有効するために下記コマンドを実行
source /etc/profile
5.java jdkインストール成功かどうか下記コマンドをチェック
[root@localhost ~]# java -version
java version “1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) Client VM (build 23.7-b01, mixed mode)
[root@localhost ~]#
6.Cassandraをダウンロード
URL:http://cassandra.apache.org/download/
例 apache-cassandra-1.2.4-bin.tar.gz
7.ダウンロード完了したら、ファイルを解凍
tar -zxvf apache-cassandra-1.2.4-bin.tar.gz
8.Cassandraが起動
cd apache-cassandra-1.2.4/bin
./cassandra
参考:
[root@localhost bin]# ./cassandra
xss = -ea -javaagent:./../lib/jamm-0.2.5.jar -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms505M -Xmx505M -Xmn100M -XX:+HeapDumpOnOutOfMemoryError -Xss180k
[root@localhost bin]# INFO 08:42:11,803 Logging initialized
INFO 08:42:11,925 32bit JVM detected. It is recommended to run Cassandra on a 64bit JVM for better performance.
INFO 08:42:11,930 JVM vendor/version: Java HotSpot(TM) Client VM/1.7.0_17
INFO 08:42:11,932 Heap size: 519045120/520093696
INFO 08:42:11,933 Classpath: ./../conf:./../build/classes/main:./../build/classes/thrift:./../lib/antlr-3.2.jar:./../lib/apache-cassandra-1.2.4.jar:./../lib/apache-cassandra-clientutil-1.2.4.jar:./../lib/apache-cassandra-thrift-1.2.4.jar:./../lib/avro-1.4.0-fixes.jar:./../lib/avro-1.4.0-sources-fixes.jar:./../lib/commons-cli-1.1.jar:./../lib/commons-codec-1.2.jar:./../lib/commons-lang-2.6.jar:./../lib/compress-lzf-0.8.4.jar:./../lib/concurrentlinkedhashmap-lru-1.3.jar:./../lib/guava-13.0.1.jar:./../lib/high-scale-lib-1.1.2.jar:./../lib/jackson-core-asl-1.9.2.jar:./../lib/jackson-mapper-asl-1.9.2.jar:./../lib/jamm-0.2.5.jar:./../lib/jbcrypt-0.3m.jar:./../lib/jline-1.0.jar:./../lib/json-simple-1.1.jar:./../lib/libthrift-0.7.0.jar:./../lib/log4j-1.2.16.jar:./../lib/lz4-1.1.0.jar:./../lib/metrics-core-2.0.3.jar:./../lib/netty-3.5.9.Final.jar:./../lib/servlet-api-2.5-20081211.jar:./../lib/slf4j-api-1.7.2.jar:./../lib/slf4j-log4j12-1.7.2.jar:./../lib/snakeyaml-1.6.jar:./../lib/snappy-java-1.0.4.1.jar:./../lib/snaptree-0.1.jar:./../lib/jamm-0.2.5.jar
INFO 08:42:11,998 JNA not found. Native methods will be disabled.
INFO 08:42:12,207 Loading settings from file:/usr/local/apache-cassandra-1.2.4/conf/cassandra.yaml
INFO 08:42:13,791 Data files directories: [/var/lib/cassandra/data]
INFO 08:42:13,792 Commit log directory: /var/lib/cassandra/commitlog
省略
INFO 08:42:23,093 Node localhost/127.0.0.1 state jump to normal
INFO 08:42:23,100 Startup completed! Now serving reads.
[root@localhost bin]#
以上、LinuxにCassandraのインストールが完了です。