无法使用bin / cassandra启动Cassandra db [英] Cannot start Cassandra db using bin/cassandra
问题描述
我有Ubuntu 12.04与cassandra 1.1.3(tarball安装),当我尝试启动cassandra,我得到以下:
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$
根据cassandra文档,输出看起来不像预期:
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.
那么,问题是什么?
推荐答案
问题可能是由于使用OpenJDK,如Cassandra错误报告所述,但,请参阅这里的评论在Sun / Oracle上出现此问题,其他JVM:
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
如果无法安装Oracle JVM ,然后尝试更改 conf / cassandra-env.sh
配置脚本中的堆栈大小。查找以下部分,在第185行附近,将 -Xss180k
更改为更高的值。
If you cannot install the Oracle JVM, then try changing the stack size in the conf/cassandra-env.sh
configuration script. Look for the following section, at around line 185, and change the -Xss180k
to 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"
我在Rackspace和Amazon上的Ubuntu服务器上测试安装时已经成功使用了280k。
I have used 280k successfully when testing installations on Ubuntu servers at Rackspace and Amazon.
报告在下面的评论,我建议增加堆栈大小以20k增量,从 -Xss200k
,直到Cassandra正确启动。请注意,也可以删除此选项并使用每个线程的默认堆栈大小,但请注意这将对内存消耗造成的影响。
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.
这篇关于无法使用bin / cassandra启动Cassandra db的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!