Verifying Read/Write Splitting and Load Balancing
- Perform steps 1 to 3 in Verifying Read/Write Splitting and Load Balancing.
- Perform a query test.
- Execute the read request script.
1sh /home/read_6446.sh
Read requests of port 6446 are sent to the primary node (127.0.0.1:3307) in polling mode as expected.
- Execute the read request script.
sh /home/read_6447.sh

Read requests of port 6447 are sent to the three primary nodes in polling mode as expected.
- Execute the read request script.
- Perform a write test.
- Open the file.
vim /home/write_6446.sh
- Add the following content to the file:
1 2 3 4 5
#!/bin/bash for i in {1..1000} do /usr/local/mysql/bin/mysql -uroot -p123456 -P6446 -h127.0.0.1 -Dsysbench -e "insert into test1(id,report_serverid) values($i,@@server_id)" done
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Execute the write request script.
1sh /home/write_6446.sh - Confirm the test data.
1/usr/local/mysql/bin/mysql -uroot -p123456 -P6446 -h127.0.0.1 -Dsysbench -e "select * from test1"

Write requests of port 6446 are sent to the primary node (127.0.0.1:3307) in polling mode as expected.
- Perform a write test through port 6447.
- Open the file.
vim /home/write_6447.sh
- Add the following content to the file:
1 2 3 4 5
#!/bin/bash for i in {1001..2000} do /usr/local/mysql/bin/mysql -uroot -p123456 -P6447 -h127.0.0.1 -Dsysbench -e "insert into test1(id,report_serverid) values($i,@@server_id)" done
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Execute the write request script.
1sh /home/write_6447.sh - Confirm the test data.
1/usr/local/mysql/bin/mysql -uroot -p123456 -P6447 -h127.0.0.1 -Dsysbench -e "select * from test1"

Write requests of port 6447 are sent to the three primary nodes in polling mode as expected.
- Open the file.
- Open the file.
Parent topic: Deploying MGR (Multi-Primary Mode)