无法使用 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:
如果您无法安装 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屋!