Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[QFX] How to backup MYSQL DB on Qfabric DG

0

0

Article ID: KB37035 KB Last Updated: 04 Jun 2021Version: 2.0
Summary:

This article explains how to perform a MYSQL DB backup on a Qfabric. This can be done any time before any of the activities like NSSU, DG replacement or a fresh implementation.

Solution:
  1. Check if MySQL service is running on DG. MySQL runs on Primary DG:

    [root@dg1 ~]# clustat
    Cluster Status for sfc_pb_cluster @ Fri May 21 06:57:22 2021
    Member Status: Quorate

     Member Name                             ID   Status
     ------ ----                             ---- ------
     dg0                                         1 Online, rgmanager
     dg1                                         2 Online, Local, rgmanager

     Service Name                   Owner (Last)                   State         
     ------- ----                   ----- ------                   -----         
     dcfservice:dcf_svc             dg1                            started   >>>>> indicates mysql is running on dg1     
     service:pbccif_svc0            dg0                            started       
     service:pbccif_svc1            dg1                            started       
     service:pbgfs_svc0             dg0                            started       
     service:pbgfs_svc1             dg1                            started       
     service:pblb_dhcp_svc0         dg0                            started       
     service:pblb_dhcp_svc1         dg1                            started       
     service:pbnfs_svc0             dg0                            started       
     service:pbnfs_svc1             dg1                            started        
  2. Rename MySQL script to disable auto-start:

    [root@dg1 ~]# ls -lah /opt/dcf/scripts/*mysql-5.5.28 
    -rwxr-xr-x 1 root 13K Aug 28  2020 /opt/dcf/scripts/mysql-5.5.28*

    [root@dg1 ~]# date;mv /opt/dcf/scripts/mysql-5.5.28 /opt/dcf/scripts/0mysql-5.5.28
    Wed Apr  7 16:19:05 UTC 2021

    [root@dg1 ~]# ls -lah /opt/dcf/scripts/*mysql-5.5.28
    -rwxr-xr-x 1 root 13K Aug 28  2020 /opt/dcf/scripts/0mysql-5.5.28* 
  3. Stop MySQL service:

    [root@dg1 ~]# date; /opt/dcf/scripts/0mysql-5.5.28 stop
    Wed Apr  7 16:22:06 UTC 2021
    Shutting down MySQL.... SUCCESS! 
  4. Take a backup of MySQL data directory and store it on the local primary DG directory:

    [root@dg1 ~]# ls -lah /pbdata/usr/ 
    total 12K
    drwxr-xr-x  3 root  3.8K Apr  6 10:27 ./
    drwxr-xr-x 14 root  3.8K Apr  7 16:17 ../
    drwxr-xr-x 13 mysql 3.8K Oct  1  2012 mysql-5.5.28/

    [root@dg1 ~]# date;rm -rf /mysql-backup 
    [root@dg1 ~]# date;mkdir /mysql-backup 
    Wed Apr  7 16:24:41 UTC 2021

    [root@dg1# date; tar -zcvf /mysql-backup/data.tgz /pbdata/usr/mysql-5.5.28/data 
    Wed Apr  7 16:25:47 UTC 2021
    tar: Removing leading `/' from member names
    /pbdata/usr/mysql-5.5.28/data/
    /pbdata/usr/mysql-5.5.28/data/sfcdb_db/
    /pbdata/usr/mysql-5.5.28/data/sfcdb_db/InstallationAttempts.ibd
    /pbdata/usr/mysql-5.5.28/data/sfcdb_db/InstallationAttempts.frm
    /pbdata/usr/mysql-5.5.28/data/sfcdb_db/db.opt
    /pbdata/usr/mysql-5.5.28/data/mysql_update_log_filesize.log
    /pbdata/usr/mysql-5.5.28/data/juniper_conf_DB/
    /pbdata/usr/mysql-5.5.28/data/juniper_conf_DB/SFCMGD_config.ibd
    /pbdata/usr/mysql-5.5.28/data/juniper_conf_DB/SFCMGD_UpdateMgdFiles.frm
    /pbdata/usr/mysql-5.5.28/data/juniper_conf_DB/SFCMGD_UpdateMgdFiles.ibd
    /pbdata/usr/mysql-5.5.28/data/juniper_conf_DB/SFCMGD_config.frm
    /pbdata/usr/mysql-5.5.28/data/juniper_conf_DB/db.opt
    /pbdata/usr/mysql-5.5.28/data/ibdata1

    [root@dg1# ls -lah /mysql-backup/
    total 94M
    drwxr-xr-x  2 root 4.0K Apr  7 19:16 ./
    drwxr-xr-x 32 root 4.0K Apr  7 19:16 ../
    -rw-r--r--  1 root  94M Apr  7 19:17 data.tgz
  5. Start MySQL service:

    [root@dg1 ~]#  date; /opt/dcf/scripts/0mysql-5.5.28 start 
    Wed Apr  7 16:31:19 UTC 2021
    Starting MySQL.. SUCCESS! 
  6. Rename MySQL script to the original name:

    [root@dg1 ~]# date;mv /opt/dcf/scripts/0mysql-5.5.28 /opt/dcf/scripts/mysql-5.5.28
    Wed Apr  7 16:32:52 UTC 2021

    [root@dg1 ~]# ls -lah /opt/dcf/scripts/*mysql-5.5.28
    -rwxr-xr-x 1 root 13K Aug 28  2020 /opt/dcf/scripts/mysql-5.5.28*

    [root@dg1 ~]# service mysql status
     SUCCESS! MySQL running (8031)

Related Links

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search