canal to achieve mysql data synchronization

Mysql Video TutorialThe column introduces data synchronization based on canal. Based on the above explanation, before implementing canal, we simply do a master-slave replication. One master, one slave First download the mysql image and start docker pull mysql:latest docker run -itd –name mysql-1 -p 23306:3306 -e MYSQL_ROOT_PASSWORD=root mysql docker run -itd –name mysql-2 -p 23307:3306 -e MYSQL_ROOT_PASSWORD=root mysql Related commands explain: name xxx :xxx is the container name p 111:222 where 111 is the host port and 222 is the container port MYSQL_ROOT_PASSWORD=root Set the root account password to root Set mysql-1 as the master and mysql-2 as the slave library Modify the configuration of mysql and install the vim editor apt-get update apt-get install vim Create a mysql account in the main library for use by the slave library CREATE USER & # 39; slave & # 39; @ & # 39; % & # 39; IDENTIFIED BY & # 39; 123456 & # 39;; GRANT REPLICATION SLAVE, REPLICATION CLIENT ON . TO 'slave'@'%'; FLUSH PRIVILEGES; Modify the slave server [mysqld] pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock datadir = /var/lib/mysql secure-file-priv= NULL server_id=100 log-bin=mysql-slave-bin relay_log=edu-mysql-relay-bin Exit and restart slave server docker Enter slave server execution mysql> change master to…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索