How can i create one mysql cluster for have same ip and continue work with slave in case master node got one failover?

Hi all i need create one cluster of mysql with two different cluster that have one master and one slave and i need the container have mysql router with same ip and in case of failover the secondary continue work , i try follow this tutorial GitHub - robinong79/docker-swarm-mysql-masterslave-failover: Project to setup a MySQL Master-Slave cluster with failover and router but when i try simulate one failover the main container disappear and lost all and i got error when i try create volumes.

The repository is 6 years old and probably not compatible with current versions.

exist something of alternative?