Check and fix DB inconsistencies - ganeshahv/Contrail_SRE GitHub Wiki

Credits to [email protected]

Check and fix DB inconsistencies

Contrail provides a DB management tool (db_manage.py) to check, heal and clean inconsistent DB entries.

It is recommended to run the tool to check and fix all the inconsistencies in Contrail DB before the backup.

The DB services that might write on the Database need to be stopped before the below operations can be performed without incurring in possible data corruptions.

Therefore, as root user, run the following commands on all the Contrail Controllers.

docker stop contrail_config_svc_monitor
docker stop contrail_config_device_manager
docker stop contrail_config_schema

CHECK

docker exec -it contrail_config_api bash
cd /usr/lib/python2.7/site-packages/vnc_cfg_api_server
python db_manage.py check

CLEAN

To clean all the supported inconsistencies, run the clean process.

python db_manage.py clean

HEAL

To fix all the issues detected by the tool, run the heal process.

python db_manage.py heal