[SERVER-53472]  HostUnreachable: Connection refused: Error in heartbeat request to mongodb Created: 21/Dec/20  Updated: 27/Oct/23  Resolved: 22/Dec/20

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Brati Acharya Assignee: Unassigned
Resolution: Community Answered Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

Here is the error log

2020-12-21T19:01:44.384+0000 I ASIO [NetworkInterfaceASIO-Replication-0] Failed to connect to mongodb-0.mongodb.default.svc.cluster.local

:27017 - HostUnreachable: Connection refused

2020-12-21T19:01:44.384+0000 I ASIO [NetworkInterfaceASIO-Replication-0] Dropping all pooled connections to mongodb-0.mongodb.default.svc

.cluster.local:27017 due to failed operation on a connection

2020-12-21T19:01:44.384+0000 I REPL [ReplicationExecutor] Error in heartbeat request to mongodb-0.mongodb.default.svc.cluster.local:27017

; HostUnreachable: Connection refused

 

Here is my yaml

 

ansible@sq-kube-01:~$ kubectl edit statefulset mongodb

  • -v
  • --replSet
  • abacus
  • --dbpath
  • /data/db
  • --logpath
  • /var/log/mongodb/server.log
  • --logRotate
  • reopen
  • --logappend
    command:
  • mongod
    image: library/mongo:3.4.4
    imagePullPolicy: IfNotPresent
    name: mongodb
    ports:
  • containerPort: 27017
    protocol: TCP
    resources:
    limits:
    cpu: "3"
    memory: 21Gi
    requests:
    cpu: 100m
    memory: 100Mi
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    volumeMounts:
  • mountPath: /data/db
    name: mongodb
  • mountPath: /var/log/mongodb
    name: logs
  • env:
  • name: MONGO_SIDECAR_POD_LABELS
    value: role=mongodb,environment=stage
  • name: KUBERNETES_MONGO_SERVICE_NAME
    value: mongodb
  • name: KUBE_NAMESPACE
    value: default
    image: cvallance/mongo-k8s-sidecar
    imagePullPolicy: IfNotPresent
    name: mongo-sidecar
    resources:
    limits:
    cpu: 300m
    memory: 500Mi

requests:
cpu: 100m
memory: 100Mi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File

  • args:
  • proxy
  • sidecar
  • -v
  • "2"
  • --configPath
  • /etc/istio/proxy
  • --binaryPath
  • /usr/local/bin/envoy
  • --serviceCluster
  • istio-proxy
  • --drainDuration
  • 45s
  • --parentShutdownDuration
  • 1m0s
  • --discoveryAddress
  • istio-pilot.istio-system:8080
  • --discoveryRefreshDelay
  • 1s
  • --zipkinAddress
  • zipkin.istio-system:9411
  • --connectTimeout
  • 10s
  • --statsdUdpAddress
  • istio-mixer.istio-system:9125
  • --proxyAdminPort
  • "15000"
    env:
  • name: POD_NAME
    valueFrom:
    fieldRef:
    apiVersion: v1
    fieldPath: metadata.name
  • name: POD_NAMESPACE
    valueFrom:
    fieldRef:
    apiVersion: v1

fieldPath: metadata.namespace

  • name: INSTANCE_IP
    valueFrom:
    fieldRef:
    apiVersion: v1
    fieldPath: status.podIP
    image: docker.io/istio/proxy:0.2.6
    imagePullPolicy: IfNotPresent
    name: istio-proxy
    resources: {}
    securityContext:
    privileged: false
    readOnlyRootFilesystem: true
    runAsUser: 1337
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    volumeMounts:
  • mountPath: /etc/istio/proxy
    name: istio-envoy
  • mountPath: /etc/certs/
    name: istio-certs
    readOnly: true
    dnsPolicy: ClusterFirst
    imagePullSecrets:
  • name: juniperregistrykey
    initContainers:
  • args:
  • -p
  • "15001"
  • -u
  • "1337"
    image: docker.io/istio/proxy_init:0.2.6
    imagePullPolicy: IfNotPresent
    name: istio-init
    resources: {}
    securityContext:
    capabilities:
    add:
  • NET_ADMIN
    privileged: true
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    nodeSelector:
    node: mongodb
    restartPolicy: Always

schedulerName: default-scheduler
securityContext: {}
serviceAccount: mongodb-serviceaccount
serviceAccountName: mongodb-serviceaccount
terminationGracePeriodSeconds: 10
volumes:

  • emptyDir: {}
    name: configdir
  • hostPath:
    path: /var/log/mongodb
    type: ""
    name: logs
  • hostPath:
    path: /data/mongodb/data/db
    type: ""
    name: mongodb
  • emptyDir:
    medium: Memory
    name: istio-envoy
  • name: istio-certs
    secret:
    defaultMode: 420
    optional: true
    secretName: istio.mongodb-serviceaccount
    updateStrategy:
    rollingUpdate:
    partition: 0
    type: RollingUpdate
    status:
    collisionCount: 0
    currentReplicas: 3
    currentRevision: mongodb-86559f6fd5
    observedGeneration: 71
    readyReplicas: 3
    replicas: 3
    updateRevision: mongodb-86559f6fd5

 



 Comments   
Comment by Dmitry Agranat [ 22/Dec/20 ]

Hi bratia@juniper.net,

Your configuration shows that you are using MongoDB 3.4.4:

mongod image: library/mongo:3.4.4

MongoDB 3.4 reached end of life in January of 2020. If this is still an issue for you on any supported MongoDB versions, please open a new case and provide a full MongoDB log covering the time of the reported event.

Regards,
Dima

Generated at Thu Feb 08 05:31:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.