卡桑德拉连接被拒绝

时间:2016-08-30 07:14:27

标签: cassandra

我有安装了CentOS 7的云端服务器。我昨天已经安装了Apache Cassandra 3.7。我昨天能够使用cqlsh访问Cassandra,但今天当我尝试使用cqlsh访问它时,它给出了如下错误:

  

块引用   连接错误:('无法连接到任何服务器',{'127.0.0.1':错误(111,“尝试连接到[('127.0.0.1',9042)]。上次错误:连接被拒绝”)})   块引用

下面是cassandra.log的详细信息

  

块引用

INFO  06:45:53 Initializing system_schema.keyspaces
INFO  06:45:53 Initializing system_schema.tables
INFO  06:45:53 Initializing system_schema.columns
INFO  06:45:53 Initializing system_schema.triggers
INFO  06:45:53 Initializing system_schema.dropped_columns
INFO  06:45:53 Initializing system_schema.views
INFO  06:45:53 Initializing system_schema.types
INFO  06:45:53 Initializing system_schema.functions
INFO  06:45:53 Initializing system_schema.aggregates
INFO  06:45:53 Initializing system_schema.indexes
INFO  06:45:53 Not submitting build tasks for views in keyspace system_schema as storage service is not initialized
ERROR 06:45:54 Failed to create /var/lib/cassandra/data/test/merchant-f0892c606e6611e69252716e565c6453 directory
ERROR 06:45:54 Exiting forcefully due to file system exception on startup, disk failure policy "stop"
org.apache.cassandra.io.FSWriteError: java.io.IOException: Failed to mkdirs /var/lib/cassandra/data/test/merchant-f0892c606e6611e69252716e565c6453
    at org.apache.cassandra.io.util.FileUtils.createDirectory(FileUtils.java:365) ~[apache-cassandra-3.7.0.jar:3.7.0]
    at org.apache.cassandra.db.Directories.<init>(Directories.java:241) ~[apache-cassandra-3.7.0.jar:3.7.0]
    at org.apache.cassandra.db.ColumnFamilyStore.scrubDataDirectories(ColumnFamilyStore.java:601) [apache-cassandra-3.7.0.jar:3.7.0]
    at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:264) [apache-cassandra-3.7.0.jar:3.7.0]
    at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:585) [apache-cassandra-3.7.0.jar:3.7.0]
    at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:714) [apache-cassandra-3.7.0.jar:3.7.0]
Caused by: java.io.IOException: Failed to mkdirs /var/lib/cassandra/data/test/merchant-f0892c606e6611e69252716e565c6453
    ... 6 common frames omitted
  

块引用

我还将listen_address和rpc_address更改为我的本地IP,public_ip和127.0.0.1但是没有连接

由于

2 个答案:

答案 0 :(得分:0)

我认为这是与用户persmission相关的错误。请尝试下面。它也可能是脚本冲突。

sudo chown -R cassandra:cassandra /var/lib/cassandra/data/test

OR

sudo chown -R cassandra:cassandra /var/lib/cassandra/data/


sudo chown -R cassandra:cassandra /var/lib/cassandra/commitlog.

任何方式都尝试以root身份启动cassandra

在关机之前,还要尝试正常关闭cassandra服务。

喜欢..

$ ps auwx | grep cassandra
$ sudo kill pid

OR

sudo service cassandra stop

答案 1 :(得分:0)

非常感谢它只使用了 chown -R cassandra:cassandra / var / lib / cassandra / data /