0

I've created my mongodb replicaset and all is correct except is not replicate in remote host, but I've tried to access remote pc at the port 27017 and working properly. I created the database on the remote PC to see if this solved but nothing, I have also inserted new records but nothing, Any ideas?

rs.status()

{
    "set" : "meteor",
    "date" : ISODate("2016-03-08T16:14:24.181Z"),
    "myState" : 1,
    "term" : NumberLong(3),
    "heartbeatIntervalMillis" : NumberLong(2000),
    "members" : [
        {
            "_id" : 0,
            "name" : "172.27.10.13:27017",
            "health" : 1,
            "state" : 1,
            "stateStr" : "PRIMARY",
            "uptime" : 6920,
            "optime" : {
                "ts" : Timestamp(1457453535, 2),
                "t" : NumberLong(3)
            },
            "optimeDate" : ISODate("2016-03-08T16:12:15Z"),
            "electionTime" : Timestamp(1457446744, 1),
            "electionDate" : ISODate("2016-03-08T14:19:04Z"),
            "configVersion" : 1,
            "self" : true
        }
    ],
    "ok" : 1
}

rs.conf

rs.conf(    rs.config(
meteor:PRIMARY> rs.config()
{
    "_id" : "meteor",
    "version" : 1,
    "protocolVersion" : NumberLong(1),
    "members" : [
        {
            "_id" : 0,
            "host" : "172.27.10.13:27017",
            "arbiterOnly" : false,
            "buildIndexes" : true,
            "hidden" : false,
            "priority" : 1,
            "tags" : {

            },
            "slaveDelay" : NumberLong(0),
            "votes" : 1
        }
    ],
    "settings" : {
        "chainingAllowed" : true,
        "heartbeatIntervalMillis" : 2000,
        "heartbeatTimeoutSecs" : 10,
        "electionTimeoutMillis" : 10000,
        "getLastErrorModes" : {

        },
        "getLastErrorDefaults" : {
            "w" : 1,
            "wtimeout" : 0
        }
    }
}
Landaida
  • 134
  • 2
  • 8

1 Answers1

1

According to your configuration settings you didn't add any other members (secondaries, arbiters etc.) to your replica-set configuration. Beacuse of this mongodb has no way of knowing where to replicat to.

Try adding your remote host to the replica-set configuration like this:

rs.add("your-remote-host:port")

See: https://docs.mongodb.org/manual/tutorial/expand-replica-set/

A.v.D
  • 11
  • 2