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

replSetInitiate without arguments breaks when hostname isn't resolvable

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.0.2
    • Component/s: Replication
    • Labels:
      None
    • Environment:
      MacOSX, but generally anywhere the hostname resolution behavior is screwy.
    • Replication

      replSetInitiate with no arguments doesn't work when the mongod's host's name isn't resolvable. (This is the default behavior on MacBooks,
      and comes up constantly in trainings.) It's possible to configure the set with an explicit, valid configuration object, of course, though in many training scenarios, the only resolvable hostname you have is localhost, so you have to choose between localhost and IP addresses.

      The trouble is I'm not sure what the bug is:

      (1) File this as a documentation bug and say that a no-arg initiate doesn't work if your hosts don't know their own names. (We probably don't really want people deploying onto hosts with dodgy hostname resolution behaviors anyway, i.e., say that a good DNS configuration is a prerequisite like NTP is.) This is a principled position, but it means we will continue not to have an easy way to initiate a replica set in these cases.

      (2) Otherwise, to support a simple way to initiate even in these cases, let the user give just a "hostname:port" or "hostip:port" string. Patch attached.

      Strictly speaking, (2) is an incompatible change, since replSetInitiate currently ignores any non-document argument. (Probably it should have ignored only null arguments, but oh well.) So there's some quibbling possible about whether to do (2).

            Assignee:
            backlog-server-repl [DO NOT USE] Backlog - Replication Team
            Reporter:
            richard.kreuter Richard Kreuter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: