How to create a Proxmox Two-Node cluster

how-to-create-proxmox-two-node-cluster-01

If a Proxmox Two-Node cluster is configured without a third node, you may face issues in case one node fails or the cluster enters a split-brain scenario.

As a best practice, even a Two-Node cluster requires a third node to act as quorum. This can be easily achieved by using an additional computer with the corosync-qnetd package installed. A mini-PC, a Raspberry Pi, and similar devices are great examples of what can be used as a QDevice.

 

Create the Proxmox Two-Node cluster

To create the cluster, you should already have two Proxmox nodes set up with the latest version installed.

Login to the Node 1 by entering the root credentials and click Login.

Proxmox Two-Node cluster 1

Navigate to Datacenter > Cluster and click Create Cluster.

Proxmox Two-Node cluster 2

Enter a Cluster Name and select the Cluster Network for corosync traffic. Click Create.

Proxmox Two-Node cluster 3

The cluster is being created.

Proxmox Two-Node cluster 4

Once created, click Join Information.

Proxmox Two-Node cluster 5

Click Copy Information to copy details required for Node 2.

Proxmox Two-Node cluster 6

Login to Node 2 and navigate to Datacenter > Cluster. Click Join Cluster.

Proxmox Two-Node cluster 7

Paste the information into Information field, enter the root Password of Node 1, select the Cluster Network used for corosync traffic and click Join <cluster_name>.

Proxmox Two-Node cluster 8

Node 2 will now join the Proxmox cluster.

Proxmox Two-Node cluster 9

Back on Node 1 and verify that Node 2 has been added successfully.

Proxmox Two-Node cluster 10

Access the Shell on either node and run the following command to check the status:

# pvecm status

Proxmox Two-Node cluster 11

The output of the pvecm status command in the Proxmox VE Shell on Node 1, shows the cluster information, quorum status with 2 expected votes, and membership details for both nodes.

In a Proxmox Two-Node Cluster if the network connection between the two nodes is interrupted, neither node maintains quorum. A Proxmox Two-Node cluster requires 2 votes, meaning each node has 1 vote.

If the link drops, both nodes lose contact with each other, dropping below the required quorum threshold. As a result, cluster services freeze or stop to prevent a split-brain scenario where both nodes try to modify the same storage simultaneously.

 

Install the Proxmox Qdevice

You can use almost any computer as a QDevice, as network traffic is very minimal and its sole purpose is to cast a vote for the Proxmox cluster quorum.

In this example, Ubuntu Linux is used as the operating system.

First, ensure that a static IP address has been configured on the Ubuntu machine for Corosync communication.

# ip a

Proxmox Two-Node cluster 12

Login to the Qdevice and update the Ubuntu OS.

# sudo apt update && sudo apt upgrade

Proxmox Two-Node cluster 13

Install the corosync-qnetd package which enables communication with the Proxmox Two-Node cluster.

# sudo apt install corosync-qnetd

Proxmox Two-Node cluster 14

Enable and start the QNetd service.

# sudo systemctl enable --now corosync-qnetd

Proxmox Two-Node cluster 15

Since the setup command from Proxmox requires a direct SSH access to the Qdevice, you must enable root login.

If you haven't set a root password yet, configure the root password.

# sudo su
# passwd

Proxmox Two-Node cluster 16

Enable root login in the SSH configuration file.

# sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config

Proxmox Two-Node cluster 17

Restart the SSH service to apply the changes.

# sudo systemctl restart ssh

Proxmox Two-Node cluster 18

Now edit /etc/hosts  for local name resolution.

# sudo vi /etc/hosts

Proxmox Two-Node cluster 19

Add the DNS entries corresponding to your Proxmox cluster nodes and the Qdevice itself.

192.168.20.120 pve01.nolabnoparty.lab pve01
192.168.20.121 pve02.nolabnoparty.lab pve02
192.168.20.125 pve-qdevice.nolabnoparty.lab pve-qdevice

Proxmox Two-Node cluster 20

The Qdevice is now ready to be connected to the Proxmox cluster.

 

Join the Qdevice to the cluster

Ensure that the /etc/hosts entries are configured correctly on both Proxmox nodes.

Proxmox Two-Node cluster 21

Install the corosync-qdevice package on both Proxmox nodes.

# apt install corosync-qdevice

Proxmox Two-Node cluster 22

From Node 1 only, run the setup command using the Qdevice IP Address.

# pvecm qdevice setup 192.168.20.125

Proxmox Two-Node cluster 23

The Qdevice is now a member of the cluster and acts as an active component for quorum voting.

# pvecm status

Proxmox Two-Node cluster 24

With this configuration in place, the Proxmox Two-Node cluster now follows best practices and safely avoid split-brain scenarios.

signature

Leave a Reply