#Mongodb windows service authentication keygen#
Note: The port number needs to match the server. conf.Ģ) Enter the data in the conf file as shown below:
When you right click the file and chose open with you can assign notepad as the default application for all files ending in. This shows how do create and open it by creating a text file in explorer and just moving it to another name at the prompt. There are many other ways to do this, but you need to end up with a nf file in the C:\MongoDB\conf directory and opened in notepad. The easiest way to create this is as a text file in windows explorer and then just change the file name (you will need to do View and check File Name Extensions in order to remove the. These are the steps for installing MongoDB as a Windows Serviceġ) On server 1, navigate to the C:\MongoDB directory and create a new folder named \conf and within that directory a file called nf. Next Step: Create a Java EE 7 Batch Application to Populate Data in the Mongo Database. Verify all of the servers are in the replic set and responding.Ĭonclusion: We have implemented security between the replicas as well as adding a mongo administration user. This shows what server two (mongodb002) should look likeġ0) Restart all the mongo services through the Services windowġ1) Connect to MongoDB on the primary server.Īuthenticate with the user we created in step 4. You could even use Open SSL to create an encoded value:ħ) In the same directory open the nf file and add the following:Ĩ) Copy the same mongokey file to the other two servers (mongodb002 mongodb003)ĩ) Repeat step 7 for the remaining two servers You may need to rename it from a text file.Ħ) Open the file and put any phrase you want for security. Roles: } )ĥ) In the C:\MongoDb\conf directory create a file called mongokey.
Now that we have everything running as a replica set, I like to add at least a mongo administrator and a second user.ġ) Connect to the MongoDB server on server 1 (mongodb001) with:Ĥ) I like to add a super user to use that has access to do all functions necessary: These are the steps for creating a basic security with replica sets and Mongo administrators