-
Notifications
You must be signed in to change notification settings - Fork 64
Maintaining MongoDB and Solr
❗ | Warning: This page is going to be retired and this documentation will be maintained at - https://github.com/OpenConceptLab/ocl-docs/ |
---|
OCLAPI's data is kept in MongoDB and Solr. MongoDB and Solr are wrapped in ocl_mongo
and ocl_solr
containers, respectively.
docker-compose.yml
in the codebase dictates that an evironment variable named DATA_ROOT
is provided to the container images so that Solr and MongoDB data is kept physically in the host machine and their data is not lost when ocl_mongo
and ocl_solr
containers are restarted. If DATA_ROOT
environment variable is not provided, the data will be lost, MongoDB data will need to be restored from backup (see backup page for details) and Solr index will need to rebuilt from scratch in order to eliminate consistencies.
Right now, DATA_ROOT
variable is provided through the build pipeline and it is /data/ocl/
.
This is mostly a QA or Staging environment issue, should not happen in Production ever. Data could be corrupt or inconsistent and result in one of the following:
This happens usually when MongoDB gets a segmentation fault. Most likely the following has happened
-
ocl_mongo
container was started with its data stored in the host machine (i.eDATA_ROOT
was set). The physical location (DATA_ROOT
) was removed andocl_mongo
was recycled.
In order to resolve this, contents of /data/ocl/mongo/
should be removed, and ocl_mongo
container be deleted. Then a deployment could be done and mongo data could be restored from a backup.
This happens when the data between Solr and MongoDB is inconsistent due to MongoDB losing data and Solr index getting stale because of that.
Two possible solutions:
- Run
yes | docker exec -it ocl_api python manage.py rebuild_index
- Delete contents of
/data/ocl/solr/
and redeploy ocl_api through build pipeline.
Mongo port 27017 is closed to access from outside world, therefore SSH authentication is required in order to access Mongo instance on any of the QA (Showcase), Staging or Production environments.
- Download or
brew cask install robomongo
RoboMongo - Click "Create connection"
- Enter the following information:
- It should look like this
- All set! Should be able to browse collections
Overview
Resources
Import / Export
- CSV Import
- Bulk Import
- Org/Source Import
- Export API
- Subscriptions
- Subscription Client Testing Process
- OpenMRS to OCL Mapping
Troubleshooting & Operations
- Data integrity checks
- Maintaining OCLAPI's Docker containers
- Maintaining MongoDB and Solr
- How to check logs
- NewRelic monitoring setup
- Configuration changes to make tests and import job run faster
- Accessing Solr UI Remotely
- Data Backup and Restore
- SSL Configuration
- Flower
- Switching to Maintenance Mode on Production Server
- Docker networking and Security
Other