Start mongod instance on replica set as background job I have setup a Mongodb replica set with 1 secondary node. When i execute on secondary

sudo mongod --replSet rs0 --dbpath /data --port 27017 --oplogSize 700


The primary and secondary nodes are linked and it works perfectly but the connection logs are running in open terminal. I would like to run the above task as background job. The option of -d doesn't seem to work here.
You can make mongod run in the background with --fork and you will also need to direct your logfiles somewhere with --logpath when you do so.  Before you go about doing all of that though, you should not run mongod as root (which you are doing by using sudo in the command you pasted).

Run it as a regular user, if you have installed MongoDB from one of the packages then you should have the mongod or mongodb user on the systems.  Make sure the dbpath (/data) has the appropriate permissions (as well as wherever you put your logs) and you should have no problems.  For reference, you would change the permissions on /data as follows (assuming a user and group of mongod):

sudo chown -R mongod:mongod /data