Configuring Ports for Multiple Instances in a Single-Node System
MySQL 5.7.27 does not have the mysqlx_port parameter. Therefore, you do not need to add parameters related to mysqlx to the my.cnf configuration file.
When deploying multiple MySQL 8.0.20 instances (for example, three instances) in a single-node system, specify parameters related to mysqlx in the configuration files.
- Create data directories.
- Modify configuration files.
- Specify the IP address and port number of the host in the configuration file of instance 1.
- Open the /etc/my.cnf_1 file.
1vim /etc/my.cnf_1 - Press i to enter the insert mode and configure the file as follows:
[mysqld_safe] log-error=/data/mysql/log/mysql_1.log pid-file=/data/mysql/run/mysqld_1.pid [mysqld] report_host=192.168.220.58 socket=/data/mysql/run/mysql.sock_1 port=3306 mysqlx_socket=/data/mysql/run/mysqlx.sock_1 mysqlx_port=33060 datadir=/data/mysql/data1
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the /etc/my.cnf_1 file.
- Specify the IP address and port number of the host in the configuration file of instance 2.
- Open the /etc/my.cnf_2 file.
vim /etc/my.cnf_2
- Press i to enter the insert mode and configure the file as follows:
[mysqld_safe] log-error=/data/mysql/log/mysql_2.log pid-file=/data/mysql/run/mysqld_2.pid [mysqld] report_host=192.168.220.58 socket=/data/mysql/run/mysql.sock_2 port=3307 mysqlx_socket=/data/mysql/run/mysqlx.sock_2 mysqlx_port=33070 datadir=/data/mysql/data2
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the /etc/my.cnf_2 file.
- Specify the IP address and port number of the host in the configuration file of instance 3.
- Open the /etc/my.cnf_3 file.
1vim /etc/my.cnf_3 - Press i to enter the insert mode and configure the file as follows:
[mysqld_safe] log-error=/data/mysql/log/mysql_3.log pid-file=/data/mysql/run/mysqld_3.pid [mysqld] report_host=192.168.220.58 socket=/data/mysql/run/mysql.sock_3 port=3308 mysqlx_socket=/data/mysql/run/mysqlx.sock_3 mysqlx_port=33080 datadir=/data/mysql/data3
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the /etc/my.cnf_3 file.
- Specify the IP address and port number of the host in the configuration file of instance 1.
Parent topic: Troubleshooting