2

我没有太多的 linux 经验,所以我可能遗漏了一些明显的东西。

但是...我正在尝试将 Cassandra nosql 放在 CentOS 上的 chkserv.d 中,以便它在中断时自动重启。我设法把它放在那里,当它坏掉时它被 chkservd 正确识别。我这样说:

root@server [/etc/chkserv.d]# cat cassandra
service[cassandra]=x,x,x,/etc/init.d/cassandra start,cassandra,root

问题是当执行“cassandra start”时,在 cassandra.out 日志中我得到:

 /opt/cassandra/cassandra_home/bin/cassandra: line 141: exec: java: not found

在 cassandra 脚本的第 141 行是:

执行 $NUMACTL "$JAVA" $JVM_OPTS $cassandra_parms -cp "$CLASSPATH" $props "$class" <&- &

并且所有环境变量都正确扩展:

java -ea -javaagent:/opt/cassandra/cassandra_home/bin/../lib/jamhreadPriorities -XX:ThreadPriorityPolicy=42 -Xms400M -Xmx400M -XnOutOfMemoryError -Xss180k -XX:+UseParNewGC -XX:+UseConcMarkSweeemarkEnabled -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=1 -XX:yFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Djava.net.prefe.sun.management.jmxremote.port=7199 -Dcom.sun.management.jmxremon.management.jmxremote.authenticate=false -Dlog4j.configuration=es -Dlog4j.defaultInitOverride=true -Dcassandra-pidfile=/var/runpt/cassandra/cassandra_home/bin/../conf:/opt/cassandra/cassandraasses/main:/opt/cassandra/cassandra_home/bin/../build/classes/thassandra_home/bin/../lib/antlr-3.2.jar:/opt/cassandra/cassandra_e-cassandra-1.1.5.jar:/opt/cassandra/cassandra_home/bin/../lib/atutil-1.1.5.jar:/opt/cassandra/cassandra_home/bin/../lib/apache-5.jar:/opt/cassandra/cassandra_home/bin/../lib/avro-1.4.0-fixes.ssandra_home/bin/../lib/avro-1.4.0-sources-fixes.jar:/opt/cassann/../lib/commons-cli-1.1.jar:/opt/cassandra/cassandra_home/bin/..2.jar:/opt/cassandra/cassandra_home/bin/../lib/commons-lang-2.4assandra_home/bin/../lib/compress-lzf-0.8.4.jar:/opt/cassandra/clib/concurrentlinkedhashmap-lru-1.3.jar:/opt/cassandra/cassandraa-r08.jar:/opt/cassandra/cassandra_home/bin/../lib/high-scale-liandra/cassandra_home/bin/../lib/jackson-core-asl-1.9.2.jar:/opt/ome/bin/../lib/jackson-mapper-asl-1.9.2.jar:/opt/cassandra/cassajamm-0.2.5.jar:/opt/cassandra/cassandra_home/bin/../lib/jline-0.ra/cassandra_home/bin/../lib/json-simple-1.1.jar:/opt/cassandra//lib/libthrift-0.7.0.jar:/opt/cassandra/cassandra_home/bin/../lipt/cassandra/cassandra_home/bin/../lib/metrics-core-2.0.3.jar:/oa_home/bin/../lib/servlet-api-2.5-20081211.jar:/opt/cassandra/caib/slf4j-api-1.6.1.jar:/opt/cassandra/cassandra_home/bin/../lib/ar:/opt/cassandra/cassandra_home/bin/../lib/snakeyaml-1.6.jar:/oa_home/bin/../lib/snappy-java-1.0.4.1.jar:/opt/cassandra/cassandaptree-0.1.jar org.apache.cassandra.thrift.CassandraDaemon

当我手动启动该 cassandra 脚本,或者使用 etc/init.d/cassandra start 启动它时,一切都会正确启动。

百万美元的问题 - 我错过了什么?

谢谢

4

1 回答 1

1

只需要设置 JAVA_HOME 环境变量。现在一切都按预期工作。

$CASSANDRA_HOME/bin/cassandra.in.sh 中未注释的行。

于 2012-09-26T07:18:05.547 回答