Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

vamsikrishna.bm_190953 avatar image
vamsikrishna.bm_190953 asked ·

How do I verify that the native transport port 9042 is open?

how to verify that the native transport port default 9042 on each node is open to the machine running opscenterd

network
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

Cluster nodes

To check if a DSE node is accepting connections on CQL port 9042, you can use either the Linux netstat or lsof utilities.

In this sample netstat output, the DSE process ID is 23773 and port 9042 is bound to IP 10.101.34.115:

$ netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -                   
tcp        0      0 10.101.34.115:7000      0.0.0.0:*               LISTEN      23773/java          
tcp        0      0 127.0.0.1:7199          0.0.0.0:*               LISTEN      23773/java          
tcp        0      0 10.101.34.115:8609      0.0.0.0:*               LISTEN      23773/java          
tcp        0      0 127.0.0.1:45609         0.0.0.0:*               LISTEN      23773/java          
tcp        0      0 10.101.34.115:9042      0.0.0.0:*               LISTEN      23773/java          
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -                   
tcp6       0      0 :::22                   :::*                    LISTEN      -                 

Specifically this line:

tcp        0      0 10.101.34.115:9042      0.0.0.0:*               LISTEN      23773/java

Here's an example lsof output:

$ sudo lsof -nPi -sTCP:LISTEN
COMMAND     PID            USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME
systemd-r   988 systemd-resolve   13u  IPv4     18580      0t0  TCP 127.0.0.53:53 (LISTEN)
sshd       1575            root    3u  IPv4     24868      0t0  TCP *:22 (LISTEN)
sshd       1575            root    4u  IPv6     24873      0t0  TCP *:22 (LISTEN)
java      23773          ubuntu  852u  IPv4 128787223      0t0  TCP 10.101.34.115:8609 (LISTEN)
java      23773          ubuntu  854u  IPv4 128787233      0t0  TCP 127.0.0.1:7199 (LISTEN)
java      23773          ubuntu  855u  IPv4 128787236      0t0  TCP 127.0.0.1:45609 (LISTEN)
java      23773          ubuntu  918u  IPv4 128795863      0t0  TCP 10.101.34.115:9042 (LISTEN)
java      23773          ubuntu 1114u  IPv4 128790715      0t0  TCP 10.101.34.115:7000 (LISTEN)

Specifically this line:

java      23773          ubuntu  918u  IPv4 128795863      0t0  TCP 10.101.34.115:9042 (LISTEN)

OpsCenter

To check if the OpsCenter has connectivity to the DSE nodes, use Linux utilities such as telnet or nc.

Here's an example output running telnet on the OpsCenter server:

$ telnet 10.101.34.115 9042
Trying 10.101.34.115...
Connected to 10.101.34.115.
Escape character is '^]'.

If DSE is not running or a firewall is blocking access to the port, you will get this error:

telnet: Unable to connect to remote host: Connection refused

Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.