Tech ONTAP Blogs

DarkSite Cloud Backup MySQL and Indexed Catalog Backup and Restore

jacoba
NetApp
258 Views

DarkSite Cloud Backup MySQL and Indexed Catalog Backup and Restore


Please Note:-
Make sure that the version of the Dark-Site deployed on the secondary should be the same as that of the source.

 

1. Make sure to take backup at regular intervals of the Dark-Site CBS Database
  a) Login to the Dark-Site connector using the appropriate credentials
  b) Enter the MySQL container shell, using the command "docker exec -it ds_mysql_1 sh"
  c) On the container shell, deploy the "env"
  d) Note the password of the MySQL DB by copying the value of the key "MYSQL_ROOT_PASSWORD"
  e) Backup the Cloud Backup MySQL DB using the command "mysqldump --user root --password -p cloud_backup --result-file=mysql.dump.cloud_backup.sql"
  f) Copy the backups from the MySQL docker container using the command "docker cp   ds_mysql_1:/mysql.dump.cloud_backup.sql ."
  g) Make sure to take the backup at regular intervals
  h) Copy the backup to a secure location

 

2. Backup the Indexed Catalog Files
On the Dark Site connector VM, change the directory to "/tmp"
  a) Make sure to identify the Index Catalog folder, with starts with the string "catalog"
  b) Now zip the catalog******** folder, using the command "zip -r catalog******.zip catalog******"
  c) Make sure to take the backup at regular intervals
  d) Copy the backup to a secure location

3. Install the Dark-Site connector on a new VM
  a) Download the Dark-Site Installer from the NetApp Support Site.install the Dark-Site connector on a new VM.

1. Log in to the NetApp Support Site, and navigate to the Download page for installing Cloud Manager on the Red Hat Enterprise Linux platform. https://mysupport.netapp.com/products/index.html
2. Download the Cloud Manager dark site installer Cloud-Manager-Connector-offline-v3.9.xx.zip file to a directory on the target system.
    Verify the checksum to ensure that the software downloaded correctly.

  b) Install the Dark-Site connector on a new VM.

1. Verify that docker is enabled and running.
sudo systemctl enable docker && sudo systemctl start docker
2. Copy the installer to the Linux host.
3. Assign permissions to run the script.
chmod +x /path/ Cloud-Manager-Connector-offline-v3.9.xx
4. Run the installation script:
sudo /path/ Cloud-Manager-Connector-offline-v3.9.xx


  c) After the installation is complete, give in the connector name, name of the organization, give in name of the user, email, and password.
  d) Review all the details and click the review check box and click on "create"
  e) The new user will be created and will be redirected to the login screen.

  f) For more detailed instructions on how to install Dark-Site connector, check out the following blog.

 

 

Capture0412_1.PNG


4. Restore the MySQL Backups
  a. Copy the MySQL backups from the secure location onto the new VM where the connector is installed.
  b. Copy the backups into the MySQL docker container using the command "docker cp mysql.dump.cloud_backup.sql ds_mysql_1:/."
  c. Enter the MySQL container shell, using the command "docker exec -it ds_mysql_1 sh"
  d. On the container shell, deploy the "env"
  e. Note the password of the MySQL DB by copying the value of the key "MYSQL_ROOT_PASSWORD"
  f. Backup the Cloud Backup MySQL DB using the command "mysql -u root -p cloud_backup < mysql.dump.cloud_backup.sql"
  g. Verify if the Cloud Backup MySQL DB has been restored using the SQL command

# mysql -u root -p cloud_backup , Enter password.
mysql> show tables;
mysql> select * from volume; Check if the volumes are shown similar to the previous Dark-Site environment

 

5. Restoring the Indexed Catalog files
  a) Copy the backed-up catalog zip files into the /tmp folder.
  b) Unzip the catalog******.zip file using the command "unzip catalog******.zip"
  c) Do an "ls" to make sure that the folder "catalog******" has been created with the "changes" and "snapshots" folders underneath it.

