Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhangyaoxing/atlas-failover
https://github.com/zhangyaoxing/atlas-failover
mongodb-atlas mongodb-driver
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/zhangyaoxing/atlas-failover
- Owner: zhangyaoxing
- Created: 2018-04-25T08:42:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-04-26T03:41:41.000Z (over 6 years ago)
- Last Synced: 2024-10-02T12:41:11.481Z (3 months ago)
- Topics: mongodb-atlas, mongodb-driver
- Language: Python
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Atlas Failover
This is a demo script for testing MongoDB Atlas failover.## Dependencies
To run this script, you need python 2.7 and the following libraries installed:
```
sudo pip install dnspython pymongo faker
```
## Set the connection string
The connection string is hard-coded in `replica_failover.py`. Edit it to anything you want.## Run the application
The application would insert a fake document every 1 second. And print the primary node hostname and the email inserted.
```
python __main__.py
```
If you want to test `retryWrites` (which automatically retry writes when fails), simply add command line args `true`:
```
python __main__.py true
```## Test failover
In Atlas dashboard, find the button `...`. In the dropdown menu, you'll see "Test Failover".Enjoy!