Initializing MySQL Router
- Initialize MySQL Router.
mysqlrouter --bootstrap root@127.0.0.1:3306 --user=root

127.0.0.1:3306 indicates the IP address of the primary node.
- View the default configuration file generated by MySQL Router after initialization.
cat /etc/mysqlrouter/mysqlrouter.conf

- Start MySQL Router.
mysqlrouter &
MySQL Router is deployed. Note that MySQL Router uses port-based routing. It provides a write port and a read port to implement read/write splitting.
- Stop MySQL Router.
- Query the process ID of MySQL Router.
ps -ef|grep mysqlrouter

- Stop the MySQL Router process.
kill -9 72890
- Query the process ID of MySQL Router.
Parent topic: Deploying MySQL Router