Rate This Document
Findability
Accuracy
Completeness
Readability

Initializing MySQL Router

  1. 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.

  2. View the default configuration file generated by MySQL Router after initialization.
    cat /etc/mysqlrouter/mysqlrouter.conf

  3. 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.

  4. Stop MySQL Router.
    1. Query the process ID of MySQL Router.
      ps -ef|grep mysqlrouter

    2. Stop the MySQL Router process.
      kill -9 72890