Some checks failed
Test / test (push) Has been cancelled
Co-authored-by: Cursor <cursoragent@cursor.com>
4.4 KiB
4.4 KiB
Update Proxmox Cluster IP Addresses
Overview
When a Proxmox node's IP address changes, you need to update the cluster configuration so nodes can communicate with each other.
Current IP Addresses
- pve (ML110): 192.168.1.207
- pve2 (R630): 192.168.1.55
Files to Update
/etc/hosts- Hostname resolution/etc/pve/corosync.conf- Cluster communication configuration
Manual Update Steps
Step 1: Update /etc/hosts on Both Nodes
On pve (ML110 - 192.168.1.207):
# Edit /etc/hosts
nano /etc/hosts
# Add or update entry for pve2:
192.168.1.55 pve2 pve2.local
# Save and exit
On pve2 (R630 - 192.168.1.55):
# Edit /etc/hosts
nano /etc/hosts
# Add or update entry for pve:
192.168.1.207 pve pve.local
# Save and exit
Step 2: Update corosync.conf on Both Nodes
On pve (ML110):
# Backup first
cp /etc/pve/corosync.conf /etc/pve/corosync.conf.backup
# Edit corosync.conf
nano /etc/pve/corosync.conf
# Find the node entries and update ring0_addr:
# Change pve2's ring0_addr to: 192.168.1.55
# Keep pve's ring0_addr as: 192.168.1.207
# Example corosync.conf:
totem {
version: 2
cluster_name: your-cluster-name
config_version: 2
interface {
ringnumber: 0
bindnetaddr: 192.168.1.0
mcastport: 5405
ttl: 1
}
}
nodelist {
node {
name: pve
nodeid: 1
quorum_votes: 1
ring0_addr: 192.168.1.207
}
node {
name: pve2
nodeid: 2
quorum_votes: 1
ring0_addr: 192.168.1.55
}
}
quorum {
provider: corosync_votequorum
}
logging {
to_logfile: yes
logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
On pve2 (R630):
# Backup first
cp /etc/pve/corosync.conf /etc/pve/corosync.conf.backup
# Edit corosync.conf
nano /etc/pve/corosync.conf
# Update ring0_addr entries as shown above
Step 3: Restart Cluster Services
On BOTH nodes, restart cluster services:
systemctl restart corosync
systemctl restart pve-cluster
Important: Restart on one node at a time, wait for it to stabilize, then restart on the other node.
Step 4: Verify Cluster Status
On either node:
# Check cluster status
pvecm status
# List nodes
pvecm nodes
# Check cluster membership
corosync-quorumtool -s
Automated Update Script
Use the provided script to automate the update:
cd infrastructure/proxmox
./update-cluster-ips.sh
This script will:
- Backup existing files
- Update /etc/hosts on both nodes
- Update corosync.conf on both nodes
- Optionally restart cluster services
Quick Update Commands
Update /etc/hosts Only
On pve (ML110):
grep -q "pve2" /etc/hosts && \
sed -i 's/.*pve2/192.168.1.55 pve2 pve2.local/' /etc/hosts || \
echo "192.168.1.55 pve2 pve2.local" >> /etc/hosts
On pve2 (R630):
grep -q "pve" /etc/hosts && \
sed -i 's/.*pve /192.168.1.207 pve pve.local /' /etc/hosts || \
echo "192.168.1.207 pve pve.local" >> /etc/hosts
Update corosync.conf ring0_addr
On both nodes:
# Backup
cp /etc/pve/corosync.conf /etc/pve/corosync.conf.backup
# Update pve IP
sed -i 's/ring0_addr:.*pve$/ring0_addr: 192.168.1.207/' /etc/pve/corosync.conf
# Update pve2 IP
sed -i 's/ring0_addr:.*pve2$/ring0_addr: 192.168.1.55/' /etc/pve/corosync.conf
# Verify changes
grep ring0_addr /etc/pve/corosync.conf
Verification
After updating, verify on both nodes:
# Check /etc/hosts
cat /etc/hosts | grep -E "pve|pve2"
# Check corosync.conf
grep ring0_addr /etc/pve/corosync.conf
# Check cluster connectivity
ping -c 3 pve2 # On pve
ping -c 3 pve # On pve2
# Check cluster status
pvecm status
Troubleshooting
Cluster Services Won't Start
# Check logs
journalctl -u corosync -n 50
journalctl -u pve-cluster -n 50
# Check configuration syntax
corosync-cfgtool -R
Nodes Can't See Each Other
- Verify IP addresses are correct in both files
- Check firewall isn't blocking ports 5405 (corosync) and 2224 (pve)
- Ensure both nodes are on same network segment
- Try restarting services one at a time
Rollback
If something goes wrong:
# Restore backups
cp /etc/pve/corosync.conf.backup /etc/pve/corosync.conf
cp /etc/hosts.backup.* /etc/hosts
# Restart services
systemctl restart corosync
systemctl restart pve-cluster