Introduction
This document describes the procedure required to rebuild Cisco Policy and Charging Rules Function (PCRF) mongo replica sets.
Prerequisites
Requirements
Cisco recommends that you have knowledge of these topics:
- Openstack
- CPS
- The compute on which affected instances were deployed is now available.
- Compute resources are available in the same availability zone as the affected instance.
- Backup procedures as mentioned in the document are followed/scheduled periodically.
Components Used
The information in this document is based on CPS and applicable to all versions.
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, ensure that you understand the potential impact of any command.
Background Information
This MOP required If the existing data in the database is damaged and cannot be repaired/recovered, the database must be rebuilt.
Due to some outages, it might become necessary to rebuild some or all replica sets, but before decision is taken to rebuild some or all replica sets, it might be noted that all data in these replica sets will be lost.
Troubleshoot
Step 1. Backup Verification.
This command is use to generate a backup of the CPS database configuration: config_br.py -a export --mongo-all /mnt/backup/backup_28092016.tar.gz
Verify if the backup is present at the /mnt/backup path in the cluster manager
Step 2. Rebuild Replica Sets.
Once backups are cross-verified and decision for recreating database replica sets is taken, this is the procedure:
- Check the content of /etc/broadhop/mongoConfig.cfg
- These commands should be run on Cluster Manager, it depends upon the database that intended to rebuild.
This command creates all replica sets relating to that DB: build_set.sh --<db-name> --create
Warning:The command to create all dbs in a replica set cleans up the database. All contents of the replica set are lost. Continuing drops the mongo database and delete everything under /var/data/sessions.4/SVS1/sessions.* on all Hosts
If there is a requirement to rebuild a specific replica set for one database, this command is used:
build_set.sh --<db-name> --create --setname <set-name>
Note:The setname against the dbname shall be refered from the /etc/broadhop/mongoConfig.cfg from pcrfclient01.
If it is to rebuild all replica sets for all databases, this command is used: build_set.sh --all --create
Step 3. Restore the Database from Backup Post Replica-Set.
Once all members of replica set are online and one of the members is primary, mongoDB can be restored from backup. The procedure described below can be used.
To restore all DBs from backup use this command: config_br.py --action import --mongo-all /mnt/backup/<file-name.tar.gz>
Step 4. Validate the Restore.
After the data is restored, in order to verify the working system run this command: /var/qps/bin/diag/diagnostics.sh