-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mon: allow monitor to automagically join cluster
If a monitor starts up with the correct fsid and auth keys, it will now add itself to the monmap (and subsequently try to join the quorum) if it is not already in the monmap. Signed-off-by: Sage Weil <[email protected]>
- Loading branch information
Showing
7 changed files
with
114 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- | ||
// vim: ts=8 sw=2 smarttab | ||
/* | ||
* Ceph - scalable distributed file system | ||
* | ||
* Copyright (C) 2004-2006 Sage Weil <[email protected]> | ||
* | ||
* This is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License version 2.1, as published by the Free Software | ||
* Foundation. See file COPYING. | ||
* | ||
*/ | ||
|
||
#ifndef CEPH_MMONJOIN_H | ||
#define CEPH_MMONJOIN_H | ||
|
||
#include "messages/PaxosServiceMessage.h" | ||
|
||
#include <vector> | ||
using std::vector; | ||
|
||
class MMonJoin : public PaxosServiceMessage { | ||
public: | ||
ceph_fsid_t fsid; | ||
string name; | ||
entity_addr_t addr; | ||
|
||
MMonJoin() : PaxosServiceMessage(MSG_MON_JOIN, 0) {} | ||
MMonJoin(ceph_fsid_t &f, string n, entity_addr_t a) | ||
: PaxosServiceMessage(MSG_MON_JOIN, 0), | ||
fsid(f), name(n), addr(a) | ||
{ } | ||
|
||
private: | ||
~MMonJoin() {} | ||
|
||
public: | ||
const char *get_type_name() { return "mon_join"; } | ||
void print(ostream& o) { | ||
o << "mon_join(" << name << " " << addr << ")"; | ||
} | ||
|
||
void encode_payload(CephContext *cct) { | ||
paxos_encode(); | ||
::encode(fsid, payload); | ||
::encode(name, payload); | ||
::encode(addr, payload); | ||
} | ||
void decode_payload(CephContext *cct) { | ||
bufferlist::iterator p = payload.begin(); | ||
paxos_decode(p); | ||
::decode(fsid, p); | ||
::decode(name, p); | ||
::decode(addr, p); | ||
} | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters