0

I have a problem doing backups of replica set mongodump. Validated the same problem with mongoexport just out of curiosity.

Here is my setup:

  • mongodb-linux-x86_64-static-legacy-2.2.0
  • 3 nodes replica set (as of time being healthy)
PRIMARY> rs.status() {
        "set" : "eu-int",
        "date" : ISODate("2013-03-01T09:54:06Z"),
        "myState" : 1,
        "members" : [
                {
                        "_id" : 0,
                        "name" : "ldnpsr1971:27017",
                        "health" : 1,
                        "state" : 1,
                        "stateStr" : "PRIMARY",
                        "uptime" : 26646,
                        "optime" : {
                                "t" : 1362131645000,
                                "i" : 11
                        },
                        "optimeDate" : ISODate("2013-03-01T09:54:05Z"),
                        "maintenanceMode" : -1,
                        "self" : true
                },
                {
                        "_id" : 1,
                        "name" : "ldnpsr1723:27017",
                        "health" : 1,
                        "state" : 2,
                        "stateStr" : "SECONDARY",
                        "uptime" : 26646,
                        "optime" : {
                                "t" : 1362131645000,
                                "i" : 8
                        },
                        "optimeDate" : ISODate("2013-03-01T09:54:05Z"),
                        "lastHeartbeat" : ISODate("2013-03-01T09:54:05Z"),
                        "pingMs" : 0
                },
                {
                        "_id" : 2,
                        "name" : "ldnpsr2114:27017",
                        "health" : 1,
                        "state" : 2,
                        "stateStr" : "SECONDARY",
                        "uptime" : 26641,
                        "optime" : {
                                "t" : 1362131645000,
                                "i" : 11
                        },
                        "optimeDate" : ISODate("2013-03-01T09:54:05Z"),
                        "lastHeartbeat" : ISODate("2013-03-01T09:54:06Z"),
                        "pingMs" : 0
                }
        ],
        "ok" : 1 }

Now I'm doing my export:

~/mongo/bin/mongodump --host "eu-int/ldnpsr1971:27017,ldnpsr1723:27017,ldnpsr2114:27017" --db msgstore --collection forJames --out ~/data/mongo-backup/eu-int/20130301

Which dies with:

Fri Mar  1 09:55:55 starting new replica set monitor for replica set eu-int with seed of ldnpsr1971:27017,ldnpsr1723:27017,ldnpsr2114:27017
Fri Mar  1 09:55:55 successfully connected to seed ldnpsr1971:27017 for replica set eu-int
Fri Mar  1 09:55:55 changing hosts to { 0: "ldnpsr1971:27017", 1: "ldnpsr2114:27017", 2: "ldnpsr1723:27017" } from eu-int/
Fri Mar  1 09:55:55 trying to add new host ldnpsr1723:27017 to replica set eu-int
Fri Mar  1 09:55:55 successfully connected to new host ldnpsr1723:27017 in replica set eu-int
Fri Mar  1 09:55:55 trying to add new host ldnpsr1971:27017 to replica set eu-int
Fri Mar  1 09:55:55 successfully connected to new host ldnpsr1971:27017 in replica set eu-int
Fri Mar  1 09:55:55 trying to add new host ldnpsr2114:27017 to replica set eu-int
Fri Mar  1 09:55:55 successfully connected to new host ldnpsr2114:27017 in replica set eu-int
Fri Mar  1 09:55:55 Primary for replica set eu-int changed to ldnpsr1971:27017
Fri Mar  1 09:55:55 replica set monitor for replica set eu-int started, address is eu-int/ldnpsr1723:27017,ldnpsr1971:27017,ldnpsr2114:27017
Fri Mar  1 09:55:55 [ReplicaSetMonitorWatcher] starting
connected to: eu-int/ldnpsr1971:27017,ldnpsr1723:27017,ldnpsr2114:27017
Fri Mar  1 09:55:55 DATABASE: msgstore   to     /home/ldnlmxi/data/mongo-backup/eu-int/20130301/msgstore
Illegal instruction (core dumped)

Performing the same command with specifying only a single node (PRIMARY node of the replica set) creates the dump successfully.

Please anyone knows what I'm doing wrong?

Jan Zyka
  • 17,460
  • 16
  • 70
  • 118
  • 1
    you are supposed to do a dump of a single replica node (secondary, so that you don't impact performance on primary). Remember, they all have identical data in them. – Asya Kamsky Mar 01 '13 at 11:29
  • I wonder what is the option to connect to whole replica set for then? In my case the dump takes place in the moment when the app using the DB is not active, performance is not issue at all. I also don't know which node is healthy by the time of doing the dump. So I want to say - backup this collection from the replica set. I don't care which node it will be from as long as the data will be correct. – Jan Zyka Mar 01 '13 at 12:40
  • Just to add I want to script the solution for regular backups. Connecting to each node trying to find out if it is up and healthy sounds like workaround to me rather than proper solution. – Jan Zyka Mar 01 '13 at 12:43
  • I just tried to reproduce it and it worked fine for me. I connected the same way as you did to a replica set and dump worked. `can you reproduce this every time? – Asya Kamsky Mar 01 '13 at 13:15
  • I can, I suspect either the mongo version (static legacy) or the old OS (Red Hat Enterprise Linux AS release 4 (Nahant Update 8)). Do you think any of these could make the difference? – Jan Zyka Mar 01 '13 at 13:22
  • I can reproduce on the same mongo version RedHat 5.7 as well – Jan Zyka Mar 01 '13 at 13:25
  • I tried it with Mac 2.4.0-rc1 (latest release candidate). I won't have a chance to try it on Linux today - you can try the latest version on your platform and see if that fixes it, might help narrow it down. At very latest, try 2.2.3 - lots of fixes over 2.2.0 – Asya Kamsky Mar 01 '13 at 13:35
  • Will give it a try, thanks for tips! If you like some reputation sum up the tips to an answer so I can upvote it! – Jan Zyka Mar 01 '13 at 13:45

1 Answers1

1

You are running into MongoDB bug https://jira.mongodb.org/browse/SERVER-7006 which happened in 2.2.0 but was fixed for 2.2.3 (latest production version).

Upgrading should fix the problem.

Asya Kamsky
  • 41,784
  • 5
  • 109
  • 133