Editing corosync.conf

From Proxmox VE
Jump to: navigation, search
Yellowpin.svg Note: A similar guide like this will get into the Proxmox VE reference documentation, and will make this obsolete. Until this happened the articel will still be available.

WORK IN PROGRESS, follow and use at your own risks until this gets some form of validation!

Applies to PVE 4.*

The file corosync.conf plays an essential role in the cluster mechanism of PVE4.*. This file is formatted JSON-style and its functions replace those of the file cluster.conf (formatted XML-style) in previous version.

(I describe here the results of my multiple trials and errors...)

1 - Edit /etc/corosync/corosync.conf

Note: in fact, when corosync is active, it will update /etc/corosync/corosync.conf from /etc/pve/corosync.conf. Most documents therefore recommend creating, editing and renaming a copy of /etc/pve/corosync.conf into /etc/pve/ . However, this might in some cases (eg, failed cluster) be impossible because /etc/pve/ would be either empty or non-writeable.

  • of course make a backup first
  • never forget increasing config version number in totem { config_version: 99 }

2 - Check the content of /etc/pve/

  • if /etc/pve/corosync.conf is writeable, simply copy /etc/corosync/corosync.conf to /etc/pve/corosync.conf, then restart the service corosync... and some others (might be too much, but BSTS Better Safe Than Sorry)
service corosync restart
service pve-cluster restart
service pvedaemon restart
service pveproxy restart
  • if present but read-only... then your cluster is not OK, presumably because of a problem with corosync and/or some other configuration details which lead to a non-quorum condition.
stop corosync and switch to local-only mode:
service corosync stop
pmxcfs -l
You should get the message that it works "even though corosync.conf is already present"
If you get an error message "unable to get the lock"... check the presence of /var/lib/pve-cluster/.pmxcfs.lockfile and remove it, then re-issue pmxcfs -l
You are now ready to update corosync.conf and re-launch the cluster
cp /etc/corosync/corosync.conf /etc/pve/corosync.conf
service corosync start
service pve-cluster start
service pvedaemon restart
service pveproxy restart
  • if /etc/pve/ is empty (note to editors : not sure I remember correctly...) then your cluster has vanished somewhere, but you can still force /etc/pve/ to get populated...
pmxcfs -l
You should get the message that it works "even though corosync.conf is already present"
If you get an error message "unable to get the lock"... check the presence of /var/lib/pve-cluster/.pmxcfs.lockfile and remove it, then re-issue pmxcfs -l
You are now ready to update corosync.conf and re-launch the cluster
cp /etc/corosync/corosync.conf /etc/pve/corosync.conf
service corosync start
service pve-cluster start
service pvedaemon restart
service pveproxy restart

Remark: not sure if not needed to create /etc/pve/priv and /etc/pve/nodes if they are absent


Deprecated services / files in PVE 4.*

While you browse thru multiple web pages which mention the edition of corosync.conf, you will in fact most of the times read elements which relate to V2 and V3, but not to V4. They are no more relevant in V4, so don't try to use them... Forget about: cman, ccs_validate...