nodejs – cassandra-client错误:所有连接都不健康

当我尝试使用cassandra-client从cassandra检索/更新数据时,我不断收到此错误。

{ [Error: All connections are unhealthy.] connectionInfo: { host: 'localhost', port: 9160, keyspace: 'keyspace1', user: undefined, pass: undefined, use_bigints: false, timeout: 4000, log_time: false, staleThreshold: 10000 } } 

对于这个错误的含义还没有一个线索。

该错误表明您的客户端无法连接到本地主机端口9160上的指定服务器。

由于这是本地主机,你很可能会排除任何防火墙问题。

你可以做什么

1.检查你的服务器是否正在运行

这应该会显示一个或多个进程(除了正在执行的grep进程外

 ps aux | grep "cassandra" 

2.validation端口

 # telnet localhost 9160 Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused 

不好..这将表明你的configuration可能是错误的。 在我的情况下,我根本没有监听端口9160的cassandra服务器(全部运行)

3.检查你的日志文件

默认情况下,casandra写入文件夹/var/log/cassandra/如果服务器有任何问题,那么很可能会有更多可用的信息,甚至可能会显示与您的nodejs客户端相关的问题

4.尝试另一个客户端进行debugging

 http://wiki.apache.org/cassandra/GettingStarted#Step_4:_Using_cassandra-cli