Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-316

Driver is unable to resolve hostnames to IP addresses

    XMLWordPrintable

Details

    Description

      MongoDB ruby driver cannot connect to the replica set.
      The driver itself seems to want to resolve the host names of each individual node e.g. mongod-node-0 => 10.0.x.x

      Logs from the Mongo adapter: note where "getaddrinfo" fails to resolve the hostname to the IP address.

      016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:30.331490 #28 DEBUG – : MONGODB | Adding 10.65.178.135:28000 to the cluster.
      2016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:30.333658 #28 DEBUG – : MONGODB | Adding mongod-node-0:28000 to the cluster.
      2016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:30.335013 #28 DEBUG – : MONGODB | getaddrinfo: Name or service not known
      2016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:30.335204 #28 DEBUG – : MONGODB | Adding mongod-node-1:28000 to the cluster.
      2016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:30.335781 #28 DEBUG – : MONGODB | getaddrinfo: Name or service not known
      2016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:30.335950 #28 DEBUG – : MONGODB | Adding mongod-node-2:28000 to the cluster.
      2016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:30.348431 #28 DEBUG – : MONGODB | getaddrinfo: Name or service not known
      2016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:30.348763 #28 DEBUG – : MONGODB | Adding 10.65.178.133:28000 to the cluster.
      2016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:30.351169 #28 DEBUG – : MONGODB | 10.65.178.135:28000 being removed from the cluster.
      2016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:30.351480 #28 DEBUG – : MONGODB | Server 10.65.178.133:28000 elected as primary in pcf_repl.
      2016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:30.351706 #28 DEBUG – : MONGODB | Adding 10.65.178.134:28000 to the cluster.
      2016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:30.354136 #28 DEBUG – : MONGODB | 10.65.178.133:28000 being removed from the cluster.
      2016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:30.834764 #28 DEBUG – : MONGODB | getaddrinfo: Name or service not known
      2016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:30.835866 #28 DEBUG – : MONGODB | getaddrinfo: Name or service not known
      2016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:30.836627 #28 DEBUG – : MONGODB | getaddrinfo: Name or service not known
      2016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:31.334806 #28 DEBUG – : MONGODB | getaddrinfo: Name or service not known
      2016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:31.335955 #28 DEBUG – : MONGODB | getaddrinfo: Name or service not known
      2016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:31.336675 #28 DEBUG – : MONGODB | getaddrinfo: Name or service not known
      2016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:31.834838 #28 DEBUG – : MONGODB | getaddrinfo: Name or service not known
      2016-07-14T15:10:42.35-0700 [APP/0] OUT D, 2016-07-14T22:10:31.835991 #28 DEBUG – : MONGODB | getaddrinfo: Name or service not known

      As soon as the driver adds a host, it tries to resolve it's name. This just isn't possible in a container, we can't add host entries.

      Is it possible to instruct the driver to use IP addresses only?

      Attachments

        Issue Links

          Activity

            People

              bernie@mongodb.com Bernie Hackett
              miyer24 Mallika Iyer
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: