DataStax Help Center

Unable to connect to DSE via native protocol over IPv6

Summary

When using the IPv6 address of nodes in a cluster, connections to the native port (9042 by default) are refused

Symptoms

The user is unable to connect applications using the driver or any other clients using the native port into the cluster. Thrift connections seem to be allowed via IPv6. A simple test with netcat or telnet shows the following:

# nc -v -w1 2001::300 9042
Ncat: Connection refused.

Cause

The default DSE settings are configured for IPv4. Also IPv6 is generally disabled in /etc/sysctl.conf

Solution

1. Change the /etc/sysctl.conf file to allow IPv6

net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0

2 - Reload sysctl

# sysctl -p

3. Enable IPv6 in the /etc/dse/cassandra/cassandra-env.sh by commenting out the following line

# JVM_OPTS="$JVM_OPTS -Djava.net.preferIPv4Stack=true"

4. Add a IPv6 address (optional as one might already be configured)

ip -6 addr add dev eth0 2001::1002/64

5. Change the cassandra.yaml to use interface or address as you prefer.

# rpc_address: 0.0.0.0
rpc_interface: eth0
rpc_interface_prefer_ipv6: true

6. Check netcat / netstat

# nc -v -w1 -6 2001::1002 9042
Connection to 2001::1002 9042 port [tcp/*] succeeded!

# netstat -ant | awk 'NR==2;/9160/;/9042/' Proto Recv-Q Send-Q Local Address Foreign Address State tcp6 0 0 2001::1002:9160 :::* LISTEN tcp6 0 0 2001::1002:9042 :::* LISTEN

7. Check cqlsh

# cqlsh 2001::1002 -u cassandra -p cassandra
Connected to DRWP at 2001::1002:9042.
[cqlsh 5.0.1 | Cassandra 2.1.8.689 | DSE 4.7.3 | CQL spec 3.2.0 | Native protocol v3]
Use HELP for help.
cassandra@cqlsh>

Related issues

The following issue also addresses issues with native port binding in Cassandra

CASSANDRA-11047

Related tech notes

Clients of DSE also include OpsCenter so check that your OpsCenter version has IPv6 support

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk