Difference between revisions of "MySQL InnoDB Cluster"
Jump to navigation
Jump to search
Michael.mast (talk | contribs) |
Michael.mast (talk | contribs) |
||
Line 5: | Line 5: | ||
*Install and configure mysql server on first node. In my case this is Amazon Linux 2 | *Install and configure mysql server on first node. In my case this is Amazon Linux 2 | ||
<pre> | <pre> | ||
− | sudo yum install mysql-server | + | sudo yum install mysql-community-server |
sudo systemctl enable --now mysqld.service | sudo systemctl enable --now mysqld.service | ||
</pre> | </pre> |
Revision as of 14:06, 25 April 2021
Purpose
To attempt installing a 3 node cluster.
Process
Started with downloading and installing mysql80-community-release-el7-3.noarch.rpm on each node, and the workstation I used for the admin API.
- Install and configure mysql server on first node. In my case this is Amazon Linux 2
sudo yum install mysql-community-server sudo systemctl enable --now mysqld.service
- Grab the temp password from /var/log/mysqld.log [1] and run secure setup.
- Root by default is restricted to localhost. I added an account for the mysqlsh to connect from my workstation. Also added the permissions to configure the clusteradmin
mysql> create user 'root'@'ip address' identified with mysql_native_password BY 'password'; mysql> grant all privileges on *.* to 'root'@'password'; mysql> GRANT CLONE_ADMIN, CONNECTION_ADMIN, CREATE USER, EXECUTE, FILE, GROUP_REPLICATION_ADMIN, PERSIST_RO_VARIABLES_ADMIN, PROCESS, RELOAD, REPLICATION CLIENT, REPLICATION SLAVE, REPLICATION_APPLIER, REPLICATION_SLAVE_ADMIN, ROLE_ADMIN, SELECT, SHUTDOWN, SYSTEM_VARIABLES_ADMIN ON *.* TO 'root'@'password' WITH GRANT OPTION; mysql> flush privileges;
- Installed mysql shell on my Fedora 33 workstation.
sudo dnf install -y mysql-shell
- Set variables and run setup function.
mysqlsh MySQL JS > values={'password':'<root password>', 'clusterAdmin':'<cluster admin name>', 'clusterAdminPassword':'<cluster password>'} MySQL JS > dba.configureInstance('root@node1:3306', values )
- At this point I exited mysql shell with ctrl+d and connected to node1 directly using shell (This can be reworked from the beginnging)
mysqlsh --mysql -u root -h nod1 MySQL node1:3306 ssl JS > var cluster = dba.createCluster('testcluster')