]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
monclient: name resolved mon hosts noname-* too
authorSage Weil <sage@newdream.net>
Tue, 1 May 2012 20:15:11 +0000 (13:15 -0700)
committerSage Weil <sage@inktank.com>
Fri, 18 May 2012 23:21:37 +0000 (16:21 -0700)
This would allow you to do

  mon host = foo, bar, baz

or

  mon host = multiarecordhostname.foo.com

and have the generated monmap tag monitors as noname-, so that the ceph-mon
mkfs will identify itself as one of them and initialize itself
properly.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/MonClient.cc

index 1c8a77b3119dc90d9e3769a069e5dea1db491ee7..e0aebb82fb457dd7c25aeb5ab5404d77cc842032 100644 (file)
@@ -130,7 +130,9 @@ int MonClient::build_initial_monmap(CephContext *cct, MonMap &monmap)
           n[1] = 0;
           if (addrs[i].get_port() == 0)
             addrs[i].set_port(CEPH_MON_PORT);
-          monmap.add(n, addrs[i]);
+         string name = "noname-";
+         name += n;
+          monmap.add(name, addrs[i]);
         }
         return 0;
       } else cerr << "couldn't parse_ip_port_vec on " << hosts << std::endl;