Cassandra进程在退出时被终止

Cassandra进程在退出时被终止,cassandra,datastax,coreos,Cassandra,Datastax,Coreos,当我使用telnet在CoreOS(tarball)上运行dsc cassandra时,一切都很好。但当我关闭telnet会话时,它会终止进程。如何保持cassandra服务器运行 我试过sudo-bin/cassandra和sudo-bin/cassandra-f 两者都没有帮助 我在其他操作系统中没有问题 Option Description -f Start the cassandra process in foreground. The default is to start as

当我使用telnet在CoreOS(tarball)上运行dsc cassandra时,一切都很好。但当我关闭telnet会话时,它会终止进程。如何保持cassandra服务器运行

我试过sudo-bin/cassandra和sudo-bin/cassandra-f 两者都没有帮助

我在其他操作系统中没有问题

Option  Description
-f  Start the cassandra process in foreground. The default is to start as background process.
-h  Help.
-p filename     Log the process ID in the named file. Useful for stopping Cassandra by killing its PID.
-v  Print the version and exit.
当您使用-f启动cassandra时,它会在前台运行,因此一旦终端关闭,它就会停止。后台进程也是如此。 在telnet会话中运行的任何应用程序都会发生这种情况。 你可以试试
sudo service cassandra start
nohup bin/cassandra
这将使您的应用程序在终端关闭时保持运行

您需要将cassandra作为systemd服务运行,如下所述:

在前台运行
cassandra-f
作为
ExecStart=
命令将允许systemd管理进程的状态(最好是在容器中)


虽然这与您习惯的有点不同,但它将带来一个总体上更稳定的机制,因为您将使用一个init系统,该系统可以理解依赖链、重启和重启行为、日志记录等。

在屏幕或tmux会话中运行该过程。从屏幕会话分离应该允许进程继续运行。

尝试使用nohup,但进程在退出会话时仍然被终止。检查如何在coreos中将其作为服务运行