In some setup, binding to public_addr causes error:
NetHandler create_socket couldn't create socket (97) Address family not supported by protocol
Fixes: https://tracker.ceph.com/issues/41034
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
(cherry picked from commit
6d2d51499838dc5f34376c6605ec246db3547ceb)
Conflicts:
src/ceph_syn.cc
- in nautilus, the immediately succeeding "new MonClient()" call has
a different number of arguments, but this is irrelevant to the
backport at hand
src/tools/cephfs/MDSUtility.cc
- in nautilus, there is no line "poolctx.start(1);" following the
deleted messenger->bind() call
for (int i=0; i<num_client; i++) {
messengers[i] = Messenger::create_client_messenger(g_ceph_context,
"synclient");
- messengers[i]->bind(g_conf()->public_addr);
mclients[i] = new MonClient(g_ceph_context);
mclients[i]->build_initial_monmap();
auto client = new StandaloneClient(messengers[i], mclients[i]);
int MDSUtility::init()
{
// Initialize Messenger
- int r = messenger->bind(g_conf()->public_addr);
- if (r < 0)
- return r;
-
messenger->start();
objecter->set_client_incarnation(0);
monc->set_want_keys(CEPH_ENTITY_TYPE_MON|CEPH_ENTITY_TYPE_OSD|CEPH_ENTITY_TYPE_MDS);
monc->set_messenger(messenger);
monc->init();
- r = monc->authenticate();
+ int r = monc->authenticate();
if (r < 0) {
derr << "Authentication failed, did you specify an MDS ID with a valid keyring?" << dendl;
monc->shutdown();