Comments - Simple cluster two nodes, error.
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
I think your concepts aren't right. Galera is already multiple master.
Use at least 3 nodes with galera to get some PRIMARY consensus if a node is down.
Use existing HA tools like corosync/pacemaker with a galera resource agent https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/galera if you want to configure a IP (IPAddr2 resource) to co-locate with a "master" to achieve transparent results for your application.