Dependencies: mongoDB Tornado pip install tornado Latest PyMongo pip install pymongo Ensure that no mongod or mongos are not running. Run this code as: python main.py This is a draft example of PyMongo HA tests: https://github.com/MblKiTA/mongo-python-driver/blob/rest_api/test/high_availability/test_ha_rest.py