0
當我使用sudo ./cassandra -f -p pid.txt
運行Cassandra時,Cassandra運行正常,輸出Listening for thrift clients...
,但未創建文件pid.txt
。使用-p在前臺運行Cassandra不會創建pid文件?
如果沒有-f
選項,則按預期創建pid文件。這是正常的行爲嗎?
當我使用sudo ./cassandra -f -p pid.txt
運行Cassandra時,Cassandra運行正常,輸出Listening for thrift clients...
,但未創建文件pid.txt
。使用-p在前臺運行Cassandra不會創建pid文件?
如果沒有-f
選項,則按預期創建pid文件。這是正常的行爲嗎?
是的。這是正常行爲如預期:
https://github.com/apache/cassandra/blob/trunk/bin/cassandra#L142
PID文件通常用於通過監視過程和初始化腳本。當你在前臺啓動時,進程擁有pid文件是沒有意義的,因爲你可以通過使用Ctrl-C來終止它。