From: Tommi Virtanen Date: Mon, 21 Nov 2011 21:32:45 +0000 (-0800) Subject: mds, osd, synclient: Pick cluster_addr/public_addr based on *_network. X-Git-Tag: v0.39~17^2~11^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c066e92638733d19aea8da6a70d26509e033f6a1;p=ceph.git mds, osd, synclient: Pick cluster_addr/public_addr based on *_network. 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 --- diff --git a/src/ceph_mds.cc b/src/ceph_mds.cc index 1ba4389453730..0e3975a666f6a 100644 --- a/src/ceph_mds.cc +++ b/src/ceph_mds.cc @@ -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); diff --git a/src/ceph_osd.cc b/src/ceph_osd.cc index 0cfd6f0931fa6..0bcec16607fae 100644 --- a/src/ceph_osd.cc +++ b/src/ceph_osd.cc @@ -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" diff --git a/src/ceph_syn.cc b/src/ceph_syn.cc index 09ab7db1c28a8..428724fc92c05 100644 --- a/src/ceph_syn.cc +++ b/src/ceph_syn.cc @@ -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 @@ -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