6. Discover the Working Environments
  a) Make sure to discover all the working environments that were available on the previous Dark-Site environment
  b) Click "Add Working Environment"
  c) Click on "On-Premise" and choose type as "On-Premise ONTAP"
  d) Now given in the Cluster Management IP Address, username, and password.
  e) Repeat the procedure until all the Working Environments are discovered.

 

Capture0412_6.PNG

7. Setting up the StorageGrid Environment Details
  a) In this step we will be adding details of the StorageGrid associated with the Working Environments as per Source Dark-Site Setup
  b) In the first setup , extract the authorization token using the following oauth/token API

curl 'http://10.193.192.202/oauth/token' -X POST -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:100101 Firefox/108.0' -H 'Accept: application/json' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate' -H 'Content-Type: application/json' -d '{"username":"admin@netapp.com","password":"Netapp@123","grant_type":"password"}
> '
{"expires_in":21600,"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjJlMGFiZjRiIn0.eyJzdWIiOiJvY2NtYXV0aHwxIiwiYXVkIjpbImh0dHBzOi8vYXBpLmNsb3VkLm5ldGFwcC5jb20iXSwiaHR0cDovL2Nsb3VkLm5ldGFwcC5jb20vZnVsbF9uYW1lIjoiYWRtaW4iLCJodHRwOi8vY2xvdWQubmV0YXBwLmNvbS9lbWFpbCI6ImFkbWluQG5ldGFwcC5jb20iLCJzY29wZSI6Im9wZW5pZCBwcm9maWxlIiwiaWF0IjoxNjcyNzM2MDIzLCJleHAiOjE2NzI3NTc2MjMsImlzcyI6Imh0dHA6Ly9vY2NtYXV0aDo4NDIwLyJ9.CJtRpRDY23PokyLg1if67bmgnMcYxdCvBOY-ZUYWzhrWbbY_hqUH4T-114v_pNDsPyNDyWqHaKizThdjjHYHxm56vTz_Vdn4NqjaBDPwN9KAnC6Z88WA1cJ4WRQqj5ykODNDmrv5At_f9HHp0-xVMyHqywZ4nNFalMvAh4xESc5jfoKOZc-IOQdWm4F4LHpMzs4qFzCYthTuSKLYtqSTUrZB81-o-ipvrOqSo1iwIeHXZJJV-UsWun9daNgiYd_wX-4WWJViGEnDzzwOKfUoUoe1Fg3ch--7JFkFl-rrXDOjk1sUMumN3WHV9usp1PgBE5HAcJPrEBm0ValSZcUbiA"}

 

c) Extract the Working Environment ID and the X-Agent-Id using the tenancy/external/resource API. In the response, the value under the “resourceIdentifier” denotes the WorkingEnvironment Id and the value under "agentIds" denotes x-agent-id

 

curl -X GET "http://10.193.192.202/tenancy/external/resource?account=account-DARKSITE1" -H 'accept: application/json' -H 'authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjJlMGFiZjRiIn0.eyJzdWIiOiJvY2NtYXV0aHwxIiwiYXVkIjpbImh0dHBzOi8vYXBpLmNsb3VkLm5ldGFwcC5jb20iXSwiaHR0cDovL2Nsb3VkLm5ldGFwcC5jb20vZnVsbF9uYW1lIjoiYWRtaW4iLCJodHRwOi8vY2xvdWQubmV0YXBwLmNvbS9lbWFpbCI6ImFkbWluQG5ldGFwcC5jb20iLCJzY29wZSI6Im9wZW5pZCBwcm9maWxlIiwiaWF0IjoxNjcyNzIyNzEzLCJleHAiOjE2NzI3NDQzMTMsImlzcyI6Imh0dHA6Ly9vY2NtYXV0aDo4NDIwLyJ9.X_cQF8xttD0-S7sU2uph2cdu_kN-fLWpdJJX98HODwPpVUitLcxV28_sQhuopjWobozPelNISf7KvMqcoXc5kLDyX-yE0fH9gr4XgkdswjWcNvw2rRkFzjHpWrETgfqAMkZcAukV4DHuxogHWh6-DggB1NgPZT8A_szHinud5W0HJ9c4AaT0zC-sp81GaqMahPf0KcFVyjbBL4krOewgKHGFo_7ma_4mF39B1LCj7Vc2XvUd0wCaJvDMjwp19-KbZqmmBX9vDnYp7SSxC1hHJRDStcFgJLdJHtowweNH2829KsjEGBTTcBdO8SvIDtctNH_GAxwSgMT3zUfwaOimPw'
[{"resourceIdentifier":"OnPremWorkingEnvironment-pMtZND0M","resourceType":"ON_PREM","agentId":"vB_1xShPpBtUosjD7wfBlLIhqDgIPA0wclients","resourceClass":"ON_PREM","name":"CBSFAS8300-01-02","metadata":"{\"clusterUuid\": \"2cb6cb4b-dc07-11ec-9114-d039ea931e09\"}","workspaceIds":["workspace2wKYjTy9"],"agentIds":["vB_1xShPpBtUosjD7wfBlLIhqDgIPA0wclients"]}]

 

