1
0
Fork 0

Merge branch 'devel' of https://github.com/arangodb/arangodb into devel

This commit is contained in:
Kaveh Vahedipour 2016-06-27 13:37:11 +02:00
commit 5326e35b3b
2 changed files with 20 additions and 16 deletions

View File

@ -21,16 +21,16 @@ To start up the agency in its fault tolerant mode set the `--agency.size` to `3`
So in summary this is what your startup might look like:
```
build/bin/arangod --server.endpoint tcp://0.0.0.0:5001 --server.authentication false --agency.id 0 --agency.size 3 agency1 &
build/bin/arangod --server.endpoint tcp://0.0.0.0:5002 --server.authentication false --agency.id 1 --agency.size 3 agency2 &
build/bin/arangod --server.endpoint tcp://0.0.0.0:5003 --server.authentication false --agency.id 2 --agency.size 3 --agency.endpoint tcp://127.0.0.1:5001 --agency.endpoint tcp://127.0.0.1:5002 --agency.endpoint tcp://127.0.0.1:5003 --agency.notify true agency3 &
build/bin/arangod --server.endpoint tcp://0.0.0.0:5001 --server.authentication false --agency.id 0 --agency.size 3 agency1 --agency.supervision true &
build/bin/arangod --server.endpoint tcp://0.0.0.0:5002 --server.authentication false --agency.id 1 --agency.size 3 agency2 --agency.supervision true &
build/bin/arangod --server.endpoint tcp://0.0.0.0:5003 --server.authentication false --agency.id 2 --agency.size 3 --agency.endpoint tcp://127.0.0.1:5001 --agency.endpoint tcp://127.0.0.1:5002 --agency.endpoint tcp://127.0.0.1:5003 --agency.notify true agency3 --agency.supervision true &
```
Note in particular that the endpoint descriptions given under `--agency.endpoint` must not use the IP address `0.0.0.0` because they must contain an actual address that can be routed to the corresponding server. The `0.0.0.0` in `--server.endpoint` simply means that the server binds itself to all available network devices with all available IP addresses.
If you are happy with a single agent, then simply use a single command like this:
```
build/bin/arangod --server.endpoint tcp://0.0.0.0:5001 --server.authentication false --agency.id 0 --agency.size 1 --agency.endpoint tcp://127.0.0.1:5001 agency1 &
build/bin/arangod --server.endpoint tcp://0.0.0.0:5001 --server.authentication false --agency.id 0 --agency.size 1 --agency.endpoint tcp://127.0.0.1:5001 agency1 --agency.supervision true &
```
Furthermore, in the following sections when `--cluster.agency-address` is used multiple times to specify all three agent addresses, just use a single option ```--cluster.agency.address tcp://127.0.0.1:5001``` instead.

View File

@ -193,22 +193,26 @@ void Constituent::follow(term_t t) {
/// Become leader
void Constituent::lead(std::vector<bool> const& votes) {
MUTEX_LOCKER(guard, _castLock);
{
MUTEX_LOCKER(guard, _castLock);
if (_role != LEADER) {
std::stringstream ss;
ss << _id << ": Converted to leader in term " << _term << " with votes (";
for (auto const& vote : votes) {
ss << vote;
if (_role == LEADER) {
return;
}
ss << ")";
LOG_TOPIC(DEBUG, Logger::AGENCY) << ss.str();
_agent->lead(); // We need to rebuild spear_head and read_db;
_role = LEADER;
_leaderID = _id;
}
std::stringstream ss;
ss << _id << ": Converted to leader in term " << _term << " with votes (";
for (auto const& vote : votes) {
ss << vote;
}
ss << ")";
_role = LEADER;
_leaderID = _id;
LOG_TOPIC(DEBUG, Logger::AGENCY) << ss.str();
_agent->lead(); // We need to rebuild spear_head and read_db;
}