Configuring SEAL MongoDB¶
Hint - necessary configuration steps
Different database clients may require different configuration steps, see overview.
Hint - replica set required
MongoDB requires a replica set for both, single server and server cluster.
Configuring a Shared Replica Set¶
Caution - cluster
-
In an editor, open the MongoDB configuration file:
"C:\ProgramData\SEAL Systems\config\mongod.conf" -
Check whether the
bindIpproperty exists and contains the following value:bindIp: 0.0.0.0 -
Check whether the
replicationsection exists, and contains the following properties:replication: oplogSizeMB: 2048 replSetName: sealHint -
oplogSizeMBWe recommend setting
oplogSizeMBto 5 % of the disk space available for MongoDB.Caution -
replSetNameidentical on all serversIf you change the default of
replSetName, make sure you change it to the same value on all servers. -
Restart MongoDB:
Restart-service seal-mongodb
Initializing the Database¶
Caution - replica set primary only
-
Open a PowerShell (Administrator).
-
Initialize the cluster on
<server_1>:& "C:\Program Files\mongosh\mongosh.exe" --tls --tlsAllowInvalidCertificates --eval "rs.initiate({ _id : 'seal', members: [{ _id : 0, host : '<Server1>' }]})"The output has to contain the following line:
"ok" : 1
Connecting the Database Servers to the Cluster¶
After initializing the database cluster on the replica set primary, add the other members of the replica set.
Caution - replica set primary only
-
Open a PowerShell (Administrator).
-
Add
<server_2>to the cluster:& "C:\Program Files\mongosh\mongosh.exe" --tls --tlsAllowInvalidCertificates --eval "rs.add('<server_2>')"The output has to contain the following line::
"ok" : 1 -
Add
<server_3>to the cluster:& "C:\Program Files\mongosh\mongosh.exe" --tls --tlsAllowInvalidCertificates --eval "rs.add('<server_3>')"The output has to contain the following line::
"ok" : 1 -
Proceed until all servers are added.
Proceed with Securing MongoDB: TLS encryption or user authentication.