【发布时间】:2015-06-16 17:15:00
【问题描述】:
我在 Windows 上设置了 Cassandra 并收到了几个问题:
它正在工作,但仅限于本地。怎么改?
一些解释:
要运行 cassandra,我正在运行 cassandra.bat 文件(来自 C:\Cassandra\bin)。 它显示了一些信息,但也显示了这一点:
Starting listening for CQL client on localhost/127.0.0.1:9042
Binding thrift service to localhost/127.0.0.1:9060
Listhening for thrift clients...
据我了解,这意味着 casssandra 正在本地运行。
在我的应用程序中,我有第二个代码:
using (var cluster = Cluster.Builder().AddContactPoint("localhost").Build())
{
using (var session = cluster.Connect())
{
session.CreateKeyspaceIfNotExists("autoparks");
session.ChangeKeyspace("autoparks");
session.GetTable<tvehicle>().CreateIfNotExists();
session.GetTable<tvehicletype>().CreateIfNotExists();
session.GetTable<tdriver>().CreateIfNotExists();
session.GetTable<tfirma>().CreateIfNotExists();
}
}
我的问题是现在我需要从另一台计算机上运行我的应用程序,并以某种方式访问运行 cassandra 的计算机。
我读到我需要在防火墙中打开几个端口:9042 和 9160。但据我了解,我还需要将 localhost 更改为... 到什么?它应该是什么样子?我还应该为它创建一些 VPN 连接吗?
请原谅我的愚蠢问题,但这对我来说真的很难。
【问题讨论】:
标签: windows cassandra vpn nosql