By default mongodb instance run on port 27017.
1 |
Tue Nov 5 23:59:56 [initandlisten] MongoDB starting : pid=24373 port=27017 dbpath=/data/db/ 64-bit host=thosan-hp |
There are two options to change the default port of mongodb. pass the –port argument when we start mongod. change the port in the mongodb.config file and pass the config file as input.
1 2 |
thosan@thosan-hp ~ $ mongod --port 19000 Wed Nov 6 13:08:34 [initandlisten] MongoDB starting : pid=26120 port=19000 dbpath=/data/db/ 64-bit host=thosan-hp |
To connect to mongod running on port 19000 we need to start […]
Continue reading…