Cannot start Cassandra db using bin/cassandra

13 down vote favorite
1

I have Ubuntu 12.04 with cassandra 1.1.3 (tarball installation), When I try to start cassandra, I get the following:

user@ubuntu:~/apache-cassandra-1.1.3/bin$ sudo ./cassandra -f
xss =  -ea -javaagent:./../lib/jamm-0.2.5.jar -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms4G -Xmx4G -Xmn800M -XX:    +HeapDumpOnOutOfMemoryError -Xss128k
user@ubuntu:~/apache-cassandra-1.1.3/bin$

According to cassandra documentation, the output does not look as expected:

The service should start in the foreground and log gratuitously to 
standard-out. Assuming you don't see messages with scary words like  
"error", or "fatal", or anything that looks like a Java stack trace,  
then chances are you've succeeded.

So, what is the problem?

cassandra
share | improve this question
edited Jun 17 at 17:43
Eric Leschinski
6,363 4 32 45
asked Aug 10 '12 at 12:11
Ababneh A
327 2 11


Does your database contain any data? Or is this a new install? –  BryceAtNetwork23 Aug 10 '12 at 13:00
1  
It is a new install, previously, I installed the ubuntu packaged cassandra 1.0 using apt-get, and it used to start without problems. Anyway, 2 days later, I uninstalled cassandra 1.0 by removing the folders manually, and installed the tarball for cassandra 1.1 (following the instructions in the official website) –  Ababneh A Aug 10 '12 at 13:39

Correction: I followed the instructions in the README file, not form the website –  Ababneh A Aug 10 '12 at 14:01

Did your cassandra.yaml remain the same? Is it referencing the correct data_file_directories? If so, try pointing it to a new (empty) directory and see if it comes-up. –  BryceAtNetwork23 Aug 10 '12 at 19:08

I checked cassandra.yaml, and it was referencing an old directory that does not exist anymore (probably related to the previous installation). I set the following: data_file_directories: /db/cassandra/data, and also: commitlog_directory: /db/cassandra/commitlog, and, saved_caches_directory: /db/cassandra/commitlog. I tried agian, but cassandra did not come up, and the terminal returned the same error. –  Ababneh A Aug 10 '12 at 21:11
show 1 more comment

2 Answers

active oldest votes
up vote 16 down vote

The problem may be caused by using OpenJDK, as described in a Cassandra bug report but, see the comments here for occurrences of this issue on Sun/Oracle and other JVMs:

  • https://issues.apache.org/jira/browse/CASSANDRA-2441

If you cannot install the Oracle JVM, then try changing the stack size in theconf/cassandra-env.shconfiguration script. Look for the following section, at around line 185, and change the-Xss180kto a higher value.

if [ "`uname`" = "Linux" ] ; then
  # reduce the per-thread stack size to minimize the impact of Thrift
  # thread-per-client.  (Best practice is for client connections to
  # be pooled anyway.) Only do so on Linux where it is known to be
  # supported.
  # u34 and greater need 180k
  JVM_OPTS="$JVM_OPTS -Xss180k"
fi
echo "xss = $JVM_OPTS"

I have used 280k successfully when testing installations on Ubuntu servers at Rackspace and Amazon.

Based on reports in the comments below, I would either suggest increasing the stack size in 20k increments, starting with-Xss200k, until Cassandra starts properly. Note that it is also possible to remove this option and use the default stack size per thread, but be aware of the impact this will have on memory consumption.

share | improve this answer
edited Aug 19 at 21:34
Beryllium
4,135 3 6 25
answered Jan 21 at 21:28
grkvlt
732 4 13

3  
Using a 256k stack-size fixes this problem on Red Hat 6. –  Raedwald Feb 28 at 15:48
1  
I ran into this problem with the Sun 1.7.0_15 JDK as well, and setting-Xss280kfixed it. So this issue isn't limited to OpenJDK. –  Josh Glover Jul 8 at 13:59

I got away with 210k on Amazon Linux 64bit AMI (OpenJDK 1.6) –  delitescere Jul 10 at 2:16

280k fixed this for me on java version "1.6.0_27" OpenJDK Runtime Environment (IcedTea6 1.12.5) (6b27-1.12.5-0ubuntu0.12.04.1) –  Steve Swinsburg Jul 25 at 2:41

Brilliant, worked perfectly setting to -Xss280k. Thank you. –  xetur Aug 31 at 18:40
up vote 1 down vote

This is most likely caused by attempting to run under OpenJDK 1.6, which causes a segmentation fault under Ubuntu/Debian. The seg fault is hidden because of the way the shell script executes the process. You can test for this problem by modifying $CASSANDRA_HOME/bin/cassandra as follows:

Change this line:

exec $NUMACTL "$JAVA" $JVM_OPTS $cassandra_parms -cp "$CLASSPATH" $props "$class"

to this:

echo $NUMACTL "$JAVA" $JVM_OPTS $cassandra_parms -cp "$CLASSPATH" $props "$class"

Then runbin/cassandra -fand copy the resulting java command. Run this directly to see if it produces the segmentation fault. If this is your problem, you need to switch to the Sun or IBM JDK, or alternatively you can upgrade to OpenJDK 1.7.

share | improve this answer
answered Oct 17 '12 at 19:25
rs_atl
2,787 4 15


On Red Hat, I get a similar outcome but the O/S also reports "Segmentation fault (core dumped)". –  Raedwald Feb 28 at 14:00
2  
This is not restricted to OpenJDK 1.6 -- increasing the stack size resolves the problem. –  delitescere Jul 10 at

你可能感兴趣的:(cassandra)