Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-60408

Mongod cannot bind to IPv6 address

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • ALL
    • Hide

      This needs to be running inside an IPv6 docker environment

       

      docker run -d -v /Docker/entrypoint/:/usr/local/bin/ -v /Docker/mongoconfig/mongod.conf.orig:/etc/mongod.conf.orig -p 27017:27017 mongo:5.0.3

       

      docker entry point modified to docker-entrypoint.sh:
       #!/bin/bash
      exec mongod --bind_ip '::' --ipv6
      mongod.conf.orig something along the lines of:
       storage:
      dbPath: /var/lib/mongodb
      journal:
      enabled: true

      1. where to write logging data.
        systemLog:
        destination: file
        logAppend: true
        path: /var/log/mongodb/mongod.log
      1. network interfaces
        net:
        port: 27017
        #bindIp: 134:1234:134:1324:1234:134:1234:3
        bind_ip = 0::0
        ipv6 = true
        or an in container command along the lines of: 

      mongod --dbpath ~/mongoDB --bind_ip [::] --ipv6 

       

      Show
      This needs to be running inside an IPv6 docker environment   docker run -d -v /Docker/entrypoint/:/usr/local/bin/ -v /Docker/mongoconfig/mongod.conf.orig:/etc/mongod.conf.orig -p 27017:27017 mongo:5.0.3   docker entry point modified to docker-entrypoint.sh:  #!/bin/bash exec mongod --bind_ip '::' --ipv6 mongod.conf.orig something along the lines of:  storage: dbPath: /var/lib/mongodb journal: enabled: true where to write logging data. systemLog: destination: file logAppend: true path: /var/log/mongodb/mongod.log network interfaces net: port: 27017 #bindIp: 134:1234:134:1324:1234:134:1234:3 bind_ip = 0::0 ipv6 = true or an in container command along the lines of:  mongod --dbpath ~/mongoDB --bind_ip [::] --ipv6   
    • 25

    Description

       I'm running MongoDB inside the official container - however I am running docker in an IPv6 only environment. 
      When changing the config or docker entry point to run with ipv6 binding docker fails to bind with the following output 

       "ctx":"initandlisten","msg":"Found no addresses for peer","attr":{"peer":

      {"code":7,"codeName":"HostNotFound","errmsg":"Could not find address for [[::]]:27017: SocketException: Host not found (authoritative)"}

      }}

      I've tried typing the full IPv6 address, this also didn't work. It occurred to me that Mongod may be using a library to find the IPv6 address, I only have ifupdown and ifconfig installed.

      Log attached. 

       

      Attachments

        Activity

          People

            edwin.zhou@mongodb.com Edwin Zhou
            mikster22@googlemail.com Mi B
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: