我试图连接到运行Cassandra服务器实例的节点之一。 Nodetool显示它们同步良好。
[root@cassandra1 ~]# /opt/dsc-cassandra-2.1.8/bin/nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 10.0.17.20 100.4 KB 256 100.0% rack1
UN 10.0.17.24 249.39 KB 256 100.0% rack1
当我运行netstst -tulnap
时,我可以看到以下设置
tcp 0 0 127.0.0.1:44907 0.0.0.0:* LISTEN 4428/java
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 756/sshd
tcp 0 0 10.0.17.20:7000 0.0.0.0:* LISTEN 4428/java
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 842/master
tcp 0 0 127.0.0.1:7199 0.0.0.0:* LISTEN 4428/java
tcp 0 0 127.0.0.1:199 0.0.0.0:* LISTEN 744/snmpd
tcp 0 0 127.0.0.1:9160 0.0.0.0:* LISTEN 4428/java
tcp 0 0 10.0.17.20:7000 10.0.17.24:46314 ESTABLISHED 4428/java
tcp 0 0 10.0.17.20:43083 10.0.17.24:7000 ESTABLISHED 4428/java
tcp 0 0 10.0.17.20:22 10.0.17.50:53665 ESTABLISHED 4662/sshd
tcp 0 0 ::ffff:127.0.0.1:9042 :::* LISTEN 4428/java
tcp 0 0 :::22 :::* LISTEN 756/sshd
tcp 0 0 ::ffff:127.0.0.1:34705 ::ffff:127.0.0.1:44907 TIME_WAIT -
tcp 0 0 ::ffff:127.0.0.1:43039 ::ffff:127.0.0.1:7199 TIME_WAIT -
什么告诉用于在节点之间进行同步的7199端口在ipv4中运行,ssh在ipv4 / 6上运行,而我感兴趣的端口只是在ipv6接口上侦听。
要强制使用ipv4,即使它不是无关紧要的,我也设置了标志listen_interface_prefer_ipf6: false
listen_address: 10.0.17.20
listen_interface_prefer_ipv6: false
org.apache.cassandra.auth.AllowAllInternodeAuthenticator
start_native_transport: true
native_transport_port: 9042
我不知道如何强制Cassandra服务在ipv4上打开9042端口。