kong doesn't connect to same cassandra cluster when IPs have changed #7324
Replies: 16 comments
-
@thibaultcha @hishamhm @bungle can someone please check and help us to resolve this issue. |
Beta Was this translation helpful? Give feedback.
-
@darrenjennings @daviesf1 @deirdre-anderson @DMarby notifying few more people so someone can help us here. |
Beta Was this translation helpful? Give feedback.
-
Could you exec into the Kong node and do a dig (or equivalent) on the cassandra service name to check the new ip is resolving correctly |
Beta Was this translation helpful? Give feedback.
-
@hutchic connection from Kong pod/node to Cassandra cluster DB is resolvable with service name even after change of IPs.
I am suspecting two things here
|
Beta Was this translation helpful? Give feedback.
-
@hutchic can you check the latest logs and guide us what went wrong here. |
Beta Was this translation helpful? Give feedback.
-
@hutchic required info was updated, can someone check this and update |
Beta Was this translation helpful? Give feedback.
-
@Tieske could you please check this once or assign it to relevant team, @hutchic has labelled this issue as |
Beta Was this translation helpful? Give feedback.
-
@kikito could you check this once. |
Beta Was this translation helpful? Give feedback.
-
K so we're hitting
Which comes from https://github.com/thibaultcha/lua-cassandra/blob/master/lib/resty/cassandra/cluster.lua#L563 Is it possible getting the lock on that "Cassandra" dict times out because the existing contact points are unavailable? |
Beta Was this translation helpful? Give feedback.
-
Hi there, To me, the issue here seems to be that in restarting all of your Cassandra nodes at once, your are also invalidating the IP address of the - only - contact point you are providing Kong with, aka
For now, I'd suggest:
|
Beta Was this translation helpful? Give feedback.
-
@thibaultcha thanks for responding. We can't pass multiple contact points as Cassandra is already setup in cluster mode and restarting of this service will change the IP address for pods/containers as part of Kubernetes/Openshift functionality. If I understand correctly, this issue can be resolved with some changes in Kong to support new_contact points after |
Beta Was this translation helpful? Give feedback.
-
@thibaultcha any tentative dates when this feature will be available in open source? |
Beta Was this translation helpful? Give feedback.
-
@thibaultcha it would be helpful if someone can provide us the updates on a resolution for this issue? |
Beta Was this translation helpful? Give feedback.
-
@thibaultcha @guanlan @dndx can someone share the update on this issue? |
Beta Was this translation helpful? Give feedback.
-
Summary
Kong is connected to Cassandra cluster in the Kubernetes environment using the service name. As long as the nodes are up and running Kong is able to connect to the database and when the nodes are down, Kong reports database is not reachable which is expected.
But Kong is still trying to connect to the old set of IPs when Cassandra cluster is back with same service name with a different set of IPs. Due to this Kong is under the impression that Cassandra is down.
Tried
kong reload
after the Cassandra cluster is up and running, but kong doesn't connect to new IPs but failing with this error.Kong Version : 2.0.4
Steps to reproduce:
1) start kong backed with Cassandra DB as cluster setup in Kubernetes env.
from the kong logs
few key configs/params from the above logs:
2. make Cassandra cluster down/stop
3. restart the cassandra cluster, kubernetes allocates them with new IPs
4. Wait for
cassandra_refresh_frequency = 60
for kong to get new set of IPs, but nothing happened.kong trying with old Cassandra IPs
5. So did kong reload to clear the cache and connect to new IPs.
Similar issue was reported couple of years back here - #2674
and from the discussion here - #3752, this was resolved in this PR - https://github.com/Kong/kong/pull/5071/files.
Can someone please check this and let us know if anything missing from our end.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions