Check current status using one/both of these commands...
sestatus
getenforce
If your server has SELinux enabled, you have two choices. Disable SELinux (not recommended, but might be right for a test system), or configure SELinux to allow our configuration...
Note: if your process is running as root, then the root login is generally mapped to the unconfined_u user in SELinux, which means the following config may not be necessary. But we will assume that MySQL will run as the mysqlrouter user (as that is the default outcome for the process described below)semanage port -a -t mysqld_port_t -p tcp 6446
semanage port -a -t mysqld_port_t -p tcp 6447
semanage port -a -t mysqld_port_t -p tcp 6448
semanage port -a -t mysqld_port_t -p tcp 6449
semanage port -a -t mysqld_port_t -p tcp 6450
semanage port -a -t mysqld_port_t -p tcp 8444
semanage port -a -t mysqld_port_t -p tcp 64460
semanage port -a -t mysqld_port_t -p tcp 64470
64460 & 64470 are for Oracle MySQL EEsemanage port -l | grep mysql
setenforce 0
getenforce
sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
Assumes commercial yum repository is available
yum install mysql-router-commercial.x86_64
dnf install percona-mysql-router --enablerepo=Percona-84-Local
mysqlrouter --bootstrap icadmin@node1:3306 --https-port 8444 --user mysqlrouter
The bootstrap process is a specific way of running MySQL Router, which does not start the usual routing and instead configures the mysqlrouter.conf file based on the metadata. (2)For the RPM/YUM install the auto generated mysqlrouter.conf looks like this..
systemctl start mysqlrouter
systemctl status mysqlrouter
systemctl enable mysqlrouter
systemctl status mysqlrouter
mysqlrouter --version
Use mysqlsh on the primary database server...
mysqlsh
\js
\c icadmin@node1
var cluster = dba.getCluster()
cluster.listRouters()
dba.upgradeMetadata()
cluster.setupRouterAccount('icadmin',{'update':1})
If you want to use the MySQL Router API, you should create a user and password...
mysqlrouter_passwd set /etc/mysqlrouter/mysqlrouter.pwd apiuser
You can check which users have been created using...
mysqlrouter_passwd list /etc/mysqlrouter/mysqlrouter.pwd
Output from:
dnf history 99
dnf remove percona-mysql-router