我想在Centos服務器上構建Casandra項目。我從這裏下載了這個文件。錯誤:無法找到或加載主類,Cassandra
http://apache.bilkent.edu.tr/cassandra/2.0.6/
這裏是README.txt文件
This short guide will walk you through getting a basic one node cluster up
and running, and demonstrate some simple reads and writes.
* tar -zxvf apache-cassandra-$VERSION.tar.gz
* cd apache-cassandra-$VERSION
* sudo mkdir -p /var/log/cassandra
* sudo chown -R `whoami` /var/log/cassandra
* sudo mkdir -p /var/lib/cassandra
* sudo chown -R `whoami` /var/lib/cassandra
Note: The sample configuration files in conf/ determine the file-system
locations Cassandra uses for logging and data storage. You are free to
change these to suit your own environment and adjust the path names
used here accordingly.
Now that we're ready, let's start it up!
* bin/cassandra -f
由於README.txt文件建議我按照這些說明爲適應我的情況(我不是根)。
tar -zxvf apache-cassandra-2.0.6-src.tar.gz
cd apache-cassandra-2.0.6-src
mkdir -p var/log/cassandra
chown -R `whoami` var/log/cassandra
mkdir -p var/lib/cassandra
chown -R `whoami` var/lib/cassandra
因爲我不是在服務器上的根,我無法創建/var
文件夾下我的文件。因此,我在apache-cassandra-2.0.6-src
下創建了新文件夾var
,並將我的lib
和log
文件放在那裏。然後我遵循README.txt文件中的下一條指令。
bin/cassandra -f
然而,無論我嘗試它是不是很好,我總是得到這個錯誤。
Error: Could not find or load main class org.apache.cassandra.service.CassandraDaemon
我該如何解決這個問題?
我的Java版本
java -version
java version "1.7.0_51"
OpenJDK Runtime Environment (rhel-2.4.4.1.el6_5-x86_64 u51-b02)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
編輯: 作爲一個額外的信息了,我想在我的電腦的說明,太。與README.txt文件完全相同,使用sudo
和它工作。
嗯。建議設置'CASSANDRA_HOME'在http://stackoverflow.com/questions/16851308/i-am-getting-this-error-when-i-am-starting-cassandra-server和http://stackoverflow.com/questions/3291474/cassandra-installation-issue help? –
@JasonC我嘗試了你說的,沒有工作。 CLASSPATH = $ CLASSPATH:/ home/pat/to/lib(包括jar文件) – genclik27
CASSANDRA_HOME呢? (順便說一句,'.jar'文件本身應該放在類路徑上,而不是放在它的路徑上;但是不要在這裏做 - 我懷疑正確設置CASSANDRA_HOME會爲你做所有事情,假定'cassandra'是一種根據該環境變量設置類路徑的腳本)。 –