Error: Could not find or load the main class, Cassandra

I am trying to create a Casandra project on a Centos server. I uploaded the file here.

http://apache.bilkent.edu.tr/cassandra/2.0.6/

Here is the README.txt file

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 start it up!

  * bin/cassandra -f

As the README.txt file suggested, I followed these instructions, adapting to my case (I'm not root).

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

Since I am not root on the server, I cannot create my files in a folder /var. So, I created a new folder varunder apache-cassandra-2.0.6-srcand placed there the files liband log. Then I followed the following instructions from the README.txt file.

bin/cassandra -f

However, everything I tried is not good, I always get this error.

Error: Could not find or load main class org.apache.cassandra.service.CassandraDaemon

How can I fix this problem?

My java version

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)

EDIT: . README.txt sudo .

+4
5

, (apache-cassandra-2.0.6-src.tar.gz), , , -, , .

, ; .

, , . , apache-cassandra-2.0.6-bin.tar.gz ( "bin", "src" ) - ). . cassandra.

, , .

:

  • ant ant-optional, .
  • -, ( build.xml ):

    ant release
    
  • ( rat ).
  • build, build/dist.
+11

CASSANDRA_HOME = cassandra

2.0.6 i, .

$ export CASSANDRA_HOME=/usr/local/cassandra/dsc-cassandra-2.0.6
$ /usr/local/cassandra/dsc-cassandra-2.0.6/bin/cassandra


or
$ cd /usr/local/cassandra/dsc-cassandra-2.0.6
$ export CASSANDRA_HOME=
$ bin/cassandra

CASSANDRA_HOME = cassandra-2.0.6. , export cassandra.

+5

cassandra.yaml

commitlog_directory
data_file_directories
saved_caches_directory

, /var/lib...

, , .

0

, cassandra - sudo.

cassandra.yaml

commitlog_directory
data_file_directories
saved_caches_directory
log4j.appender.R.File

tar bin OS env, src.

Export CASSANDRA_HOME=/userspace/cassandra-2.x

.

0

CASSANDRA_HOME . , .

0

Source: https://habr.com/ru/post/1532516/


All Articles