rpc_地址未设置为0.0.0.0时使用groovy脚本的Cassandra连接

rpc_地址未设置为0.0.0.0时使用groovy脚本的Cassandra连接,groovy,cassandra,Groovy,Cassandra,我需要从苏佩找到卡桑德拉 我使用了下面的脚本 import com.datastax.driver.core.Cluster; import com.datastax.driver.core.Session; def rs; //create cluster for cassandra Cluster cluster = new Cluster.Builder().addContactPoint("xxxx").withCredentials("xxxx&qu

我需要从苏佩找到卡桑德拉

我使用了下面的脚本

import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Session;

def rs;


//create cluster for cassandra
Cluster cluster = new Cluster.Builder().addContactPoint("xxxx").withCredentials("xxxx", "xxxx").withPort(9042).build();

//get seesionm from cassandra claster
session = cluster.connect();



//log.info(rs)
我看到的问题是

出于安全原因,
/etc/cassandra/default.conf/cassandra.yaml
rpc_address
未配置为
0.0.0
。它有一个IP


如果
rpc_地址
和广播_地址是不同的IP

请给我建议一种连接cassandra的方法通常,您使用以下配置cassandra:

listen_address: public_ip
rpc_address: private_ip
但是,如果您有一台NIC计算机,则将两者设置为相同的IP

如果您有多区域群集,则只需配置
广播\u地址
。我以前也回答过类似的问题。有关详细信息,请参阅本文--。干杯