Replica set initiate error

while trying to. Initiate the replica set in Mongo shell and check below error reflects

rs.initiate();
“ok” : 0,
“errmsg” : “already initialized”,
“code” : 23,
“codeName” : “AlreadyInitialized”

You are trying to initialize a replica set that is already initialized, so you are getting an error that indicate that the replica set is already initialized. Most likely you are doing the right command on the wrong mongod instance or the wrong command.