【现象】
显示以下信息,无法启动Cassandra。
The stack size specified is too small, Specify at least 228k
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
【原因】
因为OS和JDK版本的配置,JVM参数的Xss不足,有时无法启动Cassandra。
【条件】
已确认在以下配置时会发生此现象。
OS:
Linux系列的OS
JDK:
Oracle JDK 1.7u40
Oracle JDK 1.7u45
【规避方法】
可以通过更改${cassandra}/conf/cassandra-env.sh中已设置的Xss值来规避。
・Cassandra版本为1.1.4时
■更改前
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.
if startswith "$JVM_VERSION" '1.7.'
then
JVM_OPTS="$JVM_OPTS -Xss160k"
else
JVM_OPTS="$JVM_OPTS -Xss128k"
fi
fi
■更改后
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.
if startswith "$JVM_VERSION" '1.7.'
then
JVM_OPTS="$JVM_OPTS -Xss228k"
else
JVM_OPTS="$JVM_OPTS -Xss128k"
fi
fi
・Cassandra版本为1.1.12时
■更改前
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
■更改后
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 -Xss228k"
fi
-- 适用对象 ----------------------------------------------------------------
iAP/Accel Platform/所有更新版本
--------------------------------------------------------------------------------
FAQID:99
无法启动Cassandra。