Checks to be Made Before Starting Installation
ImportantFor the installation to be healthy, your servers need to access the following addresses.MongoDB:
Operating System Configurations
These steps should be performed on all MongoDB servers.
MongoDB Installation
Installing MongoDB Application
These steps should be performed on all MongoDB servers.
MongoDB Configurations
These steps should be performed on all MongoDB servers.
/etc/mongod.conf file by setting them according to your environment:
- storage / wiredTiger
- replication
- security
- setParameter
- processManagement
If MongoDB installation will be done on multiple servers, keys created on Primary node are moved to all nodes and the same permissions are given.
ReplicaSet Configuration and Authorized User Definition
These steps should be performed only on MongoDB Primary server.
If MongoDB’s local management will be done by you, a user with the following role needs to be created.
If password change is desired
Grant permission to a user on previously created MongoDB using the following command lines.
If arbiter is desired to be added to MongoDB:
MongoDB ReplicaSet Installation on Multiple Servers
These steps should be performed only on MongoDB Primary server.
Apinizer recommends MongoDB’s high availability feature. High availability enables Secondary Nodes to come into play when Primary Node fails.At least 3 servers (1 Primary and 2 Secondary) are required for high availability in MongoDB as well. If Primary node encounters a problem, a Secondary node automatically becomes Primary, so the system works without interruption. When Primary node becomes active again, it remains as Secondary node. However, this function cannot be seen when there are fewer than 3 active servers.High availability is not limited to only 3 servers; it can also be applied with Arbiter or more servers. Servers can be positioned in different locations to increase system continuity.For more information, you can check the link https://www.mongodb.com/docs/manual/core/replica-set-architectures/.
Priority specifies the priority of the node being selected as new Primary and this value can be scaled between 0 and 1. While value 0 indicates that it can never be Primary node, Primary priority is found according to how close other values are to 1.Votes specifies whether a node can vote in a new Primary election and takes value 0 or 1. This value shows whether the node will vote in the election.
This installation has been prepared assuming that DNSs in the form of “mongoDb01, mongoDb02, mongoDb03, k8sWorkerIP” can be resolved by the system. In cases where servers cannot resolve these DNSs, either this situation should be fixed or all DNSs should be fixed as IP.

