Homework 1.3: rs.initiate() fails?

I’m working through homework 1.3, and ran into an unusual problem: the servers are running, but rs.initiate() can’t find… itself?

Here’s what I’ve done.

Starting the instances:

mongod --replSet TO_BE_SECURED --sslMode requireSSL --clusterAuthMode x509 --sslClusterFile ~/shared
/certs/server.pem --sslPEMKeyFile ~/shared/certs/client.pem --sslCAFile ~/shared/certs/ca.pem --bind_ip localhost,databa
se.m310.mongodb.university --port 31130 --dbpath ~/M310-HW-1.3/r0 --logpath ~/M310-HW-1.3/r0/mongodb.log --fork

The only differences between them are the port, dbpath, and logpath, as in the spec.

Connecting to the primary:

mongo --host database.m310.mongodb.university --port 31130 --ssl --sslPEMKeyFile ./shared/certs/client.pem --sslCAFile ./shared/certs/ca.pem

Running rs.initiate():

All of the instances are up - I connected to each one to make sure. But the weirdest part is that even rs.initiate() without any parameters can’t connect to the server it’s been run on.

I’m probably missing something obvious here, but I truly don’t see it. Any help would be appreciated.

Please check if you are using the correct certificate files for the options you used on the command line to start mongod
Also bindip param is not needed.It will be used for remote connections and if different hostnames are involved

I suspect that the first rs.initiate() did something that makes the second one not work.

Provide output of rs.status() to see what is there.