2013-03-01 65 views
0

我做副本的備份設置mongodump問題。出於好奇,用mongoexport驗證了同樣的問題。蒙戈進口/轉儲不與副本的工作集

這裏是我的設置:

  • MongoDB的Linux的-x86_64的靜電遺留-2.2.0
  • 3個節點副本集(如時間是健康的)
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 } 

現在我正在做我的出口:

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

,其與模具:

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) 

執行相同的命令僅指定單個節點(副本集的主節點)成功地創建了轉儲。

請的人都知道我在做什麼錯?

+1

你應該做一個副本節點的轉儲(次要的,這樣你就不會在主要衝擊性能)。請記住,他們都有相同的數據。 – 2013-03-01 11:29:19

+0

我想知道連接整個副本集的選項是什麼?在我的情況下,轉儲發生在使用數據庫的應用程序不活動時,性能完全沒有問題。我也不知道在做轉儲時哪個節點是健康的。所以我想說 - 從副本集備份這個集合。只要數據是正確的,我不關心它將來自哪個節點。 – 2013-03-01 12:40:02

+0

只需添加我想爲定期備份的腳本解決方案。試圖找出每個節點是否啓動並健康聽起來像是解決方法,而不是正確的解決方案。 – 2013-03-01 12:43:06

回答

1

您正在運行到MongoDB的錯誤https://jira.mongodb.org/browse/SERVER-7006這發生在2.2.0但固定2.2.3(最新的生產版本)。

升級就可以解決問題。

+0

確實,安裝了2.2.3並且問題沒有了。感謝您的幫助和您的時間! – 2013-03-01 15:03:15