2012年3月6日火曜日

Eclipse上でCassandraを実行する


EclipseでCassandraを実行するためのメモ。
要Ant, Maven

EclipseにCassandraをロード
1. ソースを展開
2. ant build
3. ant generate-eclipse-files
4. File->Import->Existing Project into Workspace...

Run->Run Configuration...を実行し、Main classに
org.apache.cassandra.thrift.CassandraDaemon
を指定する。

VM argumentsを以下のように指定。

VM arguments:
-ea
アサーションを有効にする
-Xmx96M
最大ヒープを96Mにする
-Dcom.sun.management.jmxremote.port=7199
JMX portを7199にする
-Dcom.sun.management.jmxremote.authenticate=false
JMXのパスワード認証を無効化する
-Dcom.sun.management.jmxremote.ssl=false
JMXのSSLを無効化する
-Dcassandra-foreground=yes
Cassandraをフォアグランドで実行する
-Dlog4j.defaultInitOverride=true
log4j-server.propertiesを読ませるためにデフォルトの初期化手順をスキップ
-Dlog4j.configuration=file:/{作業用ディレクトリ}/conf/log4j-server.properties
log4jの設定ファイルを指定
-Dcassandra.config=file:/{作業用ディレクトリ}/conf/cassandra.yaml
cassandraの設定ファイルを指定

git repositoryを参照している場合、git pullでconf下の設定ファイルも上書きされてしまうので、別の作業用ディレクトリをつくり、confやdataを配置すること。

0 件のコメント:

コメントを投稿