mongodb sharding collection
If a replicaset needs to be added as shard in a sharded cluster, --shardsvr argument is mandatory when starting a mongod process.

mongod --shardsvr --replSet &lt;replSetname&gt;  --dbpath &lt;path&gt; --bind_ip localhost,&lt;hostname(s)|ip address(es)&gt;


If is it a config server, then --configsvr argument is mandatory

mongod --configsvr --replSet &lt;replica set name&gt; --dbpath &lt;path&gt; --bind_ip localhost,&lt;hostname(s)|ip address(es)&gt;


Refer the following link to deploy 

Deploy a Sharded Cluster