Here's sample command to start a MongoDB process, which is having replication set up.
* Go to 'bin' directory, where MongoDB is installed
* Execute the below command to start MongoDB process:
./mongod --shardsvr --replSet r1 --port 27010 --quiet --journal --fork --dbpath /path_of_mongo/rs --logpath /path_of_mongo/logs/rs.log
Desciption:
./mongod --> Calling the MongoDB process
shardsvr --> Option - to make MongoDB process as a Shard
replSet r1 --> Option - to start Shard process as part of Replica set (r1 is the value)
port 27010 --> Option - to start MongoDB process on port 27010
quiet --> Option - to Log less
journal --> Option - to enable journaling - which helps in crash recover - acts as re-do log
fork --> Option - to Start background processes, implicitly
dbpath --> Option - to specify the installation path of MongoDB
logpath --> Option - to specify the log file path
* Go to 'bin' directory, where MongoDB is installed
* Execute the below command to start MongoDB process:
./mongod --shardsvr --replSet r1 --port 27010 --quiet --journal --fork --dbpath /path_of_mongo/rs --logpath /path_of_mongo/logs/rs.log
Desciption:
./mongod --> Calling the MongoDB process
shardsvr --> Option - to make MongoDB process as a Shard
replSet r1 --> Option - to start Shard process as part of Replica set (r1 is the value)
port 27010 --> Option - to start MongoDB process on port 27010
quiet --> Option - to Log less
journal --> Option - to enable journaling - which helps in crash recover - acts as re-do log
fork --> Option - to Start background processes, implicitly
dbpath --> Option - to specify the installation path of MongoDB
logpath --> Option - to specify the log file path