logo
icon

MongoDB (Replica Set)

A source-available, cross-platform, document-oriented database program.

template cover
Deployed42 times
Publisherpan93412
Created2024-08-22
Services
service icon
Tags
Database

MongoDB is an open source NoSQL database management program. NoSQL (Not only SQL) is used as an alternative to traditional relational databases. NoSQL databases are quite useful for working with large sets of distributed data. MongoDB is a tool that can manage document-oriented information, store or retrieve information.

MongoDB is used for high-volume data storage, helping organizations store large amounts of data while still performing rapidly. Organizations also use MongoDB for its ad-hoc queries, indexing, load balancing, aggregation, server-side JavaScript execution and other features.

Deployment

After the deployment, follow the steps to complete your ReplicaSet:

First, edit the "replSetName" in "/etc/mongo/mongod.conf" to your real replica set name. For more information, check this documentation.

Then, edit the "/etc/mongo-keyfile.input" in the Config Editor to your pasword. For more information, check this documentation.

Finally, Run rs.initialize() in your MongoDB CLI. You can run it in the Command Execution UI with the following command. Note that the rs0 should be changed to the replSetName you set if you have changed it in mongod.conf.

mongosh -u "${MONGO_USERNAME}" -p "${MONGO_PASSWORD}" --eval "rs.initiate({ _id: \"rs0\", members: [ { _id: 0, host: \"mongodb.zeabur.internal\" }] })"