Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/th1enlm02/configure-mongodb-replicasets-using-ansible
Configure MongoDB replica sets using Ansible
https://github.com/th1enlm02/configure-mongodb-replicasets-using-ansible
ansible jinja jinja2 mongodb mongodb-replica-set
Last synced: 3 months ago
JSON representation
Configure MongoDB replica sets using Ansible
- Host: GitHub
- URL: https://github.com/th1enlm02/configure-mongodb-replicasets-using-ansible
- Owner: th1enlm02
- Created: 2024-08-12T10:19:01.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-16T14:42:00.000Z (5 months ago)
- Last Synced: 2024-09-26T15:04:24.729Z (4 months ago)
- Topics: ansible, jinja, jinja2, mongodb, mongodb-replica-set
- Language: Jinja
- Homepage:
- Size: 63.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Configure MongoDB replica sets
This guide provides steps to configure MongoDB replica sets using Ansible for automated deployment. Replica sets ensure high availability and data redundancy by replicating data across multiple MongoDB instances.
## Architecture
## Requiments
- Ansible installed on the control node.
- A set of MongoDB instances configured on saparate hosts.
- SSH access to MongoDB servers.
- MongoDB installed on all instances.## Steps
1. **Clone the repo**
```bash
git clone https://github.com/th1enlm02/Configure-MongoDB-ReplicaSets-using-Ansible.git
cd Configure-MongoDB-ReplicaSets-using-Ansible
```2. **Update [inventory file](./inventory/mongo.yml) and variables in [.roles/mongodb_repl_set/vars/main.yml](./roles/mongodb_repl_set/vars/main.yml)**
3. **Run the playbook**
```
ansible-playbook -i ./inventory site.yml
```4. **Verify the Replica Set**
After the playbook runs, log in to any of the MongoDB instances and check the status of the replica set:
```bash
mongosh --eval "rs.status()"
```