使用datastax nodejs驱动程序:System.IO.File.ReadAllLines
在我的nodejs app服务器后端连接到数据库:
'cassandra-driver'
输出日志:
const cassandra = require('cassandra-driver');
const client = new cassandra.Client({ contactPoints: [ '${azure_vm_ip}' ] });
问题:
我应该在默认的{ [Error: All host(s) tried for query failed. First host tried, azure_vm_ip:9042: Error: Connection timeout. See innerErrors.]
innerErrors:
{ 'azure_vm_ip:9042':
{ [Error: Connection timeout]
message: 'Connection timeout',
info: 'Cassandra Driver Error' } },
info: 'Represents an error when a query cannot be performed because no host is available or could be reached by the driver.',
message: 'All host(s) tried for query failed. First host tried, azure_vm_ip:9042: Error: Connection timeout. See innerErrors.' }
文件上编辑一些内容吗?如果
那么,什么?
我应该用防火墙做些什么吗?如果是,那该怎么办?
我应该在cassandra.yaml
传递更多选项吗?如果是这样,什么?
答案 0 :(得分:0)
确保在NSG中为9042端口设置了规则。还要检查VM内的同一端口是否处于侦听模式。