MySQL Backup
This section details the procedure required for taking a backup of the Session Monitor's MySQL Data. This section is applicable for taking a backup from Session Monitor with Releases 5.1 and 5.2, and restoring it on Session Monitor with Releases 5.2.
- Installing MySQL shell utility:
- Go to the folder where MySQL RPM files are present. (The MySQL 8 Commercial Package was downloaded from the Oracle software delivery during Session Monitor rpm installation.). cd mysql-8.X/8.X.XX/. For example: cd /root/mysql-8.0/8.0.32/.
- Run the following command to install the MySQL shell rpm:
For example:yum install mysql-shell-commercial-X.X.XX-X.X.XXX.x86_64.rpm
yum install mysql-shell-commercial-8.0.32-1.1.el8.x86_64.rpm
Note:
The mysql-shell rpm is available as a part of the MySQL package itself. So use the same.
- Create a temporary directory structure under /root/ or any other location on
your Session Monitor Server where space is available. For example:
mkdir /root/mysqlBackup/
. - Copy the password from /root/.my.cnf and keep it handy.
Figure 3-1 Copy Password
- Type
mysqlsh --no-defaults
command, This opens the JS prompt. Run this commands in sequence at the JS prompt:- Run this command to connect to a MySQL instance:
\connect root@localhost:3306
- When prompted for password. paste the password as copied from /root/.my.cnf earlier in Step 3.
- Run this command to begin backup:
util.dumpSchemas(["<DATABASE>"],"<PATH_TO_MYSQL_BACKUP_DIRECTORY>/<DATABASE>.dump",{threads:88})
For Mediation Engine, use DATABASE = vsp
For Mediation Engine Connector, use DATABASE = pldmaster
For Fraud Monitor, use DATABASE = fdp
For example, in Mediation Engine:
util.dumpSchemas(["vsp"],"/root/mysqlBackup/vsp.dump",{threads:88})
Once the backup is successful, a message is displayed similar to the below sample:
105% (9.97M rows / ~9.47M rows), 26.82K rows/s, 559.12 KB/s uncompressed, 17.04 KB/s compressed Dump duration: 00:00:52s Total duration: 00:00:54s Schemas dumped: 1 Tables dumped: 63 Uncompressed data size: 260.70 MB Compressed data size: 7.81 MB Compression ratio: 33.4 Rows written: 9970295 Bytes written: 7.81 MB Average uncompressed throughput: 4.93 MB/s Average compressed throughput: 147.71 KB/s
- To exit from mysql-shell run this command:
\quit
- Run this command to connect to a MySQL instance:
- Verify a <DATABASE>.dump directory has been created under the directory
created from Step 2. Run this command:
.
Example For Mediation Engine:ls -lh /root/mysqlBackup/
[root@localhost ~]# ls -lh /root/mysqlBackup/ total 1.2M drwxr-x---. 2 root root 1.2M Aug 19 13:27 vsp.dump