I am trying to connect to cluster nodes having different ports (9042 and 9043), but cannot find ways to do it here:
cluster = Cluster(['0.0.0.0','0.0.0.0'],port=9042)
How do I do it?
I am trying to connect to cluster nodes having different ports (9042 and 9043), but cannot find ways to do it here:
cluster = Cluster(['0.0.0.0','0.0.0.0'],port=9042)
How do I do it?
Copyright © 2021 Jogjafile Inc.
As of v3.27 of the DataStax's Python driver for Cassandra,
Cluster'scontact_pointsparameter seems to accept a tuple of IP and port.https://github.com/datastax/python-driver/blob/3.27.0/cassandra/cluster.py#L581-L585
You can do
and then just leave the
port=parameter as empty.