I think there’s a pretty good video here to set up high availability (HA) on my Proxmox cluster.
This is my query to ChatGPT:
How to set up ha on my three-node proxmox cluster (pve1, pve2, and pve3) for automatic failover of my pihole dhcp server on pve1.
ChatGPT response:
Setting up high availability (HA) for your Pi-hole DHCP server on a three-node Proxmox cluster (pve1, pve2, pve3) ensures automatic failover if one node goes down. Here’s how you can achieve this:
1. Prerequisites
- Shared Storage:
- Ensure all Proxmox nodes have access to shared storage (e.g., NFS, Ceph, or iSCSI) for the Pi-hole VM or container.
- Alternatively, use Proxmox replication for local storage to synchronize disks between nodes.
- Cluster and Quorum:
- Your Proxmox cluster (pve1, pve2, pve3) must be fully configured with quorum enabled to manage HA resources.
pvecm status
- Your Proxmox cluster (pve1, pve2, pve3) must be fully configured with quorum enabled to manage HA resources.
- Pi-hole Setup:
- Install Pi-hole as a VM or LXC container on pve1.
- Configure Pi-hole’s DHCP and DNS settings.
- HA Configuration Package:
- Ensure HA management tools are installed on Proxmox:
apt install proxmox-ha-manager
- Ensure HA management tools are installed on Proxmox:
2. Configure Shared Storage
If you don’t have shared storage:
- Set Up NFS Storage:
- Install NFS on a NAS or a separate server.
- Add the shared storage in Proxmox:
- Go to Datacenter > Storage > Add > NFS.
- Provide the NFS server details and share path.
- Use Local Storage Replication:
- Enable storage replication between nodes for local storage (not real-time but effective for HA).
3. Move Pi-hole VM to Shared Storage
- Migrate the Pi-hole VM to shared storage:
qm move_disk <vmid> <storage_name>Replace<vmid>with your Pi-hole VM ID and<storage_name>with the shared storage ID. - Confirm the disk location:
qm config <vmid>
4. Enable HA for Pi-hole VM
- Add the VM to HA Resources:
- In the Proxmox web interface:
- Go to Datacenter > HA > Add > Virtual Machine.
- Select the Pi-hole VM and configure Failover priority.
- Or use the CLI:
ha-manager add vm:<vmid>
- In the Proxmox web interface:
- Check HA Status:
ha-manager status - Set VM Start Priority:
- Go to VM > Options and set the start/shutdown order.
5. Test HA Setup
- Shut down
pve1:shutdown -h now - Verify that the Pi-hole VM automatically starts on another node (e.g.,
pve2orpve3).
6. Additional Considerations
DNS Redundancy:
- Add a secondary Pi-hole instance for DNS failover.
- Configure it on another node (e.g.,
pve2). - Sync configurations between the two using tools like
rsyncorGravity Sync.
- Configure it on another node (e.g.,
Monitor DHCP Leases:
- Ensure DHCP leases persist after failover.
- Store the
dnsmasqlease file on shared storage or sync it between nodes using a script.
- Store the
Backup Configuration:
- Regularly back up the Pi-hole configuration and VM:
- Use Proxmox backup jobs to save VM snapshots.
Summary of Key Commands
- Add HA Resource:
ha-manager add vm:<vmid> - Check HA Status:
ha-manager status - Migrate Disk to Shared Storage:
qm move_disk <vmid> <storage_name>
Let me know if you’d like assistance with any specific part of this process!