diff --git a/src/ceph_osd.cc b/src/ceph_osd.cc index 6dc6c6d39dd..9c58ec3a791 100644 --- a/src/ceph_osd.cc +++ b/src/ceph_osd.cc @@ -370,9 +370,11 @@ int main(int argc, const char **argv) exit(1); // hb should bind to same ip as cluster_addr (if specified) - entity_addr_t hb_addr = g_conf->cluster_addr; - if (!hb_addr.is_blank_ip()) + entity_addr_t hb_addr = g_conf->osd_heartbeat_addr; + if (hb_addr.is_blank_ip()) { + hb_addr = g_conf->cluster_addr; hb_addr.set_port(0); + } r = messenger_hbserver->bind(hb_addr); if (r < 0) exit(1); diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 216feb6b89a..5a46002089e 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -283,6 +283,7 @@ OPTION(osd_remove_thread_timeout, OPT_INT, 60*60) OPTION(osd_command_thread_timeout, OPT_INT, 10*60) OPTION(osd_age, OPT_FLOAT, .8) OPTION(osd_age_time, OPT_INT, 0) +OPTION(osd_heartbeat_addr, OPT_ADDR, entity_addr_t()) OPTION(osd_heartbeat_interval, OPT_INT, 6) // (seconds) how often we ping peers OPTION(osd_heartbeat_grace, OPT_INT, 20) // (seconds) how long before we decide a peer has failed OPTION(osd_mon_heartbeat_interval, OPT_INT, 30) // (seconds) how often to ping monitor if no peers