我遇到了nodejs的cassandra驱动程序问题 - helenus。我创建了将记录插入表中的函数循环,我用ab工具调用。问题是10-20插入后驱动程序抛出错误:
这是咖啡代码:
helenus = require 'helenus'
pool = new helenus.ConnectionPool(
hosts: ["mybalancer:9160"]
keyspace: "stats"
timeout: 90000
)
pool.on "error", (err) ->
console.error err.name, err.message
pool.connect (err, keyspace) ->
if err
throw (err)
else
vals = [uuid.v4(), uuid.v4()]
#insert_statement = "INSERT INTO test2 (id, name) values(%s, %s)"
console.log(vals)
pool.cql insert_statement, vals, (err, results) ->
console.log err, results
这是错误:
/home/udev/development/project/U/hubber/app/controllers/event_logger_cassandra.js:98
throw err;
^
HelenusNoAvailableNodesException: Could Not Connect To Any Nodes
at replyNotAvailable (/home/udev/development/project/U/hubber/node_modules/helenus/lib/pool.js:16:25)
at onConnect (/home/udev/development/project/U/hubber/node_modules/helenus/lib/pool.js:98:9)
at /home/udev/development/project/U/hubber/node_modules/helenus/lib/pool.js:120:7
at null.<anonymous> (/home/udev/development/project/U/hubber/node_modules/helenus/lib/connection.js:199:5)
at EventEmitter.emit (events.js:95:17)
at Socket.<anonymous> (/home/udev/development/project/U/hubber/node_modules/helenus/node_modules/helenus-thrift/lib/thrift/connection.js:56:10)
at Socket.EventEmitter.emit (events.js:95:17)
at net.js:830:16
at process._tickCallback (node.js:415:13)
我在负载均衡器后面有三个节点(亚马逊上的大型服务器)的cassandra集群。 我在服务器上有监视器,节点总是运行正常。
我在这里缺少什么?
感谢。