Clustering Proxmox with Three Nodes
This guide is not fully tested, and subject to change.
Introduction
Clustering Proxmox provides high availability and load balancing for virtual machines and containers. With a minimum of three nodes, you can create a resilient cluster capable of tolerating the failure of a single node without downtime.
Why Three Nodes?
Proxmox recommends a minimum of three nodes for a cluster due to several reasons:
-
Fault Tolerance: With three nodes, the cluster can continue operating even if one node fails. Each node acts as a redundant backup for the others, ensuring that services remain available in the event of hardware failure or maintenance.
-
Quorum Requirement: Proxmox clusters use a quorum algorithm to ensure data integrity and prevent split-brain scenarios. A cluster with an odd number of nodes (e.g., three) ensures that there is always a majority to establish quorum and make decisions about resource allocation and failover.
-
Load Distribution: Three nodes allow for better distribution of virtual machines and containers across the cluster. This helps prevent resource contention and improves overall performance by spreading the workload evenly.
-
Scalability: While three nodes are the minimum for a Proxmox cluster, additional nodes can be added for increased scalability and redundancy. However, starting with three nodes provides a solid foundation for building a resilient infrastructure.
Prerequisites
- Three Physical Servers: Each server should meet the minimum hardware requirements for Proxmox VE.
- Proxmox VE ISO: Download the latest Proxmox VE ISO from the official website.
- Network Configuration: Ensure that each server has a unique hostname, IP address, and is connected to a network accessible by all nodes.
Step-by-Step Guide
Install Proxmox VE on Each Node
If you require assistance with the installation of Proxmox VE, we have a detailed guide covering the installation process step-by-step here.
- Boot each server from the Proxmox VE ISO.
- Follow the on-screen instructions to install Proxmox VE on each server.
- Ensure that the network configuration is correctly set up during the installation process.
Configure Network Time Protocol (NTP) (Optional)
- Log in to each Proxmox node via SSH or the console.
- Edit the NTP configuration file:
sudo nano /etc/systemd/timesyncd.conf
- Add NTP servers or use the default ones:
NTP=your.ntp.server
- Save and exit the file.
- Restart the systemd-timesyncd service:
sudo systemctl restart systemd-timesyncd
Configure Hostname Resolution
- Edit the hosts file on each node:
sudo nano /etc/hosts
- Add entries for each node:
<node1_IP> <node1_hostname>
<node2_IP> <node2_hostname>
<node3_IP> <node3_hostname>
- Save and exit the file.
Set Up SSH Key Authentication
- Generate an SSH key pair on the first node (replace <your_email> with your actual email address):
ssh-keygen -t rsa -b 4096 -C "[email protected]"
- Copy the public key to the other nodes:
ssh-copy-id user@node2_IP
ssh-copy-id user@node3_IP
- Test SSH access to each node to ensure key authentication works.
Create Proxmox Cluster
- Log in to the Proxmox web interface of one node using a web browser.
- Navigate to Datacenter > Cluster.
- Click Create Cluster and enter a name for the cluster.
- Add the other nodes to the cluster using their IP addresses and SSH credentials.
- Confirm the addition of each node.
Verify Cluster Configuration
- In the Proxmox web interface, navigate to Datacenter > Cluster.
- Ensure that all nodes are listed and have a status of "online".
- Verify that shared storage is available and accessible from all nodes.
Configure High Availability (HA)
- In the Proxmox web interface, navigate to Datacenter > HA.
- Click Enable HA and follow the on-screen instructions to configure fencing and other settings.
- Ensure that HA resources are distributed evenly across all nodes.
Test Failover
For failover to function correctly, you need to setup shared storage. Proxmox supports various storage types, including NFS, Ceph, and iSCSI. We have a guide on settings up shared storage with Ceph on Proxmox here.
- Create a test virtual machine or container on one of the nodes.
- Simulate a node failure by shutting down or disconnecting one of the nodes.
- Monitor the Proxmox web interface to ensure that the virtual machine/container fails over to another node automatically.
- Verify that there is no downtime for the virtual machine/container.
Conclusion
By following this guide, you've successfully set up a Proxmox cluster with a minimum of three nodes, providing high availability and resilience to node failures. You can now deploy and manage virtual machines and containers with confidence.
Happy virtualizing!