Setting Up a Sharded Cluster problem with mongod


Following the steps of the section Setting Up a Sharded Cluster, when I try to start the three mongod procceses from the csrs_x.conf, all I get is this message
ERROR: child process failed, exited with error number 100
Still cannot figure out what is happening, but nevertheless, if I try to initiate without config file, or using config files from prior chapters, everything works fine.

Ok i forgot to create the dbPath, now it works.

1 Like

I still can’t get it to work


The file is there and I have already created the db directory at /var/mongodb/db/csrs1.
I can see the log file being created at /var/mongodb/db/csrs1.log

Any help appreciated thanks.

It happens that I created the directories as root, so just needed to chown the dbpath directories to vagrant again to get it to work.

Use this command:
sudo chown vagrant:vagrant /var/mongodb/db/csrs1

I tried to use this command:

$ sudo chown vagrant:vagrant /var/mongodb/db/csrs1

and this is the message I get:

chown: cannot access '/var/mongodb/db/csrs1': No such file or directory

Note: dbPath is in conf file:

  dbPath: /var/mongodb/db/csrs1

Have you created the /var/mongodb/db/csrs1 folder? Try these commands from the Vagrant shell (not the mongo shell) to discover which folder is missing:

ls /var
ls /var/mongodb
ls /var/mongodb/db
ls /var/mongodb/db/csrs1
1 Like