Moein Hosseini
Moein Hosseini

Reputation: 4383

Can't run Cassandra on Ubuntu

I have installed Cassandra on ubuntu 12.04 .

But when I start it, the following error occurrs:

cassandra -f xss = -ea -javaagent:/usr/share/cassandra/lib/jamm-0.2.5.jar -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms1493M -Xmx1493M -Xmn373M -Xss160k Segmentation fault (core dumped)

I did the following to solve it but nothing happens: in /etc/conf/cassandra-env.sh I commented the following lines:

JVM_OPTS="$JVM_OPTS -XX:+HeapDumpOnOutOfMemoryError"

# set jvm HeapDumpPath with CASSANDRA_HEAPDUMP_DIR
if [ "x$CASSANDRA_HEAPDUMP_DIR" != "x" ]; then
    JVM_OPTS="$JVM_OPTS -XX:HeapDumpPath=$CASSANDRA_HEAPDUMP_DIR/cassandra-`date +%s`-pid$$.hprof"
fi

and ran the following commands on shell as root:

unset IBM_HEAPDUMP
unset IBM_HEAP_DUMP

How should I solve it?

Upvotes: 3

Views: 4449

Answers (2)

grkvlt
grkvlt

Reputation: 2627

See my answer here, https://stackoverflow.com/a/14447535/92463 which describes increasing the stack segment size to enable Cassandra on OpenJDK.

Upvotes: 1

Anentropic
Anentropic

Reputation: 33823

I had same problem, and found the following:

$ cassandra -f
xss =  -ea -javaagent:/usr/share/cassandra/lib/jamm-0.2.5.jar -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms826M -Xmx826M -Xmn100M -XX:+HeapDumpOnOutOfMemoryError -Xss180k
Segmentation fault (core dumped)

ok, how about:

$ sudo cassandra -f
xss =  -ea -javaagent:/usr/share/cassandra/lib/jamm-0.2.5.jar -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms826M -Xmx826M -Xmn100M -XX:+HeapDumpOnOutOfMemoryError -Xss180k

..no Segmentation Fault this time, and maybe the 'xss' part is just an obscure debugging message in that case?

$ ps -Af | grep cass
ubuntu    5687   959  0 15:42 pts/0    00:00:00 grep --color=auto cass

hmm, no processes started though.

What did work for me is:

$ sudo /etc/init.d/cassandra start
xss =  -ea -javaagent:/usr/share/cassandra/lib/jamm-0.2.5.jar -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms826M -Xmx826M -Xmn100M -XX:+HeapDumpOnOutOfMemoryError -Xss180k
$ ps -Af | grep cass
root      5789     1  0 15:45 ?        00:00:00 jsvc.exec -user cassandra -home [blah blah blah] org.apache.cassandra.thrift.CassandraDaemon
106       5791  5789 13 15:45 ?        00:00:06 jsvc.exec -user cassandra -home [blah blah blah] org.apache.cassandra.thrift.CassandraDaemon

...though I realise that's not running it in the foreground like cassandra -f is supposed to.

I eventually gave up and started over, avoiding manual installation by just booting an EC2 instance from the DataStax Community AMI: https://aws.amazon.com/amis/datastax-auto-clustering-ami-2-2

But... I just found what looks like the real answer here: https://stackoverflow.com/a/12941854/202168

Upvotes: 5

Related Questions