我正在使用apache cassandra服务器。经过一段时间后,我的cassandra服务停止了。当我尝试使用centOS7使用“ service cassandra status”检查其状态时,它显示以下日志
[centos@ip-172-31-24-101 routes]$ service cassandra status
cassandra.service - LSB: distributed storage system for structured data
Loaded: loaded (/etc/rc.d/init.d/cassandra; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2018-12-31 10:26:13 UTC; 34min ago
Docs: man:systemd-sysv-generator(8)
Main PID: 2078 (code=killed, signal=KILL)
Dec 31 05:12:46 ip-172-31-24-101.ap-south-1.compute.internal su[781]: (to cassandra) root on none
Dec 31 05:12:49 ip-172-31-24-101.ap-south-1.compute.internal cassandra[761]: Starting Cassandra: OK
Dec 31 05:12:49 ip-172-31-24-101.ap-south-1.compute.internal systemd[1]: Started LSB: distributed storage system for structured data.
Dec 31 10:25:46 ip-172-31-24-101.ap-south-1.compute.internal systemd[1]: cassandra.service: main process exited, code=killed, s...KILL
Dec 31 10:25:47 ip-172-31-24-101.ap-south-1.compute.internal su[15760]: (to cassandra) root on none
Dec 31 10:25:47 ip-172-31-24-101.ap-south-1.compute.internal cassandra[15746]: Shutdown Cassandra: bash: line 0: kill: (2078) - ...ess
Dec 31 10:26:13 ip-172-31-24-101.ap-south-1.compute.internal cassandra[15746]: ERROR: could not stop cassandra
Dec 31 10:26:13 ip-172-31-24-101.ap-south-1.compute.internal systemd[1]: cassandra.service: control process exited, code=exited...us=1
Dec 31 10:26:13 ip-172-31-24-101.ap-south-1.compute.internal systemd[1]: Unit cassandra.service entered failed state.
Dec 31 10:26:13 ip-172-31-24-101.ap-south-1.compute.internal systemd[1]: cassandra.service failed."
我如何找出Cassandra的问题所在?为什么会崩溃?
答案 0 :(得分:1)
被SIGKILL杀死的进程通常是Linux的“ OOM Killer”的结果-当内存不足时,该进程将杀死进程(例如,参见 https://unix.stackexchange.com/questions/136291/will-linux-start-killing-my-processes-without-asking-me-if-memory-gets-short/136294,了解有关OOM Killer的更多详细信息。
这可能表明您为Cassandra分配了过多的内存(用于堆和堆),没有足够的交换空间,或两者都没有。如果是杀死了Cassandra的OOM杀手,则应该能够在通常的位置(dmesg,/ var / log / messages,journalctl,取决于您的分布)中找到日志消息。消息如下所示:
[ 54.125380] Out of memory: Kill process 8320 (cassandra) score 324 or sacrifice child [ 54.125382] Killed process 8320 (cassandra) total-vm:1309660kB, anon-rss:1287796kB, file-rss:76kB
答案 1 :(得分:0)
我建议您查看一下Cassandra进程的system.log,因为它可以指出问题所在。取决于是从软件包中安装C *还是从tarball中安装C *,这取决于它的位置。软件包安装的默认值为/ var / log / cassandra,而tarball的默认值为install_directory / log / cassandra(对此不乐观)。