Hi, I have build an ns8 node, when I try to join this node to the cluster it fails with an error message:
add_node error: <4>The public key “node 1 public key” is already used by node 1
The proxmox template was build from the .qcow on the download page. Ns8 is pre-installed on rocky-9. The new node is a VM build from the same template I used for the cluster leader node(1).
Is there a way to recreate a new (unique) public/private key pair for this node?
(umask 0077; wg genkey | tee /etc/nethserver/wg0.key | wg pubkey) | tee /etc/nethserver/wg0.pub
That command creates 2 files in /etc/nethserver/ - private key wg0.key and public key wg0.pub.
The content of /etc/nethserver/wg0.key needs to be set in /etc/wireguard/wg0.conf:
PrivateKey = <wg private key>
If you change keys on the leader node, I think the public key from /etc/nethserver/wg0.pub needs to be set in the redis database, see also Database | NS8 dev manual
redis-cli hset node/1/vpn public_key <wg public key>
Reload the wireguard service to apply the new config: