]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ms_hosts
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 19 Dec 2007 17:47:24 +0000 (17:47 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 19 Dec 2007 17:47:24 +0000 (17:47 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@2232 29311d96-e01e-0410-9327-a35deaab8ce9

branches/ebofs/config.cc
branches/ebofs/config.h
branches/ebofs/msg/SimpleMessenger.cc

index 6cbfb34ef4a57e9f5ea1d09f66c525cbb5955e0a..9739f7b827b862bef619225a7e53155fa37d8e80 100644 (file)
@@ -157,6 +157,7 @@ md_config_t g_conf = {
   clock_tare: false,
   
   // --- messenger ---
+  ms_hosts: ".ceph_hosts",
   ms_tcp_nodelay: true,
   ms_retry_interval: 2.0,  // how often to attempt reconnect 
   ms_fail_interval: 15.0,  // fail after this long
@@ -502,6 +503,8 @@ void parse_config_options(std::vector<char*>& args)
     else if (strcmp(args[i], "--numosd") == 0) 
       g_conf.num_osd = atoi(args[++i]);
 
+    else if (strcmp(args[i], "--ms_hosts") == 0)
+      g_conf.ms_hosts = args[++i];
     else if (strcmp(args[i], "--ms_stripe_osds") == 0)
       g_conf.ms_stripe_osds = true;
     else if (strcmp(args[i], "--ms_skip_rank0") == 0)
index 6ce585a84437a194a34f092d82aa054cff5bdfec..1fe7dc67cc9780fafff9491356fd17203a01940b 100644 (file)
@@ -112,6 +112,7 @@ struct md_config_t {
   bool tcp_multi_dispatch;
   */
 
+  char *ms_hosts;
   bool ms_tcp_nodelay;
   double ms_retry_interval;
   double ms_fail_interval;
index 37fda99feadec94bd4bdd5f631f1ee4479dec3c7..f53403399878ee78432e68532bec96b159facf20 100644 (file)
@@ -96,9 +96,9 @@ int Rank::Accepter::start()
   dout(2) << "accepter.start my hostname is " << hostname << dendl;
 
   // is there a .ceph_hosts file?
-  {
+  if (g_conf.ms_hosts) {
     ifstream fh;
-    fh.open(".ceph_hosts");
+    fh.open(g_conf.ms_hosts);
     if (fh.is_open()) {
       while (1) {
        string line;
@@ -109,10 +109,10 @@ int Rank::Accepter::start()
        if (!ospace) continue;
        string host = line.substr(0, ospace);
        string addr = line.substr(ospace+1);
-       dout(15) << ".ceph_hosts: host '" << host << "' -> '" << addr << "'" << dendl;
+       dout(15) << g_conf.ms_hosts << ": host '" << host << "' -> '" << addr << "'" << dendl;
        if (host == hostname) {
          parse_ip_port(addr.c_str(), g_my_addr);
-         dout(1) << ".ceph_hosts: my addr is " << g_my_addr << dendl;
+         dout(1) << g_conf.ms_hosts << ": my addr is " << g_my_addr << dendl;
          break;
        }
       }