gpt4 book ai didi

java - 无法启动 Cassandra

转载 作者:行者123 更新时间:2023-12-04 08:35:43 27 4
gpt4 key购买 nike

我正在尝试运行 cqlsh 以连接到 cassandra 并收到以下错误消息。
a) cqlsh 运行时出错:

Connection error: ('Unable to connect to any servers', {'127.0.0.1:9042': error(61, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})
b) 运行 cassandra 后的错误消息:
Exception (java.lang.ExceptionInInitializerError) encountered during startup: null
java.lang.ExceptionInInitializerError
at org.apache.cassandra.db.SystemKeyspace.checkHealth(SystemKeyspace.java:709)
at org.apache.cassandra.service.StartupChecks$9.execute(StartupChecks.java:351)
at org.apache.cassandra.service.StartupChecks.verify(StartupChecks.java:109)
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:188)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:607)
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:717)
Caused by: java.lang.IllegalArgumentException: Bad configuration; unable to start server: At least one DataFileDirectory must be specified
at org.apache.cassandra.config.DatabaseDescriptor.createAllDirectories(DatabaseDescriptor.java:846)
at org.apache.cassandra.db.Keyspace.<clinit>(Keyspace.java:66)
... 6 more
ERROR 00:27:05 Exception encountered during startup
java.lang.ExceptionInInitializerError: null
at org.apache.cassandra.db.SystemKeyspace.checkHealth(SystemKeyspace.java:709) ~[apache-cassandra-2.2.17.jar:2.2.17]
at org.apache.cassandra.service.StartupChecks$9.execute(StartupChecks.java:351) ~[apache-cassandra-2.2.17.jar:2.2.17]
at org.apache.cassandra.service.StartupChecks.verify(StartupChecks.java:109) ~[apache-cassandra-2.2.17.jar:2.2.17]
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:188) [apache-cassandra-2.2.17.jar:2.2.17]
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:607) [apache-cassandra-2.2.17.jar:2.2.17]
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:717) [apache-cassandra-2.2.17.jar:2.2.17]
Caused by: java.lang.IllegalArgumentException: Bad configuration; unable to start server: At least one DataFileDirectory must be specified
at org.apache.cassandra.config.DatabaseDescriptor.createAllDirectories(DatabaseDescriptor.java:846) ~[apache-cassandra-2.2.17.jar:2.2.17]
at org.apache.cassandra.db.Keyspace.<clinit>(Keyspace.java:66) ~[apache-cassandra-2.2.17.jar:2.2.17]
... 6 common frames omitted
c) brew status 显示运行 cassandra 实例时出错:
Name          Status  User   Plist
cassandra@2.2 error /Users/john/Library/LaunchAgents/homebrew.mxcl.cassandra@2.2.plist
rabbitmq stopped
redis started /Users/john/Library/LaunchAgents/homebrew.mxcl.redis.plist
tomcat@7 stopped
任何人都可以帮助解决这个问题吗?

最佳答案

这个错误是从 here 抛出的- 这意味着您没有配置选项 data_file_directories那个specifies Cassandra 需要存储数据的地方,看起来是这样的 $CASSANDRA_HOME未设置。
打开 cassandra.yaml文件,取消注释 data_file_directories配置选项和下一行,并指向 Cassandra 可以写入数据而不是默认的目录 /var/lib/cassandra/data .您很可能还需要指定其他参数,例如 commitlog_directory , hints_directory , 和 saved_caches_directory .

关于java - 无法启动 Cassandra,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64813888/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com