Setup cluster (raft) between 2 different servers?

Hello! We are looking for a way to setup a cluster, 2 servers, one being leader and one being the follower. Using raft.

We have 2 servers setup using Centos8/rhel and by following the guide Vault HA Cluster with Integrated Storage | Vault - HashiCorp Learn all works fine when setting it up on one server running all 4.

However we want it so we have vault_1 as leader on server A and vault_2 as follower on server B.

But, it seems like quite the task for poor me, since the “cluster.sh” basically does everything “automatically” for you, and I can’t follow a step by step (or find a guide for it) when it comes to having a cluster on 2 separate servers.

Also tried doing it manually using the yum install vault package.

Any tips or links to a source that does a cluster setup on 2 servers?

Cheers!

You’re mixing up terms and concepts.

You don’t setup leader and follower… you setup an odd number of nodes, the nodes pick who’s leader and who’s standby. You can’t force a node to be a leader.

Vault HA, simply means there are multiple nodes that can be leader. You can use DNS round robin or a smart load balancer in front of them to get you a VIP/single DNS.

Okay let me rephrase,

We have 2 physical servers, we would like to run one node on server A, and 2 nodes on server B, incase server A goes down we can still access vault.

Or; what you are saying is, that it’s not possible to have a cluster spread out on 2 physical servers out of the box? HA is only available on running on 1 physical server, regardless of how many nodes you have.

I’m not sure how you got that from my post. You can run however many instances of vault you want on as many or few machines (physical or virtual) as you want (would need to use different ports if you run them on the same machine/OS). It doesn’t make any sense on running them on the same machine but that’s up to you.

What you cannot do is tell one instance, “you be leader”. When the cluster comes up and it finds all of it’s buddy instances on the same network, they will have a “raft” conversation and decide on which one will be leader node, the rest will be standby. You have no control over which one is which.