Sharing Config Server is not working on the config

I am following each step on the laboratory but I haven’t been to start the config server.
After creating the files: csrs_1.conf, csrs_2.conf, csrs_3.conf
And then start one of the server with:

mongod -f csrs_1.conf

I got his message:

vagrant@m103:~$ mongod -f csrs_1.conf
about to fork child process, waiting until server is ready for connections.
forked process: 1913
ERROR: child process failed, exited with error number 1
To see additional information in this output, start without the “–fork” option.

@AugustoAleGon let’s see the result of this:
ps -ef | grep mongo

Also, let’s see one of the config files.

@007_jb The result is: ps -ef | grep mongo
vagrant 1998 1 1 21:48 ? 00:00:01 mongod -f csrs1.conf vagrant 2154 1883 0 21:49 pts/0 00:00:00 grep --color=auto mongo

config files are:
clusterRole: configsvr
replSetName: m103-csrs
keyFile: /var/mongodb/pki/m103-keyfile
bindIp: localhost,
port: 26001
destination: file
path: /var/mongodb/db/csrs1/mongod.log
logAppend: true
fork: true
dbPath: /var/mongodb/db/csrs1

What I see, it is like the folder csrs2, csrs3 are not seen in the root directory. Any linux trick for this case?

The first one is already running. Try kicking off the second and third with mongod.

And just make sure that the directories and port are not conflicting with each other.

Finally I could solve the problem. It was more related to ubuntu manipulation directory more than mongod config.
Because my problem was that the folder that I created in var/mongodb/db/csrs1 are not available from my root directory. I did the following, in the root directory I use the following command:
sudo mkdir /var/mongodb/db/csrs1
sudo mkdir /var/mongodb/db/csrs2
sudo mkdir /var/mongodb/db/csrs3
Then I enable the permissions using the following commands:
sudo chown vagrant:vagrant /var/mongodb/db/csrs1
sudo chown vagrant:vagrant /var/mongodb/db/csrs2
sudo chown vagrant:vagrant /var/mongodb/db/csrs3

And then finally I can start successfully the config server replica set.
Also don’t forget the in the path use / as the initial root.

Good job! :+1:

Suggest you give vagrant access to the mongodb folder for future labs:
sudo chown vagrant:vagrant /var/mongodb/

1 Like