1
votes

I have started two mongod processes for a shard server and a config server, here are the commands:

mongod --shardsvr --dbpath \data\a1\ --port 27018 --logpath \data\logs\loga1.a1

and

mongod --configsvr --dbpath \data\configdb\ --port 27019 --logpath \data\logs\log-config.a1

When I tried to run a mongos I got an error:

C:\mongodb\bin>mongos --configdb CTLDBADEL18:27019 2014-11-10T14:00:03.662-0600 warning: running with 1 config server should be done only for testing purposes and is not recommended for production 2014-11-10T14:00:03.671-0600 [mongosMain] MongoS version 2.6.4 starting: pid=5688 port=27017 64-bit host=CTLDBADEL18 (--help for usage) 2014-11-10T14:00:03.672-0600 [mongosMain] db version v2.6.4 2014-11-10T14:00:03.672-0600 [mongosMain] git version: 3a830be0eb92d772aa855ebb711ac91d658ee910 2014-11-10T14:00:03.672-0600 [mongosMain] build info: windows sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') BOOST_LIB_VERSION=1_49 2014-11-10T14:00:03.673-0600 [mongosMain] allocator: system 2014-11-10T14:00:03.673-0600 [mongosMain] options: { sharding: { configDB: "CTLDBADEL18:27019" } } 2014-11-10T14:00:03.688-0600 [mongosMain] creating WriteBackListener for: CTLDBADEL18:27019 serverID: 000000000000000000000000 2014-11-10T14:00:03.706-0600 [mongosMain] scoped connection to CTLDBADEL18:27019 not being returned to the pool 2014-11-10T14:00:03.707-0600 [mongosMain] ERROR: listen(): bind() failed errno:10048 Only one usage of each socket address (protocol/network address/port) is normally permitted. for socket: 0.0.0.0:27017 2014-11-10T14:00:03.707-0600 [Balancer] about to contact config servers and shards 2014-11-10T14:00:03.708-0600 [mongosMain] dbexit: rc:48

Can you help me and see what I am doing wrong? I have tried with different names and commands:

>mongos --port 27017 --configdb CTLDBADEL18:27019

>mongos --configdb CTLDBADEL18:27019 --port 27017

>mongos --configdb 10.11.82.103:27019 --port 27017

>mongos --configdb 10.11.82.103:27019
1

1 Answers

5
votes

Start mongos on a different than port 27017:

mongos --port 27077 --configdb CTLDBADEL18:27019

Or alternatively, check the process that is using port 27017 and kill it, then start mongos with port 27017.

In Windows you can use Start > All Programs > Accessories > System Tools > Resource Monitor (or Run resmon.exe) and select tab 'Network' and click on 'Listening Ports' to check the process using 27017