windows_mongodb_arbiter
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
windows_mongodb_arbiter [2020/01/23 09:11] – walkeradmin | windows_mongodb_arbiter [2023/03/09 22:35] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 10: | Line 10: | ||
Availability and Redundancy. In this case, MongoDB uses a replica set.\\ | Availability and Redundancy. In this case, MongoDB uses a replica set.\\ | ||
\\ | \\ | ||
- | {{: | + | {{ : |
\\ | \\ | ||
A replica set is a group of mongod instances that maintain the same data set. A replica set contains | A replica set is a group of mongod instances that maintain the same data set. A replica set contains | ||
Line 18: | Line 18: | ||
to maintain a quorum in a replica set by responding to heartbeat and election requests by other | to maintain a quorum in a replica set by responding to heartbeat and election requests by other | ||
replica set members. | replica set members. | ||
+ | \\ | ||
+ | \\ | ||
+ | ---- | ||
+ | ===== Download MongoDB ===== | ||
+ | \\ | ||
+ | Firstly we need to download MongoDB, this can be downloaded from [[https:// | ||
+ | \\ | ||
+ | \\ | ||
+ | At the time of writing, we are using v3.6 which you can also get {{ : | ||
+ | \\ | ||
+ | \\ | ||
+ | ---- | ||
+ | ===== Install MongoDB ===== | ||
+ | \\ | ||
+ | • Double-click the .MSI file and click Next | ||
+ | \\ | ||
+ | \\ | ||
+ | • Accept the terms of the license agreement and click Next | ||
+ | \\ | ||
+ | \\ | ||
+ | • Choose Complete Installation | ||
+ | \\ | ||
+ | \\ | ||
+ | • Uncheck “Install MongoDB Compass” and click Next | ||
+ | \\ | ||
+ | \\ | ||
+ | • Click Install | ||
+ | \\ | ||
+ | \\ | ||
+ | • Click Finish to exit the Setup Wizard | ||
+ | \\ | ||
+ | \\ | ||
+ | MongoDB will be installed in C:\Program Files\MongoDB\Server\3.6 | ||
+ | \\ | ||
+ | \\ | ||
+ | ---- | ||
+ | ===== Configure MongoDB ===== | ||
+ | \\ | ||
+ | Create a folder structure to contain the database files and logs. The MongoDB | ||
+ | documentation uses C:\data but a more obvious name is C:\mongo | ||
+ | \\ | ||
+ | cd C:\ | ||
+ | mkdir " | ||
+ | \\ | ||
+ | Create a MongoDB configuration file "< | ||
+ | \\ | ||
+ | < | ||
+ | systemLog: | ||
+ | destination: | ||
+ | path: " | ||
+ | storage: | ||
+ | dbPath: " | ||
+ | replication: | ||
+ | replSetName: | ||
+ | security: | ||
+ | authorization: | ||
+ | keyFile: " | ||
+ | transitionToAuth: | ||
+ | net: | ||
+ | port: 27018 | ||
+ | bindIp: 0.0.0.0 | ||
+ | </ | ||
+ | You can download the mongod.cfg file {{ :mongod.zip |here}}: | ||
+ | \\ | ||
+ | \\ | ||
+ | Create a MongoDB key file: | ||
+ | \\ | ||
+ | \\ | ||
+ | Create the file " | ||
+ | \\ | ||
+ | \\ | ||
+ | The contents of the key file should be the same as the corresponding file on the | ||
+ | Controller instances. This can be found using the following CentOS command: | ||
+ | \\ | ||
+ | cat / | ||
+ | Just copy the mongodb.key file from your Controller to your Windows MongoDB folder (C:\Program Files\MongoDB\Server\3.6) | ||
+ | ---- | ||
+ | \\ | ||
+ | ===== Create a MongoDB Service ===== | ||
+ | \\ | ||
+ | From a Windows Command Line, yype the following in Cmd.exe to create a MongoDB Service. | ||
+ | \\ | ||
+ | sc.exe create MongoDB binPath=" | ||
+ | \\ | ||
+ | Start the service with the following command: | ||
+ | \\ | ||
+ | net start MongoDB | ||
+ | \\ | ||
+ | ---- | ||
+ | \\ | ||
+ | ===== Add Arbiter to Replicaset ===== | ||
+ | \\ | ||
+ | SSH (or console) to your ' | ||
+ | \\ | ||
+ | \\ | ||
+ | From the command line type <color # | ||
+ | \\ | ||
+ | \\ | ||
+ | eth0: < | ||
+ | \\ | ||
+ | link/ether 74: | ||
+ | \\ | ||
+ | inet <color # | ||
+ | \\ | ||
+ | | ||
+ | \\ | ||
+ | inet <color # | ||
+ | \\ | ||
+ | | ||
+ | \\ | ||
+ | inet <color # | ||
+ | \\ | ||
+ | | ||
+ | \\ | ||
+ | inet6 fe80:: | ||
+ | \\ | ||
+ | | ||
+ | \\ | ||
+ | \\ | ||
+ | If you see the three IP Addresses (Controller IP1, VIP, LicensingVIP) then you are on the PRIMARY controller. | ||
+ | \\ | ||
+ | \\ | ||
+ | Check the password in the secrets.ini | ||
+ | cat / | ||
+ | Now add the Arbiter details by using the following: | ||
+ | mongo admin -u MediaKind -p ********* | ||
+ | \\ | ||
+ | \\ | ||
+ | Add the Arbiter using the rs.addArb method with the IP address of the Windows server that is used | ||
+ | for the management network of the MediaKind appliances e.g. | ||
+ | \\ | ||
+ | repldb: | ||
+ | |||
+ | (where x.x.x.x is the Management IP Address of your nCompass Server) | ||
+ | \\ | ||
+ | ---- | ||
+ | ===== Verify Replicaset Members ===== | ||
+ | \\ | ||
+ | Whilst in the mongo client, use the rs.status method to list the members of the Replicaset: | ||
+ | repldb: | ||
+ | This should return information including details of the PRIMARY, SECONDARY and ARBITER nodes: | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | }, | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | repldb: | ||
+ | </ |
windows_mongodb_arbiter.1579770696.txt.gz · Last modified: 2023/03/09 22:35 (external edit)