MongoDB version supported

I have…

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [ ] Bug report
  • [ ] Performance issue
  • [X] Documentation issue or request

Current behavior

I can’t create mongo StatefulSet in AKS.

Expected behavior

Minimal reproduction of the problem

This is the current error:

failed to connect to server [127.0.0.1:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]

Environment

App Name:

  • [X] Self hosted with K8S
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version MongoDB: latest

How have you configured your replica set? I mean localhost does not really make sense.

This error occurs during replica set deployment

This does not answer the question. I have configured a replica set perhaps 5 or 6 times in my life and I cannot give support if you provide so few details. I have no idea what you actually did with just one short log statement.

Can you format this a little bit? Really difficult to read

 apiVersion: apps/v1
 kind: StatefulSet
 metadata:
   name: mongo
 spec:
   serviceName: "mongo"
   replicas: 3
   selector:
     matchLabels:
       role: mongo
   template:
     metadata:
       labels:
         role: mongo
     spec:
       terminationGracePeriodSeconds: 20
       containers:
         - name: mongo
           image: mongo
           imagePullPolicy: Always
           command:
           - mongod
           - --replSet
           - rs0
           - --bind_ip
           - 0.0.0.0
           - --smallfiles
           - --noprealloc
           ports:
           - containerPort: 27017
           volumeMounts:
           - name: mongo-persistent-storage
             mountPath: /data/db
         - name: mongo-sidecar
           image: cvallance/mongo-k8s-sidecar
           imagePullPolicy: Always
           env:
           - name: MONGO_SIDECAR_POD_LABELS
             value: "role=mongo"
   volumeClaimTemplates:
   - metadata:
       name: mongo-persistent-storage
       annotations:
          volume.kubernetes.io/storage-class: "fast"
     spec:
       accessModes: [ "ReadWriteOnce" ]
       resources:
         requests:
           storage: 100Gi

And who is throwing the error? The error could be just fine if the sidecar logs it and mongodb container is not ready yet.

I would ask the author of the sidecar, but please provide him detailed information about the error.

I am not using it anymore and I have configured mongodb in kubernetes twice so far and this was a few years ago. So I am probably the wrong person to ask. Read the MongoDb documentation or search for tutorials or just use a managed solution, but I cannot give support for all the details of MongoDb.

Btw: NEVER EVER use something like image: mongo. Define a concrete version. E.g. if a node goes down or restarted the pods will be recreated and then it would pull a newer version. So your replica set could end with 1 new and 2 old versions and then it will probably fail to start and until you realize what happens you have a downtime of a few hours.

I understood about MongoDb concrete version.

Can you give me an example of a managed solution for this case?

MongoDB itself provides a managed service: https://www.mongodb.com/pricing. It also supports better full text search in larger tiers.

Thank you, Sebastian.

Last question. Does mongo:5.0 support squidex:5.7.1 or just squidex:7.0?

THe versions are not related. You can use any version.