1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
| docker-compose exec mongo-1 mongo mongodb://root:123@mongo-1:27011/admin --eval 'rs.status()' MongoDB shell version v3.4.10 connecting to: mongodb://root:123@mongo-1:27011/admin MongoDB server version: 3.4.10 { "set" : "rs", "date" : ISODate("2020-03-10T07:01:59.764Z"), "myState" : 1, "term" : NumberLong(1), "heartbeatIntervalMillis" : NumberLong(2000), "optimes" : { "lastCommittedOpTime" : { "ts" : Timestamp(1583823710, 1), "t" : NumberLong(1) }, "appliedOpTime" : { "ts" : Timestamp(1583823710, 1), "t" : NumberLong(1) }, "durableOpTime" : { "ts" : Timestamp(1583823710, 1), "t" : NumberLong(1) } }, "members" : [ { "_id" : 1, "name" : "mongo-1:27011", "health" : 1, "state" : 1, "stateStr" : "PRIMARY", "uptime" : 263, "optime" : { "ts" : Timestamp(1583823710, 1), "t" : NumberLong(1) }, "optimeDate" : ISODate("2020-03-10T07:01:50Z"), "electionTime" : Timestamp(1583823469, 1), "electionDate" : ISODate("2020-03-10T06:57:49Z"), "configVersion" : 1, "self" : true }, { "_id" : 2, "name" : "mongo-2:27012", "health" : 1, "state" : 2, "stateStr" : "SECONDARY", "uptime" : 261, "optime" : { "ts" : Timestamp(1583823710, 1), "t" : NumberLong(1) }, "optimeDurable" : { "ts" : Timestamp(1583823710, 1), "t" : NumberLong(1) }, "optimeDate" : ISODate("2020-03-10T07:01:50Z"), "optimeDurableDate" : ISODate("2020-03-10T07:01:50Z"), "lastHeartbeat" : ISODate("2020-03-10T07:01:59.120Z"), "lastHeartbeatRecv" : ISODate("2020-03-10T07:01:58.109Z"), "pingMs" : NumberLong(0), "syncingTo" : "mongo-1:27011", "configVersion" : 1 }, { "_id" : 3, "name" : "mongo-3:27013", "health" : 1, "state" : 2, "stateStr" : "SECONDARY", "uptime" : 261, "optime" : { "ts" : Timestamp(1583823710, 1), "t" : NumberLong(1) }, "optimeDurable" : { "ts" : Timestamp(1583823710, 1), "t" : NumberLong(1) }, "optimeDate" : ISODate("2020-03-10T07:01:50Z"), "optimeDurableDate" : ISODate("2020-03-10T07:01:50Z"), "lastHeartbeat" : ISODate("2020-03-10T07:01:59.120Z"), "lastHeartbeatRecv" : ISODate("2020-03-10T07:01:58.103Z"), "pingMs" : NumberLong(0), "syncingTo" : "mongo-1:27011", "configVersion" : 1 } ], "ok" : 1 }
|