Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu 12.04 and cassandra install - +HeapDumpOnOutOfMemoryError -Xss128k

Tags:

cassandra

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
like image 819
Tampa Avatar asked Jul 23 '12 10:07

Tampa


3 Answers

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" 
like image 164
SirYasoKuhl Avatar answered Nov 13 '22 16:11

SirYasoKuhl


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

like image 41
Arthur Avatar answered Nov 13 '22 15:11

Arthur


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!

like image 1
aholbreich Avatar answered Nov 13 '22 16:11

aholbreich