Interprocess security in Mongo
In the previous recipe, we saw how authentication can be enforced for user to be logged in before allowing any operations on Mongo. In this recipe, we will look at interprocess security. By the term interprocess security, we don't mean to encrypt the communication but only to ensure that the node being added to a replica set is authenticated before being added to the replica set.
Getting ready
In this recipe, we will start multiple mongo instances as part of a replica set and thus you might have to refer to the recipe Starting multiple instances as part of a replica set from Chapter 1, Installing and Starting the Server if you are not aware of how to start a replica set. Apart from that, in this recipe, all we would be looking at how to generate key file to be used and the behavior when an unauthenticated node is added to the replica set.
How to do it…
To set the ground, we would be starting three instances, each listening to port 27000
, 27001
, and 27002
, respectively...