From 5aaf99aba74109b2299b14254b17425f64e0024b Mon Sep 17 00:00:00 2001 From: sageweil Date: Wed, 19 Dec 2007 17:47:24 +0000 Subject: [PATCH] ms_hosts git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@2232 29311d96-e01e-0410-9327-a35deaab8ce9 --- branches/ebofs/config.cc | 3 +++ branches/ebofs/config.h | 1 + branches/ebofs/msg/SimpleMessenger.cc | 8 ++++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/branches/ebofs/config.cc b/branches/ebofs/config.cc index 6cbfb34ef4a57..9739f7b827b86 100644 --- a/branches/ebofs/config.cc +++ b/branches/ebofs/config.cc @@ -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& 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) diff --git a/branches/ebofs/config.h b/branches/ebofs/config.h index 6ce585a84437a..1fe7dc67cc978 100644 --- a/branches/ebofs/config.h +++ b/branches/ebofs/config.h @@ -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; diff --git a/branches/ebofs/msg/SimpleMessenger.cc b/branches/ebofs/msg/SimpleMessenger.cc index 37fda99feadec..f53403399878e 100644 --- a/branches/ebofs/msg/SimpleMessenger.cc +++ b/branches/ebofs/msg/SimpleMessenger.cc @@ -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; } } -- 2.39.5