In a cluster, each Openfire node has an identifier (as defined by org.jivesoftware.openfire.XMPPServer#getNodeID). When not running in a cluster, a default value is used.
When switching to or from clustering, the ID value changes. This change should be propagated to all places where the previous value of the ID was used.
Currently, this is implemented at various places, which addressed issues at hand, without fixing the larger problem (See, for example, https://github.com/igniterealtime/Openfire/commit/178814f04b367c2f7db2317ca27e1a6552b09655). These implementations should be replaced by a more structured approach.