使用 datastax nodejs 驱动程序:'cassandra-driver'
在我的 nodejs 应用程序服务器后端连接到数据库:
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
文件上编辑一些东西吗?如果是这样,是什么?我应该对防火墙做些什么吗?如果是这样,是什么?
我应该传递更多选项
new cassandra.Client({ contactPoints: [ '${azure_vm_ip}' ] })
吗?如果是这样,什么?