花花世界蕾 发表于 2018-10-24 13:00:07

MongoDB复制集架构

test-set:PRIMARY>rs.add("127.0.0.1:27020")  
{ "ok" : 1 }
  
test-set:PRIMARY> rs.status()
  
{
  
      "set" : "test-set",
  
      "date" : ISODate("2018-04-19T08:16:36.910Z"),
  
      "myState" : 1,
  
      "term" : NumberLong(2),
  
      "heartbeatIntervalMillis" : NumberLong(2000),
  
      "optimes" : {
  
                "lastCommittedOpTime" : {
  
                        "ts" : Timestamp(1524125792, 1),
  
                        "t" : NumberLong(2)
  
                },
  
                "appliedOpTime" : {
  
                        "ts" : Timestamp(1524125792, 1),
  
                        "t" : NumberLong(2)
  
                },
  
                "durableOpTime" : {
  
                        "ts" : Timestamp(1524125792, 1),
  
                        "t" : NumberLong(2)
  
                }
  
      },
  
      "members" : [
  
                {
  
                        "_id" : 1,
  
                        "name" : "127.0.0.1:27018",
  
                        "health" : 1,
  
                        "state" : 2,
  
                        "stateStr" : "SECONDARY",
  
                        "uptime" : 1661,
  
                        "optime" : {
  
                              "ts" : Timestamp(1524125792, 1),
  
                              "t" : NumberLong(2)
  
                        },
  
                        "optimeDurable" : {
  
                              "ts" : Timestamp(1524125792, 1),
  
                              "t" : NumberLong(2)
  
                        },
  
                        "optimeDate" : ISODate("2018-04-19T08:16:32Z"),
  
                        "optimeDurableDate" : ISODate("2018-04-19T08:16:32Z"),
  
                        "lastHeartbeat" : ISODate("2018-04-19T08:16:36.730Z"),
  
                        "lastHeartbeatRecv" : ISODate("2018-04-19T08:16:35.732Z"),
  
                        "pingMs" : NumberLong(0),
  
                        "syncingTo" : "127.0.0.1:27019",
  
                        "configVersion" : 3
  
                },
  
                {
  
                        "_id" : 2,
  
                        "name" : "127.0.0.1:27019",
  
                        "health" : 1,
  
                        "state" : 1,
  
                        "stateStr" : "PRIMARY",
  
                        "uptime" : 4553,
  
                        "optime" : {
  
                              "ts" : Timestamp(1524125792, 1),
  
                              "t" : NumberLong(2)
  
                        },
  
                        "optimeDate" : ISODate("2018-04-19T08:16:32Z"),
  
                        "electionTime" : Timestamp(1524123790, 1),
  
                        "electionDate" : ISODate("2018-04-19T07:43:10Z"),
  
                        "configVersion" : 3,
  
                        "self" : true
  
                },
  
                {
  
                        "_id" : 3,
  
                        "name" : "127.0.0.1:27017",
  
                        "health" : 1,
  
                        "state" : 7,
  
                        "stateStr" : "ARBITER",
  
                        "uptime" : 3323,
  
                        "lastHeartbeat" : ISODate("2018-04-19T08:16:36.730Z"),
  
                        "lastHeartbeatRecv" : ISODate("2018-04-19T08:16:36.713Z"),
  
                        "pingMs" : NumberLong(0),
  
                        "configVersion" : 3
  
                },
  
                {
  
                        "_id" : 4,
  
                        "name" : "127.0.0.1:27020",
  
                        "health" : 1,
  
                        "state" : 2,
  
                        "stateStr" : "SECONDARY",
  
                        "uptime" : 110,
  
                        "optime" : {
  
                              "ts" : Timestamp(1524125792, 1),
  
                              "t" : NumberLong(2)
  
                        },
  
                        "optimeDurable" : {
  
                              "ts" : Timestamp(1524125792, 1),
  
                              "t" : NumberLong(2)
  
                        },
  
                        "optimeDate" : ISODate("2018-04-19T08:16:32Z"),
  
                        "optimeDurableDate" : ISODate("2018-04-19T08:16:32Z"),
  
                        "lastHeartbeat" : ISODate("2018-04-19T08:16:36.729Z"),
  
                        "lastHeartbeatRecv" : ISODate("2018-04-19T08:16:35.914Z"),
  
                        "pingMs" : NumberLong(0),
  
                        "syncingTo" : "127.0.0.1:27019",
  
                        "configVersion" : 3
  
                }
  
      ],
  
      "ok" : 1
  
}


页: [1]
查看完整版本: MongoDB复制集架构