我刚在服务器上安装了Cassandra
Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2+deb7u2 x86_64 GNU/Linux
按照DataStax上的说明进行操作。建议使用Init。
启动Cassandra$ sudo service cassandra start (dies)
但是,我的过程会在一段时间后死掉。但奇怪的是,我可以通过直接运行Cassandra而没有任何问题来启动它。
$ cassandra (no problem!)
我检查了/ var / log / cassandra中的Cassandra日志,但没有错误。我做错了什么?
INFO [main] 2015-03-04 08:24:25,759 CassandraDaemon.java (line 135) Logging initialized
INFO [main] 2015-03-04 08:24:25,819 YamlConfigurationLoader.java (line 80) Loading settings from file:/etc/cassandra/cassandra.yaml
INFO [main] 2015-03-04 08:24:26,426 DatabaseDescriptor.java (line 143) Data files directories: [/var/lib/cassandra/data]
INFO [main] 2015-03-04 08:24:26,428 DatabaseDescriptor.java (line 144) Commit log directory: /var/lib/cassandra/commitlog
INFO [main] 2015-03-04 08:24:26,428 DatabaseDescriptor.java (line 184) DiskAccessMode 'auto' determined to be mmap, indexAccessMode is mmap
INFO [main] 2015-03-04 08:24:26,428 DatabaseDescriptor.java (line 198) disk_failure_policy is stop
INFO [main] 2015-03-04 08:24:26,428 DatabaseDescriptor.java (line 199) commit_failure_policy is stop
INFO [main] 2015-03-04 08:24:26,438 DatabaseDescriptor.java (line 269) Global memtable threshold is enabled at 29MB
INFO [main] 2015-03-04 08:24:26,652 DatabaseDescriptor.java (line 408) Not using multi-threaded compaction
INFO [main] 2015-03-04 08:24:27,052 YamlConfigurationLoader.java (line 80) Loading settings from file:/etc/cassandra/cassandra.yaml
INFO [main] 2015-03-04 08:24:27,080 YamlConfigurationLoader.java (line 80) Loading settings from file:/etc/cassandra/cassandra.yaml
INFO [main] 2015-03-04 08:24:27,100 CassandraDaemon.java (line 160) JVM vendor/version: OpenJDK 64-Bit Server VM/1.7.0_75
WARN [main] 2015-03-04 08:24:27,100 CassandraDaemon.java (line 165) OpenJDK is not recommended. Please upgrade to the newest Oracle Java release
INFO [main] 2015-03-04 08:24:27,101 CassandraDaemon.java (line 188) Heap size: 123731968/123731968
INFO [main] 2015-03-04 08:24:27,101 CassandraDaemon.java (line 190) Code Cache Non-heap memory: init = 2555904(2496K) used = 651968(636K) committed = 2555904(2496K) max = 50331648(49152K)
INFO [main] 2015-03-04 08:24:27,102 CassandraDaemon.java (line 190) Eden Space Heap memory: init = 83886080(81920K) used = 64290696(62783K) committed = 83886080(81920K) max = 83886080(81920K)
INFO [main] 2015-03-04 08:24:27,107 CassandraDaemon.java (line 190) Survivor Space Heap memory: init = 10485760(10240K) used = 0(0K) committed = 10485760(10240K) max = 10485760(10240K)
INFO [main] 2015-03-04 08:24:27,107 CassandraDaemon.java (line 190) CMS Old Gen Heap memory: init = 29360128(28672K) used = 0(0K) committed = 29360128(28672K) max = 29360128(28672K)
INFO [main] 2015-03-04 08:24:27,108 CassandraDaemon.java (line 190) CMS Perm Gen Non-heap memory: init = 21757952(21248K) used = 15079368(14725K) committed = 21757952(21248K) max = 174063616(169984K)
INFO [main] 2015-03-04 08:24:27,108 CassandraDaemon.java (line 191) Classpath: /etc/cassandra:/usr/share/cassandra/lib/antlr-3.2.jar:/usr/share/cassandra/lib/commons-cli-1.1.jar:/usr/share/cassandra/lib/commons-codec-1.2.jar:/usr/share/cassandra/lib/commons-lang3-3.1.jar:/usr/share/cassandra/lib/compress-lzf-0.8.4.jar:/usr/share/cassandra/lib/concurrentlinkedhashmap-lru-1.3.jar:/usr/share/cassandra/lib/disruptor-3.0.1.jar:/usr/share/cassandra/lib/guava-15.0.jar:/usr/share/cassandra/lib/high-scale-lib-1.1.2.jar:/usr/share/cassandra/lib/jackson-core-asl-1.9.2.jar:/usr/share/cassandra/lib/jackson-mapper-asl-1.9.2.jar:/usr/share/cassandra/lib/jamm-0.2.5.jar:/usr/share/cassandra/lib/jbcrypt-0.3m.jar:/usr/share/cassandra/lib/jline-1.0.jar:/usr/share/cassandra/lib/json-simple-1.1.jar:/usr/share/cassandra/lib/libthrift-0.9.1.jar:/usr/share/cassandra/lib/log4j-1.2.16.jar:/usr/share/cassandra/lib/lz4-1.2.0.jar:/usr/share/cassandra/lib/metrics-core-2.2.0.jar:/usr/share/cassandra/lib/netty-3.6.6.Final.jar:/usr/share/cassandra/lib/reporter-config-2.1.0.jar:/usr/share/cassandra/lib/servlet-api-2.5-20081211.jar:/usr/share/cassandra/lib/slf4j-api-1.7.2.jar:/usr/share/cassandra/lib/slf4j-log4j12-1.7.2.jar:/usr/share/cassandra/lib/snakeyaml-1.11.jar:/usr/share/cassandra/lib/snappy-java-1.0.5.jar:/usr/share/cassandra/lib/snaptree-0.1.jar:/usr/share/cassandra/lib/super-csv-2.1.0.jar:/usr/share/cassandra/lib/thrift-server-0.3.7.jar:/usr/share/cassandra/apache-cassandra-2.0.12.jar:/usr/share/cassandra/apache-cassandra-thrift-2.0.12.jar:/usr/share/cassandra/apache-cassandra.jar:/usr/share/cassandra/stress.jar:/usr/share/java/jna.jar::/usr/share/cassandra/lib/jamm-0.2.5.jar:/usr/share/cassandra/lib/jamm-0.2.5.jar
system.log (END)
答案 0 :(得分:0)
尝试从以下位置更改init脚本的头部:
#! /bin/sh
为:
#! /bin/sh -x
然后通过init脚本重启服务(/etc/init.d/cassandra restart)并检查输出,可能有错误
答案 1 :(得分:0)
我遇到了这个问题,所以即使这个问题确实很老,也要写下这个解决方案。
我已经修改了cassandra.yaml文件(更新了端口和一些内容),然后该服务便无法启动。它始终显示活动(退出)状态,并且任何日志中都没有任何内容。
事实证明,该服务需要强制重新加载一次,以确保重新读取所有配置文件。
sudo service cassandra force-reload
此后,您应该能够使用service或systemctl照常控制服务。
sudo service cassandra status
sudo systemctl status cassandra
sudo systemctl stop cassandra
sudo systemctl start cassandra
sudo systemctl restart cassandra