d) Now, let’s use API to update the database with the details of the StorageGrid associated with the Working Environments as per Source Dark-Site Setup. Make sure to give in the Fully Qualified Domain Name of the StorageGRID, Access-Key and Storage-Key in the body as given below

 

curl -X POST 'http://10.193.192.202/account/account-DARKSITE1/providers/cloudmanager_cbs/api/v1/sg/credentials/working-environment/OnPremWorkingEnvironment-pMtZND0M' \
> --header 'authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjJlMGFiZjRiIn0.eyJzdWIiOiJvY2NtYXV0aHwxIiwiYXVkIjpbImh0dHBzOi8vYXBpLmNsb3VkLm5ldGFwcC5jb20iXSwiaHR0cDovL2Nsb3VkLm5ldGFwcC5jb20vZnVsbF9uYW1lIjoiYWRtaW4iLCJodHRwOi8vY2xvdWQubmV0YXBwLmNvbS9lbWFpbCI6ImFkbWluQG5ldGFwcC5jb20iLCJzY29wZSI6Im9wZW5pZCBwcm9maWxlIiwiaWF0IjoxNjcyNzIyNzEzLCJleHAiOjE2NzI3NDQzMTMsImlzcyI6Imh0dHA6Ly9vY2NtYXV0aDo4NDIwLyJ9.X_cQF8xttD0-S7sU2uph2cdu_kN-fLWpdJJX98HODwPpVUitLcxV28_sQhuopjWobozPelNISf7KvMqcoXc5kLDyX-yE0fH9gr4XgkdswjWcNvw2rRkFzjHpWrETgfqAMkZcAukV4DHuxogHWh6-DggB1NgPZT8A_szHinud5W0HJ9c4AaT0zC-sp81GaqMahPf0KcFVyjbBL4krOewgKHGFo_7ma_4mF39B1LCj7Vc2XvUd0wCaJvDMjwp19-KbZqmmBX9vDnYp7SSxC1hHJRDStcFgJLdJHtowweNH2829KsjEGBTTcBdO8SvIDtctNH_GAxwSgMT3zUfwaOimPw' \
> --header 'x-agent-id: vB_1xShPpBtUosjD7wfBlLIhqDgIPA0wclients' \
> -d '
> { "storage-server" : "cbssr630ip15.rtp.openenglab.netapp.com:10443", "access-key": "2ZMYOAVAS5E71V0MCNH9", "secret-password": "uk/6ikd4L+UjlXQOFnzSzP/T0zR4ZQlG0w1xgWsB" }'

 

8. Recovery Verification
  a) Click on the required Working Environment
  b) Click on "Backup and Recovery", and Click on "View Backups"
  c) Now you should be able to see all the backups without any issues
  d) Go to the Indexed Catalog settings and make sure that the Working Environments which had Indexed Cataloging enabled in the previous DarkSite connector remain enabled after the recovery process on the new VM.
  e) Run a few catalog searches to confirm that the Indexed Catalog restores and recovery has been completed successfully.

 

 

Public