You must have:

  • An active replica set.
  • ClusterAdmin privileges.

To remove a node from an existing replica set:

  1. Connect to the node that you want to remove and shut down the MongoDB on it using the following command:
    absrs01:PRIMARY> db.shutdownServer() 
  2. Connect to the primary member of the replica set and run the following command to remove the node:
    absrs01:PRIMARY> rs.remove("<IP Address or hostname of the node to be removed>:27017")

For more information, see Remove Members from Replica Setin the MongoDB documentation.