-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Hello Michael,
I have just followed this example of yours to learn something about stateful sets in OpenShit and I found the follower pods can’t get keys from the leader due to a bad hostname construction (I think) compared to what DNS is able to resolve: mehdb-0.axa-partners-chatbot-hogar-preprod-axa-services-es instead of mehdb-0.mehdb.axa-partners-chatbot-hogar-preprod-axa-services-es.svc.cluster.local.
There you have the output of my test:
ramon@bionic-beaver:~/OpenShift $ oc get sts
NAME DESIRED CURRENT AGE
mehdb 3 3 34m
ramon@bionic-beaver:~/OpenShift $ oc scale sts mehdb --replicas=4
statefulset "mehdb" scaled
ramon@bionic-beaver:~/OpenShift $ oc get pods
NAME READY STATUS RESTARTS AGE
mehdb-0 1/1 Running 0 36m
mehdb-1 1/1 Running 0 35m
mehdb-2 1/1 Running 0 33m
mehdb-3 1/1 Running 0 1m
ramon@bionic-beaver:~/OpenShift $ oc logs mehdb-3
2019/01/29 11:49:52 mehdb serving from mehdb-3:9876 using /mehdbdata as the data directory
2019/01/29 11:49:52 I am a follower shard, accepting READS
2019/01/29 11:50:02 Checking for new data from leader
2019/01/29 11:50:02 Can't get keys from leader due to Get http://mehdb-0.axa-partners-chatbot-hogar-preprod-axa-services-es:9876/keys: dial tcp: lookup mehdb-0.axa-partners-chatbot-hogar-preprod-axa-services-es on 10.64.9.9:53: no such host
2019/01/29 11:50:12 Checking for new data from leader
2019/01/29 11:50:12 Can't get keys from leader due to Get http://mehdb-0.axa-partners-chatbot-hogar-preprod-axa-services-es:9876/keys: dial tcp: lookup mehdb-0.axa-partners-chatbot-hogar-preprod-axa-services-es on 10.64.9.9:53: no such host
ramon@bionic-beaver:~/OpenShift $ oc run -i -t --rm dnscheck --restart=Never --image=quay.io/mhausenblas/jump:0.2 -- nslookup mehdb
If you don't see a command prompt, try pressing enter.
Name: mehdb
Address 1: 10.94.107.130 mehdb-2.mehdb.axa-partners-chatbot-hogar-preprod-axa-services-es.svc.cluster.local
Address 2: 10.94.112.4 mehdb-1.mehdb.axa-partners-chatbot-hogar-preprod-axa-services-es.svc.cluster.local
Address 3: 10.94.21.232 mehdb-0.mehdb.axa-partners-chatbot-hogar-preprod-axa-services-es.svc.cluster.local
Address 4: 10.94.9.228 mehdb-3.mehdb.axa-partners-chatbot-hogar-preprod-axa-services-es.svc.cluster.local
I wonder if it would be easy for you to explain the root cause of this error and suggest how it can be fixed.
Thank you in advance,
Ramon Cisternas