]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds, osd, synclient: Pick cluster_addr/public_addr based on *_network.
authorTommi Virtanen <tv@eagain.net>
Mon, 21 Nov 2011 21:32:45 +0000 (13:32 -0800)
committerTommi Virtanen <tv@eagain.net>
Mon, 21 Nov 2011 22:27:45 +0000 (14:27 -0800)
Instead of specifying an IP address in ceph.conf like

[global]
cluster_addr = 10.1.2.3

you can now avoid the node-specific configuration and just say

[global]
cluster_network = 10.1.2.0/24

The *_network variables can also take a whitespace-separated list of
networks, to be checked in that order:

[global]
cluster_network = 10.1.2.0/24 192.168.42.192/26

src/ceph_mds.cc
src/ceph_osd.cc
src/ceph_syn.cc

index 1ba4389453730a2f83b28d9c7309a797172ee112..0e3975a666f6a395d4550171ac090ff2e06653b5 100644 (file)
@@ -34,6 +34,7 @@ using namespace std;
 #include "common/Timer.h"
 #include "global/global_init.h"
 #include "common/ceph_argparse.h"
+#include "common/pick_address.h"
 
 #include "mon/MonClient.h"
 
@@ -194,6 +195,8 @@ int main(int argc, const char **argv)
     }
   }
 
+  pick_addresses(g_ceph_context);
+
   // Check for special actions
   if (!action.empty()) {
     return do_cmds_special_action(action, dump_file, rank);
index 0cfd6f0931fa61686ce4a6752031e7400097682d..0bcec16607faede974c811df82f1f03354d98731 100644 (file)
@@ -38,6 +38,7 @@ using namespace std;
 
 #include "include/color.h"
 #include "common/errno.h"
+#include "common/pick_address.h"
 
 #include "perfglue/heap_profiler.h"
 
@@ -235,6 +236,8 @@ int main(int argc, const char **argv)
     exit(1);
   }
 
+  pick_addresses(g_ceph_context);
+
   if (g_conf->public_addr.is_blank_ip() && !g_conf->cluster_addr.is_blank_ip()) {
     derr << TEXT_YELLOW
         << " ** WARNING: specified cluster addr but not public addr; we recommend **\n"
index 09ab7db1c28a8ac776b3f98206be5b420d7c72ca..428724fc92c05e89923723a5a49b41b3ca77daf1 100644 (file)
@@ -29,6 +29,7 @@ using namespace std;
 #include "common/Timer.h"
 #include "global/global_init.h"
 #include "common/ceph_argparse.h"
+#include "common/pick_address.h"
 
 #if !defined(DARWIN) && !defined(__FreeBSD__)
 #include <envz.h>
@@ -51,6 +52,8 @@ int main(int argc, const char **argv, char *envp[])
 
   parse_syn_options(args);   // for SyntheticClient
 
+  pick_addresses(g_ceph_context);
+
   vec_to_argv(args, argc, argv);
 
   // get monmap