datastax java 驱动程序中的 ControlConnection 警告

ControlConnection warning in datastax java driver

我正在使用cassandra 2.0.9 和datastax java 驱动程序2.0.5 进行查询。 我在 cassandra 中将 rpc_address 设置为 0.0.0.0。有时我会从客户端收到此警告消息

4411 [Cassandra Java Driver worker-1] WARN com.datastax.driver.core.ControlConnection - Found host with 0.0.0.0 as rpc_address, using listen_address (/192.168.100.175) to contact it instead. If this is incorrect you should avoid the use of 0.0.0.0 server side.

我找不到为什么这个警告只是有时出现。我该如何解决?

驱动程序使用 system.peers table 中设置的 rpc_address 来查找要连接的地址。当您将 rpc 地址配置为 0.0.0.0 时,这就是系统 table 中的地址,因此驱动程序无法确定要连接到哪个 IP。

如果可能,您应该将其设置为其实际 IP 192.168.100.175,但如果那不正确,您可能只想将更多节点的实际地址添加到驱动程序最初提供的主机列表中。