启动cassandra作为服务不适用于2.0.5,sudo cassandra -f工程 [英] Starting cassandra as a service does not work for 2.0.5, sudo cassandra -f works
问题描述
当我尝试在ubuntu 12.04(通过Datastax的 dsc20
包安装)作为服务启动cassandra时,如下所示:
When I try to start cassandra on ubuntu 12.04 (installed via Datastax's dsc20
package) as a service as follows :
$ sudo服务cassandra开始
$ sudo service cassandra start
它说
*无法访问Cassandra的pidfile
*could not access pidfile for Cassandra
没有其他消息或日志中的任何内容。
& no other messages or anything in logs.
但是当我尝试以root用户身份运行( sudo cassandra -f
)时, cassandra开始。尝试调试时,我发现当尝试以非root用户身份运行时,我收到以下消息:
But when I try to run as a root user( sudo cassandra -f
) it just works properly & cassandra is started. While trying to debug I found that when trying to run as a non-root user I was getting these messages:
ERROR 17:48:08,432 Exception encountered during startup
java.lang.AssertionError: Directory /var/lib/cassandra/data is not accessible.
..
java.io.FileNotFoundException: /var/log/cassandra/system.log (Permission denied)
..
java.lang.AssertionError: Directory /var/lib/cassandra/data is not accessible.
包装有问题吗?未正确安装/配置由包?
Is there some problem with the packaging ? Not properly installed/ configured by package ??
推荐答案
默认情况下,cassandra服务不会并且不应以root用户身份运行。
By default the cassandra service does not and should not run as root.
我的猜测是你先在前台运行它,它会自动创建/ var / lib / cassandra与root权限,而不是cassandra权限。或者用适当的组和用户选择-R / var / lib / cassandra或者清除目录,然后尝试重新启动服务。
My guess is you ran it in the foreground first, which automatically will create /var/lib/cassandra with root permissions instead of with the cassandra permissions. Either chown -R /var/lib/cassandra with the appropriate group and user or blow away the directory and try starting the service again.
这篇关于启动cassandra作为服务不适用于2.0.5,sudo cassandra -f工程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!