# OpenNebula 5.6 RAFT two nodes

**URL:** <https://forum.opennebula.io/t/opennebula-5-6-raft-two-nodes/6535>\
**Category:** Operations\
**Created:** [October 15, 2018, 4:29pm UTC](https://forum.opennebula.io/t/opennebula-5-6-raft-two-nodes/6535 "2018-10-15T16:29:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![razvanc](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@razvanc](https://forum.opennebula.io/u/razvanc)\
**Post date:** [October 15, 2018, 4:29pm UTC](https://forum.opennebula.io/t/opennebula-5-6-raft-two-nodes/6535/1 "2018-10-15T16:29:54Z")

</div>

Hello!

I’m running OpenNebula 5.6.1 on Debian 9, with two nodes in a HA scenario using RAFT. Everything runs OK until the leader fails (or is turn down using `systemctl`). When I shut the leader down (`systemctl stop opennebula`), the second node, which (I hope) should become leader, gets stuck in the `candidate` state:  
HA & FEDERATION SYNC STATUS  
ID NAME STATE TERM INDEX COMMIT VOTE FED\_INDEX  
0 10.0.0.2 error - - - - -  
1 10.0.0.3 candidate 1006 27400 0 -1 -1

The only logs I see are:  
Mon Oct 15 19:25:00 2018 [Z0][RCM][I]: Error requesting vote from follower 0:libcurl failed to execute the HTTP POST transaction, explaining: Failed to connect to 10.0.0.2 port 2633: Connection refused  
Mon Oct 15 19:25:00 2018 [Z0][RCM][I]: No leader found, starting new election in 2790ms

I am expecting to see these errors, since the leader node is down, but my expectations are also that the failover node (10.0.0.3) to take over and become leader. Are my expectations correct, or there is something wrong with my scenario?

Thank you!  
Răzvan

---

<div class="post-metadata">

**Author:** ![atodorov\_storpool](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/atodorov_storpool/32/5327_2.png) [@atodorov\_storpool](https://forum.opennebula.io/u/atodorov_storpool)\
**Post date:** [October 15, 2018, 6:37pm UTC](https://forum.opennebula.io/t/opennebula-5-6-raft-two-nodes/6535/2 "2018-10-15T18:37:23Z")

</div>

Hi @razvanc,

> [@razvanc](#):
>
> I’m running OpenNebula 5.6.1 on Debian 9, with two nodes in a HA scenario using RAFT

[OpenNebula recommends](http://docs.opennebula.org/5.6/advanced_components/ha/frontend_ha_setup.html?highlight=raft#requirements-and-architecture) 3 or 5 nodes

> [@razvanc](#):
>
> I am expecting to see these errors, since the leader node is down, but my expectations are also that the failover node (10.0.0.3) to take over and become leader. Are my expectations correct, or there is something wrong with my scenario?

The [RAFT consensus algorithm](https://raft.github.io/) needs to have `N/2+1` nodes available to create a quorum. The remaining node in your case is in split-brain situation waiting for other node(s) to become available to start the election.

Hope this helps.

Best Regards,  
Anton Todorov

---

<div class="post-metadata">

**Author:** ![razvanc](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@razvanc](https://forum.opennebula.io/u/razvanc)\
**Post date:** [October 16, 2018, 7:32am UTC](https://forum.opennebula.io/t/opennebula-5-6-raft-two-nodes/6535/3 "2018-10-16T07:32:31Z")

</div>

Hi, Anton!

Thank you for your prompt response! This was actually what I was thinking too, but I couldn’t pinpoint the hard requirement of having `N/2+1` nodes, I only saw the recommendation you pointed out. TBH, I didn’t read the [RAFT specifications](https://raft.github.io/), I am sorry about that!  
Do you know if there is a method of adding a 3rd, lightweight node (not an actual installment), just for ensuring consensus? Not sure whether only deploying a RAFT generic implementation will help, since it will still need to implement some of the OpenNebula logic.

Thanks,  
Răzvan

---

<div class="post-metadata">

**Author:** ![atodorov\_storpool](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/atodorov_storpool/32/5327_2.png) [@atodorov\_storpool](https://forum.opennebula.io/u/atodorov_storpool)\
**Post date:** [October 16, 2018, 8:26am UTC](https://forum.opennebula.io/t/opennebula-5-6-raft-two-nodes/6535/4 "2018-10-16T08:26:35Z")

</div>

Hi Razvan,

> [@razvanc](#):
>
> Do you know if there is a method of adding a 3rd, lightweight node (not an actual installment), just for ensuring consensus? Not sure whether only deploying a RAFT generic implementation will help, since it will still need to implement some of the OpenNebula logic.

I am not sure is it possible to add just a voting beacon. Please feel free to issue a [feature request](https://github.com/OpenNebula/one/issues) though.

Best Regards,  
Anton Todorov

---

<div class="post-metadata">

**Author:** ![razvanc](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@razvanc](https://forum.opennebula.io/u/razvanc)\
**Post date:** [October 16, 2018, 9:54am UTC](https://forum.opennebula.io/t/opennebula-5-6-raft-two-nodes/6535/5 "2018-10-16T09:54:34Z")

</div>

Done! One can follow the feature request [here](https://github.com/OpenNebula/one/issues/2510).

Thank you very much for your help!  
Răzvan

---

<div class="post-metadata">

**Author:** ![petr108m](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@petr108m](https://forum.opennebula.io/u/petr108m)\
**Post date:** [January 23, 2019, 8:58am UTC](https://forum.opennebula.io/t/opennebula-5-6-raft-two-nodes/6535/6 "2019-01-23T08:58:33Z")

</div>

status of feature  
Code committed to upstream release/hotfix branches

does it mean a possibility to download and install?  
can u provide details?

---

<div class="post-metadata">

**Author:** ![razvanc](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@razvanc](https://forum.opennebula.io/u/razvanc)\
**Post date:** [January 23, 2019, 11:39am UTC](https://forum.opennebula.io/t/opennebula-5-6-raft-two-nodes/6535/7 "2019-01-23T11:39:01Z")

</div>

According to the [ticket](https://github.com/OpenNebula/one/issues/2510), nothing was done yet - those are just bullets that need to be checked when completed.

---

<div class="post-metadata">

**Author:** ![ruben](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/ruben/32/19_2.png) [@ruben](https://forum.opennebula.io/u/ruben)\
**Post date:** [February 4, 2019, 9:39am UTC](https://forum.opennebula.io/t/opennebula-5-6-raft-two-nodes/6535/8 "2019-02-04T09:39:49Z")

</div>

Hi,

AFAIK this is not possible for RAFT. A node must be leader, follower or candidate. Note that log entries are committed once a majority of followers have replicated the entry, so the algorithm assumes that any of them could take the leadership in case of failure…

I guess the light way approach would be to create a VM with your third oned server running in it…

---

<div class="post-metadata">

**Author:** ![Bishop](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/bishop/32/6167_2.png) [@Bishop](https://forum.opennebula.io/u/Bishop)\
**Post date:** [July 24, 2019, 10:37pm UTC](https://forum.opennebula.io/t/opennebula-5-6-raft-two-nodes/6535/9 "2019-07-24T22:37:05Z")

</div>

> A node must be leader, follower or candidate.

No question there – any node should be able to take over as RAFT leader if another fails.

Who says **that** node needs to also be able to take over as oned leader? It seems knowing which oned is the leader is a piece of info that can be passed from raft node to node, without either of those nodes **being** that leader, in much the same way we all can agree which dog is my dog without any of us being my dog.
