cassandra在主机端口上侦听,但无法连接

时间:2016-08-06 23:31:07

标签: cassandra centos7

当我尝试连接到10.0.0.60 9042时,出现错误:

[idf@node1 conf]$ cqlsh 10.0.0.60 9042
Connection error: ('Unable to connect to any servers', {'10.0.0.60': TypeError('ref() does not take keyword arguments',)})

但是,我可以看到cassandra正在侦听该端口。 不确定发生了什么?

[idf@node1 conf]$ nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load       Tokens  Owns (effective)  Host ID                               Rack
UN  10.0.0.60  4.02 GB    256     100.0%            aa1b3c7c-1440-4dbd-a22f-a9cbc892c282  rack1


[idf@node1 conf]$ sudo netstat -tulpn | grep -i listen | grep 22955
tcp        0      0 10.0.0.60:7000          0.0.0.0:*               LISTEN      22955/java          
tcp        0      0 127.0.0.1:7199          0.0.0.0:*               LISTEN      22955/java          
tcp        0      0 127.0.0.1:44321         0.0.0.0:*               LISTEN      22955/java          
tcp        0      0 10.0.0.60:9160          0.0.0.0:*               LISTEN      22955/java          
tcp6       0      0 10.0.0.60:9042          :::*                    LISTEN      22955/java         

[idf@node1 conf]$ ifconfig -a
docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 0.0.0.0
        ether 02:42:27:f4:35:a0  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp1s0f1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.0.60  netmask 255.255.255.0  broadcast 10.0.0.255
        inet6 fe80::225:90ff:fe1c:1c47  prefixlen 64  scopeid 0x20<link>
        ether 00:25:90:1c:1c:47  txqueuelen 1000  (Ethernet)
        RX packets 109  bytes 7996 (7.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 366  bytes 25730 (25.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0xfaee0000-faefffff  

1 个答案:

答案 0 :(得分:0)

尝试访问cqlsh,如下所示:

   [idf@node1 conf]$ cqlsh 10.0.0.60
      OR
   [idf@node1 conf]$ cqlsh `hostname -i`

默认端口rpc_port为9160,9542为native_transport_port。