Avoid connection to nodes' internal IP addresses, preventing log warnings

145 views
Skip to first unread message

Lennart Liberg

unread,
Jan 6, 2015, 10:46:07 AM1/6/15
to python-dr...@lists.datastax.com
I'm running a cluster on google cloud, where the nodes communicate using their internal IP addresses.
When connecting to the cluster from external client using the the nodes' external IP addresses, these internal IPs gets returned as hosts, which makes the connection pool produce warnings since it can't connect to them.

In [2]: MyCluster.connect()

In [3]: WARNING:cassandra.pool:Error attempting to reconnect to 10.10.10.5, scheduling retry in 2.0 seconds: timed out
WARNING:cassandra.pool:Error attempting to reconnect to 10.10.10.9, scheduling retry in 2.0 seconds: timed out
WARNING:cassandra.pool:Error attempting to reconnect to 10.10.10.6, scheduling retry in 2.0 seconds: timed out
WARNING:cassandra.pool:Error attempting to reconnect to 10.10.10.9, scheduling retry in 4.0 seconds: timed out
WARNING:cassandra.pool:Error attempting to reconnect to 10.10.10.5, scheduling retry in 4.0 seconds: timed out
WARNING:cassandra.pool:Error attempting to reconnect to 10.10.10.6, scheduling retry in 4.0 seconds: timed out

In [26]: cqlengine.connection.session.hosts
Out[26]: 
[<Host: 104.10.10.2 euwestb>,
 <Host: 10.10.10.5 euwestb>,
 <Host: 146.10.10.9>,
 <Host: 10.10.10.8 euwestb>,
 <Host: 104.10.10.8>,
 <Host: 10.10.10.6 euwestb>,
 <Host: 104.10.10.1>]

What is a recommended way of avoiding these warnings while still maintaining the reconnect functionality for the accessible hosts?
(except of course setting a sufficiently high loglevel for the pool logger)?


Thanks,

Lennart Liberg

Lennart Liberg

unread,
Jan 6, 2015, 11:15:57 AM1/6/15
to python-dr...@lists.datastax.com
Alright, the WhiteListRoundRobinPolicy seems to be the answer to my question.

Thanks!

To unsubscribe from this group and stop receiving emails from it, send an email to python-driver-u...@lists.datastax.com.

Reply all
Reply to author
Forward
0 new messages