Replica Sets
 

Replica Sets

on

  • 11,200 views

 

Statistics

Views

Total Views
11,200
Views on SlideShare
11,178
Embed Views
22

Actions

Likes
15
Downloads
186
Comments
0

1 Embed 22

http://www.mongodb.org 22

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Replica Sets Replica Sets Presentation Transcript

  • !"#$%&'()*+'*,+!"#$%&'+-"./+ 01%23.+4"55%6'*+78,6"559+ :;2"*+ <6)*2)=5+
  • >"*"5'$+?3%$)/)#3@+ •  -3'5,%*2+=)5+-&'$"ABC.+ •  !"#$%&'()*+=)5+DE+ •  F%.3+.3"+)&&'/%)*'$+"G&"#()*+ –  -6'$$+,'.'+/".H+6)/.$@+5"',/+
  • I'/%&/+ •  E+J%.+$%K"+4@-LM+5"#$%&'()*+ –  E/@*&35)*)C/+6'/."5N/$'O"+ –  M".P/+.5@+%.Q+
  • R)66'*,+M%*"+ •  AA6'/."5+SAA)#$)2-%T"+U4IVW+ •  AA/$'O"+X/)C5&"+U3)/.V+SAA)*$@+U,JVW+
  • Y3"+$)&'$+,J+ •  0)"/*P.+5"#$%&'."+ •  B*+6'/."5Z+ –  $)&'$[)#$)2[6'%*+ –  $)&'$[/$'O"/+ •  B*+/$'O"Z+ –  $)&'$[/)C5&"/+ > use local > db.sources.find()
  • E,6%*%/.5'()*+ > // master > use local > db.printReplicationInfo() > db.slaves.find() > db.oplog.$main.findOne() // slave > use local > db.printSlaveReplicationInfo()
  • Y)#)$)2%"/+ M->S M->S ->S ->S M->S(db1) ->S(db2) … M->S ->delayed_S M->S one machine can back up many M-/ (if it has enough resources) M<->M *very limited – best for experiments And Replica Sets (see below)
  • !"#$%&'+-"./+ • +>"*"5'$%T"H+%6#5)O"H+'*,+5"#$'&"+!"#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^4E!f+ 4"6J"5+b+
  • R)*h2C5'()*+ { _id : <setname>, members: [ { _id : <ordinal>, host : <hostname[:port]>, [, priority: <priority>] [, arbiterOnly : true] [, votes : n] [, delay : time] } , ... ], settings: { [heartbeatSleep : <seconds>] [, heartbeatTimeout : <seconds>] [, heartbeatConnRetries : <n>] [, getLastErrorDefaults: <lasterrdefaults>] } }
  • ^*%('()*+ > cfg = { ... _id : "acme_a", ... members : [ ... { _id : 0, host : "sf1.acme.com" }, ... { _id : 1, host : "sf2.acme.com" }, ... { _id : 2, host : "sf3.acme.com" } ] } > use admin > db.runCommand({replSetInitiate:cfg})
  • R)66'*,/+ !"#$%&$'()"*"+"," +R3"&K/+%=+.3"+*),"+.)+13%&3+1"+'5"+&)**"&(*2+%/+&C55"*.$@+#5%6'5@[+ 4)/.+,5%O"5/+,)+.3%/+&3"&K+'C.)6'(&'$$@+'*,+.3"*+/"*,+5"iC%5"/+.)+ .3"+&C55"*.+#5%6'5@[+ !")(-./('0('/'&'1$"*"+"," +-.'.C/+%*=)56'()*+)*+.3"+5"#$%&'+/".+=5)6+.3%/+*),"j/+#)%*.+)=+O%"1[+ +3c#ZNN$)&'$3)/.Zbk;:lN5"#$-".>".-.'.C/m."G.+ !")(-./('23#4&'("*"567389:"," +^*%('."+'+5"#$%&'+/".[++ !")(-./(';)((<("*"5=77.:"," +n5""T%*2+'+5"#$%&'+/".+#5"O"*./+='%$)O"5/+=5)6+)&&C55%*2[+Y3%/+&'*+J"+ C/"=C$+,C5%*2+6'%*."*'*&"[+
  • -".+4"6J"5+Y@#"/+ •  ])56'$+ •  o0!p+7#5%)5%.@+U+:[;9+ –  Y@#%&'$$@+,%/.'*.+$)&'()*+)5+/6'$$"5+3'5,1'5"+ •  ?'//%O"+7#5%)5%.@+qq+;9+ •  E5J%."5+7*)+,'.'H+JC.+&'*+O)."9+
  • F%.3+-3'5,%*2+
  • 0)&/Z+111[6)*2),J[)52N,%/#$'@N0BR-N!"#$%&'r-"./+ LC"/()*/m+ 453"&#(1#0(,(&3#6#(&#72,+8"#9#:;<;#6#".%(=#21># ?'(30)@453"&;$+.# ]"G.+/"//%)*Z+ +EC.)A/3'5,%*2+ s#/.'%5/Z+ +D'&K+/"//%)*+