DataStax Devcenter 无法连接到远程 cassandra 数据库 [英] DataStax Devcenter fails to connect to the remote cassandra database

查看:34
本文介绍了DataStax Devcenter 无法连接到远程 cassandra 数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

操作系统:CentOS 6.4(服务器)

OS: CentOS 6.4 (server)

我已在我的服务器中成功安装 (yum install dsc20) cassandra 数据库层,并且可以使用 CQL SHel (cqlsh) 连接到它.但我需要使用 DataStax 的 DevCenter 软件远程运行查询.所以我将它(DevCenter)安装在一个单独的工作站上.(CentOS 6.4 - 桌面)并尝试添加新连接以连接到 cassandra 数据库.

I have successfully installed (yum install dsc20) the cassandra database layer in my server and can connect to it using the CQL SHel (cqlsh). But I need to run queries remotely using the DataStax's DevCenter software. So I installed it (DevCenter) in a separate workstation. (CentOS 6.4 - desktop) and tried to add a new connection in order to connect to the cassandra db.

因此,我将主机的CentOS 6.4 - 服务器"(运行 cassandra 数据库的服务器)的 IP 和端口设置为 9160.但是在测试连接时却失败了.

So I gave the IP of the "CentOS 6.4 - server" (in which cassandra database is running) for the host and the port as 9160. But when testing the connection it fails.

我也尝试关闭服务器中的防火墙,(/etc/init.d/iptables stop).但运气不好.

I also tried to turn off the firewall in the server, (/etc/init.d/iptables stop). But was no luck.

我确定这可能是由于一些我无法弄清楚的错误配置造成的.如果有人可以为此提供解决方案,我将不胜感激,因为我正在为此进行研究并没有找到答案.预先非常感谢您.

I'm sure this may be due to some misconfiguration which I cannot figure out. I'll be grateful, if someone can give me a solution for this as I was researching for this and found no answers. Thank you very much in advance.

推荐答案

DataStax DevCenter 建立在 DataStax Java 驱动程序之上,具有相同的 作为驱动程序的连接要求.即:

DataStax DevCenter being built on top of the DataStax Java driver has the same connectivity requirements as the driver. Namely:

  1. start_native_transport:真
  2. rpc_address:客户端可访问的 IP 或主机名
  3. 集群中的机器接受端口 9042 上的连接(native_transport_port 配置选项)
  1. start_native_transport: true
  2. rpc_address: IP or hostname reachable from the client
  3. Machines in the cluster accept connections on port 9042 (the native_transport_port config option)

如果 rpc_address 设置为私有 IP 或 0.0.0.0,DevCenter 将不知道要连接到哪个节点.

If rpc_address is set to either a private IP or to 0.0.0.0, DevCenter will not know what node to connect to.

如果您的集群有多个节点并且这些节点使用 rpc_address: 0.0.0.0,即使您使用几个节点的 IP 配置 DevCenter,它仍然会发现问题集群中的其他节点.

If your cluster has multiple nodes and these are using rpc_address: 0.0.0.0, even if you configure DevCenter with the IP(s) of a couple of nodes, it will still have issues discovering the other nodes in the cluster.

cassandra.yaml 有一个关于使用 rpc_address: 0.0.0.0:

注意,与上面的ListenAddress不同,允许指定0.0.0.0在这里,如果您想监听所有接口,但这会破坏客户端依赖于节点自动发现.

Note that unlike ListenAddress above, it is allowed to specify 0.0.0.0 here if you want to listen on all interfaces, but that will break clients that rely on node auto-discovery.

注意:未来 DevCenter 可能能够忽略/过滤掉集群中配置了 rpc_address: 0.0.0.0 的节点.

Note: it is possible that in the future DevCenter might be able to ignore/filter out nodes in the cluster configured with rpc_address: 0.0.0.0.

这篇关于DataStax Devcenter 无法连接到远程 cassandra 数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