问题
I have a mongodb server shared by two computers.
I want to auto start the connexion between them when they reboot.
I created a config file for the mongod computer and it works as a windows service now.
I am not able to create a working config file for the mongos computer though.
This is what I tried :
sharding:
configdb: "192.xxx.50:51213"
systemLog:
destination: file
path: "c:\data\log\mongos.log"
processManagement:
fork: true
And I call it in an administrator command prompt as:
sc.exe create MongoDBS binPath= "C:\Program Files\mongodb\server\3.2\bin\mongos.exe
--service --config=C:\mongodb\mongos.config"
The service is created.
Then when I start it:
net start MongoDBS
I get this error : The service is not responding to the control function.
来源:https://stackoverflow.com/questions/37843798/auto-start-mongos-on-windows