Installing MySQL InnoDBCluster on CentOS 7

From rdkwiki
Revision as of 07:25, 28 July 2017 by Rob (talk | contribs) (Created page with "== Intro == The steps below will configure a working MySQL 5.7 InnoDB cluster with 3 nodes. The steps assume that you have 4 (fresh) CentOS 7 servers running. == Make MySQL a...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Intro

The steps below will configure a working MySQL 5.7 InnoDB cluster with 3 nodes. The steps assume that you have 4 (fresh) CentOS 7 servers running.

Make MySQL available for installation

!! This step will replace CentOS's default MariaDB

Installing MySQL

  • yum install mysql-server --> install the MySQL server
  • yum install mysql-shell --> install the MySQL Shell
  • systemctl start mysqld --> start the MySQL server
  • systemctl status mysqld --> check if the MySQL server is running
  • systemctl enable mysqld --> make the MySQL server start at boot

disable SELINUX

  • sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config --> disabled SELINUX at startup
  • setenforce 0 --> disable SELINUX without reboot

Securing MySQL

  • grep "temporary password" /var/log/mysqld.log --> get the random password that is generated during the MySQL 5.7 installation
  • mysql_secure_installation --> default script with a few questions to harden the MySQL security
  • mysql -h localhost -u root -p --> connect with the new password from the previous step
  • create user '<user>'@'<ip/subnet>' identified by '<password>'; --> here you can use wildcards for the ip/subnet (for example: '192.168.0.%' or '%' for all hosts)
  • grant all privileges on *.* to '<user>'@'<ip/subnet>' with grant option; --> give the new user all rights
  • flush privileges; --> reload all privileges

Firewall configuration

  • firewall-cmd --permanent --add-service=mysql --> add MySQL service to firewall
  • firewall-cmd --permanent --add-port=13306/tcp --> add MySQL InnoDB Cluster port to firewall
  • firewall-cmd --reload --> reload firewall with changed configuration