I am trying to create multiple mongod instances on windows .

I run on 2 ports [27017,27020] with replSet ["ReplSet1","ReplSet2"].

first instance 27017#ReplSet1 is OK. But the second instance 27020 cannot start as replicaset. please check in image.

enter image description here

What would be my problem. Thanks. I use windows service and mongod.cfg.

MongoDB Log

2019-05-15T01:38:15.454+0630 I CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2019-05-15T01:38:15.456+0630 I CONTROL  [main] Trying to start Windows service 'MongoDB'
2019-05-15T01:38:15.457+0630 I CONTROL  [initandlisten] MongoDB starting : pid=1828 port=27020 dbpath=D:\Database\DB2 64-bit host=my.pc
2019-05-15T01:38:15.457+0630 I CONTROL  [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2019-05-15T01:38:15.457+0630 I CONTROL  [initandlisten] db version v4.0.6
2019-05-15T01:38:15.457+0630 I CONTROL  [initandlisten] git version: caa42a1f75a56c7643d0b68d3880444375ec42e3
2019-05-15T01:38:15.457+0630 I CONTROL  [initandlisten] allocator: tcmalloc
2019-05-15T01:38:15.457+0630 I CONTROL  [initandlisten] modules: none
2019-05-15T01:38:15.457+0630 I CONTROL  [initandlisten] build environment:
2019-05-15T01:38:15.457+0630 I CONTROL  [initandlisten]     distmod: 2008plus-ssl
2019-05-15T01:38:15.457+0630 I CONTROL  [initandlisten]     distarch: x86_64
2019-05-15T01:38:15.457+0630 I CONTROL  [initandlisten]     target_arch: x86_64
2019-05-15T01:38:15.457+0630 I CONTROL  [initandlisten] options: { config: "C:\Program Files\MongoDB\Server\4.0\bin\mongod_Config.cfg", net: { bindIp: "", port: 27020 }, replication: { replSetName: "configServers2" }, service: true, storage: { dbPath: "D:\Database\DB2", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "D:\Database\Log2\mongod.log" } }
2019-05-15T01:38:15.457+0630 I STORAGE  [initandlisten] Detected data files in D:\Database\DB2 created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2019-05-15T01:38:15.457+0630 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=15782M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2019-05-15T01:38:15.639+0630 I STORAGE  [initandlisten] WiredTiger message [1557860895:638553][1828:140730480398464], txn-recover: Main recovery loop: starting at 4/6016 to 5/256
2019-05-15T01:38:15.729+0630 I STORAGE  [initandlisten] WiredTiger message [1557860895:728793][1828:140730480398464], txn-recover: Recovering log 4 through 5
2019-05-15T01:38:15.792+0630 I STORAGE  [initandlisten] WiredTiger message [1557860895:792079][1828:140730480398464], txn-recover: Recovering log 5 through 5
2019-05-15T01:38:15.837+0630 I STORAGE  [initandlisten] WiredTiger message [1557860895:837081][1828:140730480398464], txn-recover: Set global recovery timestamp: 0
2019-05-15T01:38:15.967+0630 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
2019-05-15T01:38:16.000+0630 I CONTROL  [initandlisten] 
2019-05-15T01:38:16.000+0630 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2019-05-15T01:38:16.000+0630 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2019-05-15T01:38:16.000+0630 I CONTROL  [initandlisten] 
2019-05-15T01:38:16.053+0630 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory 'D:/Database/DB2/diagnostic.data'
2019-05-15T01:38:16.054+0630 I REPL     [initandlisten] Did not find local voted for document at startup.
2019-05-15T01:38:16.054+0630 I REPL     [initandlisten] Rollback ID is 1
2019-05-15T01:38:16.054+0630 I REPL     [initandlisten] Did not find local replica set configuration document at startup;  NoMatchingDocument: Did not find replica set configuration document in local.system.replset
2019-05-15T01:38:16.055+0630 I CONTROL  [LogicalSessionCacheRefresh] Sessions collection is not set up; waiting until next sessions refresh interval: Replication has not yet been configured
2019-05-15T01:38:16.055+0630 I NETWORK  [initandlisten] waiting for connections on port 27020
2019-05-15T01:38:16.055+0630 I STORAGE  [initandlisten] Service running
2019-05-15T01:38:16.055+0630 I CONTROL  [LogicalSessionCacheReap] Sessions collection is not set up; waiting until next sessions reap interval: config.system.sessions does not exist
  • What is your expectation? Single replica set with multiple nodes or multiple replica sets?
    – Mani
    May 14, 2019 at 18:37
  • @Mani, for multiple replicaSet. But I can get only first replSet for a server. the others are not starting as replset, just for standalone as in picture. May 14, 2019 at 19:04
  • Please post the error message from mongo log from the second replica set
    – Mani
    May 14, 2019 at 19:05
  • @Mani, hello I updated post. please check . Thanks. May 14, 2019 at 19:11
  • Based on your log message, the server is running go ahead initiate the replicaset, it will work.
    – Mani
    May 14, 2019 at 19:13

1 Answer 1


Based on the conversation with the OP, updating the answer

The question is replica set is not getting initiated for the first time.


  1. Start the first node in the replica set
  2. Connect to the replica set from mongo shell, this will connect as a standalone node
  3. Run rs.initiate() to initiate the replica set.
  • Thank for your help. May 14, 2019 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.