Error when starting Cassandra prevents launching

China☆狼群 提交于 2019-12-31 01:33:42

问题


I am trying to run Cassandra. But, I am getting this error:

[root@SudeepMangu bin]# ./cassandra -f
xss =  -ea -javaagent:/home/sudeep/apache-cassandra-1.2.5-src/lib/jamm-0.2.5.jar-
XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms930M -Xmx930M -Xmn200M -
XX:+HeapDumpOnOutOfMemoryError -Xss160k

Error occurred during initialization of VM Could not reserve enough space for object heap

I have tried setting JAVA_OPTS to max size with no effect.


回答1:


See my answer here, https://stackoverflow.com/a/14447535/92463 which describes increasing the stack segment size. Edit the conf/cassandra-env.sh configuration script, 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"

I suggest testing values starting from -Xss200k and increasing in 20k increments. I have found that using -Xss280k on Ubuntu servers worked successfully.




回答2:


Probably it's because of the 32bits java version. I changed my JAVA_HOME variable to the 64bits version by following this steps:
1) Hited both "Windows + R" keys and entered: sysdm.cpl
2) On the "System Properties" I pressed the 'Environment variables' button
3) In the textarea "Environment variables" I picked JAVA_HOME and clicked 'Edit'
4.a) In the "Variable Value" I took out the path
(it looks like this: C:\Program Files (x86)\Java\jdk1.8.0_192)
4.b) I Entered the 64bits path instead
it looks like this now: C:\Program Files\Java\jdk1.8.0_73
And that was it. Then I justed watched the cassandra server scipts running through...

And the heap memory problem is gone!




回答3:


There is not enough space for cassandra. You have to change a value inside cassandra-env.sh file

open the cassandra-env.sh file

sudo vi cassandra-env.sh

In the document you will see JVM_OPTS="$JVM_OPTS -Xss180k"

Increase the chunk size between 250 to 300




回答4:


Set stack size of 256K in cassandra-env.sh.



来源:https://stackoverflow.com/questions/16831724/error-when-starting-cassandra-prevents-launching

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!