AKS: MongoError: not master

452 views Asked by At

I'm using mongodb replicaset in Azure Kubernetes. I have two pods running for mongodb. I have created a service to connect both pods, which is working perfectly fine. But looks like now it is giving error while connecting to secondary pod:

[amqp] Channel consume error: MongoError: not master errmsg: 'not master', code: 10107, codeName: 'NotMaster'

Can you please help me in case of I'm missing something

Source of MongoDB: Bitnami MongoDB Helm

1

There are 1 answers

2
Daniel Arteaga Barba On

I think you could try to use externalAccess.enabled=true parameter so you don't have to create the services manually. In combination with that, you could also use externalAccess.autoDiscovery.enabled=true.

$ helm install mongodb bitnami/mongodb \
  --set architecture=replicaset \
  --set externalAccess.enabled=true \
  --set externalAccess.autoDiscovery.enabled=true \
  --set rbac.create=true

BTW, it could be good to see more details of your installation parameters and environment so that we could help better.