Primary Server
On your Primary server, perform the following actions:
- Install both the “mariadb” and “mariadb-server” rpm packages if they do not exist on your system.
Apply any required dependencies as well
# yum install mariadb mariadb-server
- Verify that your local disk partition is still mounted at /datakeeper/lib/mysql via the “df” command
- If this is a fresh MySQL install, initialize a sample MySQL database:
# /usr/bin/mysql_install_db --datadir=/datakeeper/lib/mysql --user=mysql
- Ensure that all files in your MySQL data directory (/datakeeper/lib/mysql) have correct permissions and ownership
# chown -R mysql:mysql /datakeeper/lib/mysql
# chmod 755 /datakeeper/lib/mysql
- Finally, manually start the MySQL daemon from the command line.
# mysqld_safe --user=mysql --socket=/datakeeper/lib/mysql/mysql.sock --port=3306 --datadir=/datakeeper/lib/mysql &
- Verify MySQL is running by connecting with the mysql client:
To specify the socket run the following command.
mysql --socket=/datakeeper/lib/mysql/mysql.sock
[root@LinuxPrimary mysql]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 1
Server version: 5.5.68-MariaDB MariaDB Server
Copyright © 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
MariaDB [(none)] > exit
Bye
[root@LinuxPrimary mysql]#
- Perform the following steps.
a. Launch mysql, using mysql, with the following command: mysql mysql --socket=/datakeeper/lib/mysql/mysql.sock
b. Inside of the program ran: update user set Password=PASSWORD (‘<new password>’) where User=’root’
c. Then ran: flush privileges;
- Verify your new password:
# mysql mysql --socket=/datakeeper/lib/mysql -u root -p
(Enter new password.)
#exit
- Create a MySQL configuration file. We will place this in the same shared directory (/datakeeper/lib/mysql/my.cnf)
# vi /datakeeper/lib/mysql/my.cnf
Example
# cat /datakeeper/lib/mysql/my.cnf
[mysqld]
datadir=/datakeeper/lib/mysql
socket=/datakeeper/lib/mysql/mysql.sock
pid-file=/datakeeper/lib/mysql/mysqld.pid
user=root
port=3306
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
[mysqld_safe]
log-error=/datakeeper/log/mysqld.log
pid-file=/datakeeper/run/mysqld/mysqld.pid
[client]
user=root
password=new password
- Delete the original MySQL configuration file, located in /etc
# rm /etc/my.cnf
Secondary Server
On your Secondary Server:
- Install both the “mariadb” and “mariadb-server” rpm packages if they do not exist on your system.
Apply any required dependencies as well
# yum install mariadb mariadb-server
- Delete the original MySQL configuration file, located in /etc
# rm /etc/my.cnf
- There is no need to perform any of the additional steps taken on the Primary Server.
このトピックへフィードバック