Terminal issues

I’m facing an issue after entering config commands in terminal.
Taking time to get this command :: bash-4.4# mongod --config mongod.conf

As with any terminal or command line or shell you must press the [ENTER] key to submit the command. On some keyboard it is marked as [RETURN], [Entrée] or a left pointing arrow that ends with a right angle.

Attaching the screenshot. After that I takes a while to continue the process and eventually terminates the terminal.

It did not terminate, it forked. You may try to continue with the rest of the lab.

I tried connecting the port for mongos but it gives connection failed… for the forked process it still hasn’t started the child process

For sharding, you need sharding server running in the background (if you want three shard process, then three shard processes should run on separate port on same host) and one config server should run in the background, then you can connect to the config server using mongos command by specifying the port that you used in config server.

After mongos process started, add the shard process to mongos. So that, mongos will take care of managing the shard process using the config server.

I am also learning cluster administration, but I am at Chapter 1. So, I don’t know how to start shard process and mongos process using configuration file, but make sure you have done the above steps.

I learnt the basics of sharding in the book - mongodb cookbook 2nd edition. Refer chapter 1 sharding to resolve this issue.

Provide screenshot of the bash command:

ps -aef | grep [m]ongo

We do not see the whole output. Can you scroll and post the rest?

Your mongos is indeed not running.

You should try to start it again.

The configDB: parameter is wrong. The lab says:

  • the Configuration Server Replica Set csrs is running on csrs/localhost:27004,localhost:27005,localhost:27006

You have set yours to m103-csrs/….

1 Like

Thanyou so much for your help!!

I’m facing a similar issue in another lab:
config file:-
dbPath: /var/mongodb/db
bindIp: localhost
port: 27000
authorization: enabled
destination: file
logAppend: true
path: /var/mongodb/logs/mongod.log

Another lab, another problem, then start a new thread and make sure you mention the lab.

Hi @Ankita_61662 ,

I’m closing this thread as your issue has been resolved and you have created another thread for your second issue.