Cassandra启动问题

发布于 2024-11-18 10:24:48 字数 446 浏览 3 评论 0原文

我在启动 Cassandra 时遇到问题。以下是我尝试发出启动命令时的终端输出:

root@gestion:~# cassandra -f
线程“main”中的异常 java.lang.ExceptionInInitializerError 引起的原因: java.lang.RuntimeException:无法弄清楚 log4j 配置。 在 org.apache.cassandra.service.AbstractCassandraDaemon。(AbstractCassandraDaemon.java:75) 找不到主类: org.apache.cassandra.thrift.CassandraDaemon。
程序将退出。

我导出了 JAVA_HOME 路径。我使用的是 10.04 Lucid 机器。有人可以帮我吗?

I have problems starting Cassandra. The follow is my terminal output when I try to issue a start command:

root@gestion:~# cassandra -f
Exception in thread "main"
java.lang.ExceptionInInitializerError Caused by:
java.lang.RuntimeException: Couldn't figure out log4j configuration.
at
org.apache.cassandra.service.AbstractCassandraDaemon.(AbstractCassandraDaemon.java:75)
Could not find the main class:
org.apache.cassandra.thrift.CassandraDaemon.
Program will exit.

I exported the JAVA_HOME path. I am on an 10.04 Lucid machine. Can anyone please help me?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

标点 2024-11-25 10:24:48

实际上,问题是 cassandra 无法启动,因为它在其配置目录中找不到名为“log4j-server.properties”的文件,要解决您遇到的问题,无需再次重新安装,只需执行以下操作要解决此问题:

1) 从 这里

2)解压:

$ tar -xzvf apache-cassandra-1.2.5.tar.bin.gz 

3)检查cassandra的配置路径在哪里。您可以从名为“/usr/share/cassandra/cassandra.in.sh”的文件中获取配置路径,查看名为“CASSANDRA_CONF”的密钥。

$ gedit /usr/share/cassandra/cassandra.in.sh

4) 从名为“conf”的目录中手动复制解压包(步骤 2)中缺少的文件

$ sudo cp extracted_cassandra/conf/cassandra.yaml /etc/cassandra

$ sudo cp extracted_cassandra/conf/log4j-server.properties /etc/cassandra

提示:

了解更多信息。如何安装 cassandra debian 软件包,请检查这个
欲了解更多信息。如何从存储库安装 cassandra,请检查

如果您想重新安装它,只需执行以下操作:

$ sudo apt-get remove cassandra 

$ sudo apt-get install cassandra

Actually the issue is that cassandra could not start up as it is not finding the file named "log4j-server.properties" in its configuration directory, to resolve the issue you have there, no need to reinstall it again but instead simply do the following to resolve the issue:

1) Download the tarball file from here.

2) Extract it:

$ tar -xzvf apache-cassandra-1.2.5.tar.bin.gz 

3) Check where is the configuration path of cassandra. you could get the config path from file named "/usr/share/cassandra/cassandra.in.sh", check out the key named "CASSANDRA_CONF".

$ gedit /usr/share/cassandra/cassandra.in.sh

4) copy the missing files manually from the extracted package (step 2) from a directory named "conf"

$ sudo cp extracted_cassandra/conf/cassandra.yaml /etc/cassandra

$ sudo cp extracted_cassandra/conf/log4j-server.properties /etc/cassandra

Hints:

For more info. how to install cassandra debian package, check this
For more info. how to install cassandra from their repository, check this

If you want to re-install it, simply you could do the following:

$ sudo apt-get remove cassandra 

$ sudo apt-get install cassandra
太阳哥哥 2024-11-25 10:24:48

我认为错误位于 $CASSANDRA_HOME/conf/log4j-server.properties 文件中。也许您定义了一个不存在的附加程序(log4j.appender.R)

I think the error is in the $CASSANDRA_HOME/conf/log4j-server.properties file. Maybe you have defined an appender which does not exist (log4j.appender.R)

鱼忆七猫命九 2024-11-25 10:24:48

请参阅https://issues.apache.org/jira/browse/CASSANDRA-2383 有关 log4j 初始化的一些讨论。

“无法弄清楚 log4j 配置”意味着 Cassandra 无法将您的 -Dlog4j.configuration 属性转换为有效的 log4j 配置文件名。这并不意味着 log4j 配置文件本身有错误。

See https://issues.apache.org/jira/browse/CASSANDRA-2383 for some discussion of the log4j initialization.

"Couldn't figure out log4j configuration" means that Cassandra couldn't convert your -Dlog4j.configuration property to a valid log4j config filename. It doesn't mean there's an error in the log4j config file itself.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文