Hi everyone, I’m completely new in Vault world so I apologize if I ask some dumb questions.
I wat to setup a Vault cluster with 3 nodes with local Raft storage. I am following the documentation as much as I can but I am not quite getting there in terms of joining second node to the Active node as a Standby.
On my Node 1 I have the following config for Vault
disable_mlock="true"
storage "raft" {
path = "/home/myUser/vault/data"
node_id = "vault-server-1"
retry_join {
leader_api_addr = "https://vault-server-1:8200"
leader_client_cert_file = "/home/myUser/etc/vault-server-1.crt"
leader_client_key_file = "/home/myUser/etc/vault-server-1.private.key"
}
retry_join {
leader_api_addr = "https://vault-server-2:8200"
leader_client_cert_file = "/home/myUser/etc/vault-server-1.crt"
leader_client_key_file = "/home/myUser/etc/vault-server-1.private.key"
}
retry_join {
leader_api_addr = "https://vault-server-1:8200"
leader_client_cert_file = "/home/myUser/etc/vault-server-1.crt"
leader_client_key_file = "/home/myUser/etc/vault-server-1.private.key"
}
}
seal "transit" {
address = "http://vault-server-0:8200"
token = "s.XXXXXXXXXXXXXXXXXXXXX"
key_name = "unseal-key"
mount_path = "transit"
}
listener "tcp" {
address = "0.0.0.0:8200"
tls_cert_file = "/home/myUser/etc/vault-server-1.crt"
tls_key_file = "/home/myUser/etc/vault-server-1.private.key"
}
api_addr = "https://vault-server-1:8200"
cluster_addr = "https://vault-server-1:8201"
ui = true
I start the vault as per normal and I have the following status:
Key Value
--- -----
Recovery Seal Type shamir
Initialized true
Sealed false
Total Recovery Shares 5
Threshold 3
Version 1.9.3
Storage Type raft
Cluster Name vault-cluster-e11d29d8
Cluster ID efed540d-9ae5-a071-7a52-8679847446cb
HA Enabled true
HA Cluster https://vault-server-1:8201
HA Mode active
Active Since 2022-03-22T17:43:58.458859304Z
Raft Committed Index 353
Raft Applied Index 353
In the secondary node I have same config only node_id, api_addr and cluster_addr are respectively vault-server-2.
and vault status is as follows:
Key Value
--- -----
Recovery Seal Type shamir
Initialized true
Sealed false
Total Recovery Shares 5
Threshold 3
Version 1.9.3
Storage Type raft
Cluster Name vault-cluster-2cc97a0c
Cluster ID 042cd5bd-5256-4f78-ea1a-35dafacbc068
HA Enabled true
HA Cluster https://vault-server-2:8201
HA Mode active
Active Since 2022-03-30T11:23:36.359872379Z
Raft Committed Index 86
Raft Applied Index 86
So both are in Active state, so how do I add server 2 as a standby for Active server 1 ?
As I understand I need to run something like this on server 2 ?
vault operator raft join https://vault-server-1:8200
it gives me the following result:
Key Value
--- -----
Joined true
But when I check the following on server 2 it’s still a leader:
~ > vault operator raft list-peers
Node Address State Voter
---- ------- ----- -----
vault-server-2 vault-server-2:8201 leader true
What am I doing wrong ?
Have to say in most of examples it’s recommended to use Consul, but I want to keep it more simple with Raft…
Please any advise ?