Homework 1.2 - unable to restart members

Hello

I’m trying to follow steps in this homework.
I launched setup-hw-1.2.sh. I created a keyfile and copied it to /home directory and gave it permission 400.
I shutdowned all members of replica sets. And in next step I have a problem. I’m trying to start members with commands like this:

mongod --replSet TO_BE_SECURED dbpath ~/M310-HW-1.2/r0 --logpath ~/M310-HW-1.2/r0/mongodb.log --port 31120 --fork --keyFile ~/mongodb-keyfile

I got this message:

about to fork child process, waiting until server is ready for connections.
forked process: 3854
child process started successfully, parent exiting

But ps -aef | grep mongod command returns nothing .

Then I tried to login with:

mongo --port 31120

and had this:

MongoDB shell version: 3.2.22
connecting to: 127.0.0.1:31120/test
2019-01-15T10:42:44.372+0000 W NETWORK [thread1] Failed to connect to 127.0.0.1:31120, in(checking socket for error af
er poll), reason: errno:111 Connection refused
2019-01-15T10:42:44.374+0000 E QUERY [thread1] Error: couldn’t connect to server 127.0.0.1:31120, connection attempt
failed :
connect@src/mongo/shell/mongo.js:231:14
@(connect):1:6

What am I doing wrong?

My host system is Windows 7 x64 if it matters.

[ADDED]

I found two things, I didn’t create db folder in r0/r1/r2 and I missed “–” in dbpath.
After repairing this I still have errors:

When I try to run:

mongod --replSet TO_BE_SECURED --dbpath ~/M310-HW-1.2/r0/db --logpath ~/M310-HW-1.2/r0/mongodb.log --port 31120 --fork --keyFile ~/mongodb-keyfile

I got this:

about to fork child process, waiting until server is ready for connections.
forked process: 7565
ERROR: child process failed, exited with error number 48

[ADDED 2]

I started from scratch and it works! :slight_smile:

@ Krzysztof_04566

Glad you solved it. Good luck.