Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a main server(windows-27017) and on that i replicated my data on different port (37017) but same server. Now i am trying to add my notebook as a replicate server on mongodb and installed mongodb services on it on port 27017. Now i have three server one main and two replicate. The main server and the port server is working perfectly but the the notebook server is not working. I checked status of the main server and found this

Wed Oct 30 12:25:16.278 trying reconnect to 127.0.0.1:27017
Wed Oct 30 12:25:16.279 reconnect 127.0.0.1:27017 ok
rs1:PRIMARY> rs.status()
{
        "set" : "rs1",
        "date" : ISODate("2013-10-30T03:25:25Z"),
        "myState" : 1,
        "members" : [
                {
                        "_id" : 0,
                        "name" : "192.168.10.99:27017",
                        "health" : 1,
                        "state" : 1,
                        "stateStr" : "PRIMARY",
                        "uptime" : 6832,
                        "optime" : Timestamp(1383103516, 1),
                        "optimeDate" : ISODate("2013-10-30T03:25:16Z"),
                        "self" : true
                },
                {
                        "_id" : 1,
                        "name" : "192.168.10.99:37017",
                        "health" : 1,
                        "state" : 2,
                        "stateStr" : "SECONDARY",
                        "uptime" : 9,
                        "optime" : Timestamp(1383103516, 1),
                        "optimeDate" : ISODate("2013-10-30T03:25:16Z"),
                        "lastHeartbeat" : ISODate("2013-10-30T03:25:24Z"),
                        "lastHeartbeatRecv" : ISODate("2013-10-30T03:25:23Z"),
                        "pingMs" : 0,
                        "lastHeartbeatMessage" : "syncing to: 192.168.10.99:2701
7",
                        "syncingTo" : "192.168.10.99:27017"
                },
                {
                        "_id" : 3,
                        "name" : "192.168.10.97:27017",
                        "health" : 1,
                        "state" : 2,
                        "stateStr" : "SECONDARY",
                        "uptime" : 9,
                        "optime" : Timestamp(1383099655, 1),
                        "optimeDate" : ISODate("2013-10-30T02:20:55Z"),
                        "lastHeartbeat" : ISODate("2013-10-30T03:25:24Z"),
                        "lastHeartbeatRecv" : ISODate("1970-01-01T00:00:00Z"),
                        "pingMs" : 1,
                        "syncingTo" : "192.168.10.99:27017"
                }
        ],
        "ok" : 1
}

I wrote a C program and when i am trying to send the data..it is only being sent to main server and and the port server but no to the notebook server. Can anyone please tell me how i can access notebook server from the main server

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Another thing to try is to run rs.status() on the notebook server and compare the state it sees with the state you saw on the PRIMARY node. The differences there may be descriptive.

The thing with Mongo is that it's very stupid by design, it relies on the OS to do everything except run the database itself (it even doesn't bother implementing a caching layer, relying on the OS block cache for that). So when I see connectivity problems like you describe, I start thinking about OS level problems like firewalls.

There are two ways to configure a pair of MongoDB instances on different servers to not talk to each other:

  1. Configure them to listen to localhost.
  2. Configure one to require authentication, but not the other.

If you're not doing either of those (it isn't the first, and the second is unlikely), chances are good the Windows firewalls haven't been set up to allow the nodes to talk to each other. The main and port servers can do so since they're on the same node, but the notebook server would be on the other side of a firewall. Look to that to ensure you can communicate on the ports.

share|improve this answer
    
I solved the issure...do by any chance can u help me in replicating a Ubunutu server with a backup ubunutu server..? –  Saad Saadi Oct 31 '13 at 7:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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