An interesting attempt to learn mysql repliction and proxy.
-
Create slave user in master, used to visit master node in salve. You need grant replication slave privileges.
-
Make sure that all databases needed to do replication is same in master and slaves;
-
Set mysql config. The key fields are
bind-address
,server-id
,log_bin
,binlog_do_db
, andrelay-log
(only in slaves) etc. -
Run start commands.
CHANGE MASTER ...
andSTART SLAVE
.
- how-to-set-up-master-slave-replication-in-mysql
- You can't restrict GRANT REPLICATION SLAVE to only one database
- MySQL Load Balancing with HAProxy
- High availability read-write splitting with php-mysqlnd, MySQL Replication and HAProxy
- How To Use HAProxy to Set Up MySQL Load Balancing
- Mysql Replication基本原理