6

I am following the instructions for installing cassandra at Install Cassandra

When I installed, I get the below. How to I fix?

service cassandra start
xss =  -ea -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms1001M -Xmx1001M -Xmn100M -XX:+HeapDumpOnOutOfMemoryError -Xss128k

root@i-157-16647-VM:~# service cassandra status
xss =  -ea -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms1001M -Xmx1001M -Xmn100M -XX:+HeapDumpOnOutOfMemoryError -Xss128k
 * Cassandra is not running

I am running on a machine with 2 gigs of RAM. Here is how I install on a bare bones VM.

sudo vi /etc/apt/sources.list
#add sources.list
     deb http://debian.datastax.com/community stable main
     deb http://us.archive.ubuntu.com/ubuntu/ precise main contrib non-free

curl -L http://debian.datastax.com/debian/repo_key | sudo apt-key add -
sudo apt-get update
sudo apt-get install python-cql dsc1.1


root@i-157-16647-VM:~# java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.3) (6b24-1.11.3-1ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

/var/log/cassandra/output.log
Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: i-157-16647-VM: i-157-16647-VM
Service exit with a return value of 1
Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: i-157-16647-VM: i-157-16647-VM
Service exit with a return value of 1
Tampa
  • 75,446
  • 119
  • 278
  • 425
  • I don't understand what the question is. What are you trying to fix? – David Schwartz Jul 23 '12 at 10:46
  • 1
    I cant get cassandra to run on a default install. I assume issue is +HeapDumpOnOutOfMemoryError. I cant understand that cryptic message. – Tampa Jul 23 '12 at 10:49
  • 1
    Your assumption is wrong. That message is just showing you the options passed to cassandra, including an option that causes it to make a heap dump if it encounters an out of memory error. What version of Java did it say you were running when you checked? – David Schwartz Jul 23 '12 at 10:50
  • Added version. Hopefully using this was correct. deb http://us.archive.ubuntu.com/ubuntu/ precise main contrib non-free per the install docs. – Tampa Jul 23 '12 at 10:55
  • Added hostname to /etc/hosts per http://stackoverflow.com/questions/7496640/problem-on-starting-cassandra – Tampa Jul 23 '12 at 15:27
  • And did that fix the problem? – the paul Jul 23 '12 at 22:10

4 Answers4

8

You are running out of allocted memory for the JAVA VM (128k) is too small.

Modify the line below (..."128k"...) to reach a stack size of at least 160k in the file

/opt/cassandra/conf/cassandra-env.sh or /etc/dse/cassandra/cassandra-env.sh

JVM_OPTS="$JVM_OPTS -Xss160k" 
matt b
  • 138,234
  • 66
  • 282
  • 345
SirYasoKuhl
  • 96
  • 1
  • 2
1

In my case doing sudo chown -R cassandra:cassandra /var/lib/cassandra and sudo chown -R cassandra:cassandra /var/log/cassandra helped to start Cassandra. https://issues.apache.org/jira/browse/CASSANDRA-4058#comment-13662604 has more details on what could lead to this situation

Arthur
  • 1,441
  • 1
  • 13
  • 17
1

Simply don't trust cassandra status message like:

  • Cassandra is not running message

Just try

$nodetool -h 127.0.0.1 info

Your Cassandra is maybe Ok!

aholbreich
  • 4,951
  • 2
  • 23
  • 38
0

It is mostly possible due to the JDK. I met similar error with IBM JDK, it works once I replaced the IBM JDK with Oracle JDK.

leon
  • 1