Initializing the MySQL Database
Initialize the MySQL database by following instructions in MySQL Installation Guide.
To verify the read/write splitting function of MyCAT, you need to initialize two databases and set up the primary/secondary architecture on the two databases. For details about MySQL primary-secondary replication, see Semisynchronous Replication and Parallel Replication in the MySQL Primary-Secondary Replication Deployment Guide.
Parameter |
Description |
dn1 (Primary Database) |
dn2 (Secondary Database) |
|---|---|---|---|
port |
Port |
3312 |
3313 |
report_host |
Host information |
rp_master |
rp_slave |
datadir |
Data path |
/data/mysql/datam |
/data/mysql/datas |
log-error |
Log path |
/data/mysql/log/mysqlm.log |
/data/mysql/log/mysqls.log |
pid-file |
PID file path |
/data/mysql/run/mysqldm.pid |
/data/mysql/run/mysqlds.pid |
socket |
Socket path |
/data/mysql/run/mysqlm.sock |
/data/mysql/run/mysqls.sock |