Cassandra VirtualBox错误无法建立连接,因为目标机主动拒绝了它

发布于 2025-01-28 11:55:36 字数 731 浏览 3 评论 0 原文

我在VirtualBox上安装了Cassandra,并使用地址连接到C#应用程序,正确的数据中心名称,但仍然会出现错误。我想念和需要检查的东西吗?

    public ISession session;
    private string IP = "127.0.0.1";
    private string Datacenter = "datacenter1";
    public ISession getConnect()
    {
        return session = Cluster.Builder()
                             .AddContactPoints(IP)
                             .WithPort(9042)
                             .WithLoadBalancingPolicy(new DCAwareRoundRobinPolicy(Datacenter))
                             .Build()
                             .Connect();
    }

I have cassandra install on the virtualbox and connect to c# application with the address, datacenter name correctly but still get the error. Is there anything that I miss and neede to be checked?
enter image description here

    public ISession session;
    private string IP = "127.0.0.1";
    private string Datacenter = "datacenter1";
    public ISession getConnect()
    {
        return session = Cluster.Builder()
                             .AddContactPoints(IP)
                             .WithPort(9042)
                             .WithLoadBalancingPolicy(new DCAwareRoundRobinPolicy(Datacenter))
                             .Build()
                             .Connect();
    }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你与昨日 2025-02-04 11:55:36

在Cassandra正在侦听的VirtualBox中检查:NetStat -TLNP | GREP 9042

尝试使用telnet建立连接:telnet< ip-addr> 9042

更多详细信息:

Check in virtualbox where Cassandra is listening: netstat -tlnp | grep 9042

try establish a connection using telnet: telnet <ip-addr> 9042

more detail here:
https://community.datastax.com/questions/9242/native-transport-port-open-or-not.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文