Your SlideShare is downloading. ×
0
MongoDBghost sync & slaveDelay
こんなログ見たことある?“replica set ghost target no good”               -2 -
What is GHOST ?
replica set ghost target no good                 Sync targetPrimary                        Secondary          Sync target ...
replica set ghost target no good                 Sync targetPrimary                        Secondary           Sync fail  ...
replica set ghost target no good              Sync targetPrimary                               Secondary                  ...
replica set ghost target no good                 Sync targetPrimary                                  Secondary          Gh...
NO GOOD ?
replica set ghost target no good              Sync targetPrimary                               Secondary                  ...
replica set ghost target no good               Sync failPrimary                              Secondary                    ...
replica set ghost target no goodPrimary                               Secondary              Sync target                  ...
replica set ghost target no goodPrimary                               Secondary              Sync target                  ...
NO GOOD !! (2.0.X系 )
replica set ghost target no good■ Ghost sync  ●   Replica-Setの可用性を向上する為のユニークな機能      –   ネットワーク部分障害時などに威力を発揮      –   prim...
Ghost sync on 2.3/2.4
proper ghost sync                   Sync targetPrimary                          Secondary             Sync fail           ...
proper ghost sync                Sync targetPrimary                                 Secondary                             ...
proper ghost sync                   Sync targetPrimary                                    Secondary            Ghost slave...
proper ghost sync                   Sync targetPrimary                          Secondary                          経路が復旧すれ...
Ghost sync on 2.3/2.4■ Sync details   ●   “settings.chainingAllowed=false” (2.2系以上)の場合        常にPrimaryから同期する       –   sy...
What is slaveDelay ?
slaveDelayPrimary                         Secondary          Sync target             Secondary                slaveDelay=6...
slaveDelay   Inset A      APrimary                        Secondary             Secondary               slaveDelay=60     ...
slaveDelay          Sync immediately     A                         APrimary                      Secondary           Secon...
slaveDelay  Inset B  B    A                        APrimary                       Secondary            Secondary          ...
slaveDelay          Sync immediately  B   A                        A   BPrimary                      Secondary           S...
slaveDelay  B   A                            A      BPrimary                      Secondary            Sync A after 60 sec...
slaveDelay■ Replica-Set コンフィグで指定する  ●   slaveDelay=<seconds> を指定したノードはPRIMARYから       指定秒遅れたコピーを持つ様に動作する。  ●   priority=0 ...
Ghost sync & slaveDelay
Ghost sync & slaveDelay                 Sync targetPrimary                                  Secondary          Ghost slave...
Ghost sync & slaveDelay   Inset A      APrimary                       Secondary             Secondary              slaveDe...
Ghost sync & slaveDelay          Sync immediately     A                         APrimary                      Secondary   ...
Ghost sync & slaveDelay  Inset B  B    A                        APrimary                       Secondary             Secon...
Ghost sync & slaveDelay            Sync immediately  B   A                          A   BPrimary                        Se...
Ghost sync & slaveDelay  B   A                              A      BPrimary                        Secondary              ...
Its OK !!
Ghost sync & slaveDelayPrimary                     Secondary           Secondary            slaveDelay=60               -3...
Ghost sync & slaveDelay   Inset A      APrimary                       Secondary             Secondary              slaveDe...
Ghost sync & slaveDelay  Inset B  B    APrimary                       Secondary             Secondary              slaveDe...
Ghost sync & slaveDelay     B     A                                    A Primary                                  Secondar...
No good ...
Ghost sync & slaveDelay■ Ghost syncとslaveDelayは相性が悪い  slaveDelay ノードはPRIMARYノードから遅れているので同期元として  選ばれるべきでは無い。   slaveOkで動作して...
[slaveDelay with Ghostsync]    https://jira.mongodb.org/browse/SERVER-8476              対策よろ。。
補足.
Vote with ghost syncPrimary                 SecondarySecondary Secondary Secondary              -45 -
Vote with ghost syncPrimary                 SecondarySecondary Secondary Secondary              -46 -
Vote with ghost syncPrimary                 SecondarySecondary Secondary Secondary              -47 -
Vote with ghost syncPrimary                 SecondarySecondary Secondary Secondary              -48 -
Vote with ghost syncSecondary                PrimarySecondary Secondary Secondary              -49 -
Vote with ghost syncSecondary               SecondarySecondary   Primary   Secondary              -50 -
Upcoming SlideShare
Loading in...5
×

Mongo ghostsync and slaveDelay (Japanease)

707

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
707
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Mongo ghostsync and slaveDelay (Japanease)"

  1. 1. MongoDBghost sync & slaveDelay
  2. 2. こんなログ見たことある?“replica set ghost target no good” -2 -
  3. 3. What is GHOST ?
  4. 4. replica set ghost target no good Sync targetPrimary Secondary Sync target Secondary -4 -
  5. 5. replica set ghost target no good Sync targetPrimary Secondary Sync fail Secondary -5 -
  6. 6. replica set ghost target no good Sync targetPrimary Secondary Sync target Secondary -6 -
  7. 7. replica set ghost target no good Sync targetPrimary Secondary Ghost slave Sync target Ghost target Secondary -7 -
  8. 8. NO GOOD ?
  9. 9. replica set ghost target no good Sync targetPrimary Secondary Sync target Secondary -9 -
  10. 10. replica set ghost target no good Sync failPrimary Secondary Sync target Secondary -10 -
  11. 11. replica set ghost target no goodPrimary Secondary Sync target Sync target Secondary -11 -
  12. 12. replica set ghost target no goodPrimary Secondary Sync target Sync target “replica set ghost target no good” Secondary -12 -
  13. 13. NO GOOD !! (2.0.X系 )
  14. 14. replica set ghost target no good■ Ghost sync ● Replica-Setの可用性を向上する為のユニークな機能 – ネットワーク部分障害時などに威力を発揮 – primary oplog 溢れ対策に一部のsecondaryに巨大なoplogを用意し  ピーク時間帯をやり過ごしたり – 新規secondaryをjoinする際の大量同期に使ったり ● ただ2.0系には循環参照のバグあり!! – 2.2系を使うこと -14 -
  15. 15. Ghost sync on 2.3/2.4
  16. 16. proper ghost sync Sync targetPrimary Secondary Sync fail Secondary -16 -
  17. 17. proper ghost sync Sync targetPrimary Secondary Sync target Secondary -17 -
  18. 18. proper ghost sync Sync targetPrimary Secondary Ghost slave Sync target Ghost target Secondary -18 -
  19. 19. proper ghost sync Sync targetPrimary Secondary 経路が復旧すれば Sync target 直ちに同期先が戻る Secondary -19 -
  20. 20. Ghost sync on 2.3/2.4■ Sync details ● “settings.chainingAllowed=false” (2.2系以上)の場合  常にPrimaryから同期する – syncFrom()による指定はchainingAllowedより優先 – syncFrom()の設定は単にonメモリに保存され、クリアできない。(要再起動) – syncForm()の設定は同期に失敗するとクリアされる。 ● PrimaryのopTimeをチェックし  新鮮で近いノードを同期ターゲットとして選択する – 新鮮:自ノードより新しくPrimaryから30秒以内の鮮度 – 近い:ping の応答時間 – slaveDelayやhiddenではない – vetoリスト(拒否リスト)に入っていない -20 -
  21. 21. What is slaveDelay ?
  22. 22. slaveDelayPrimary Secondary Sync target Secondary slaveDelay=60 -22 -
  23. 23. slaveDelay Inset A APrimary Secondary Secondary slaveDelay=60 -23 -
  24. 24. slaveDelay Sync immediately A APrimary Secondary Secondary slaveDelay=60 -24 -
  25. 25. slaveDelay Inset B B A APrimary Secondary Secondary slaveDelay=60 -25 -
  26. 26. slaveDelay Sync immediately B A A BPrimary Secondary Secondary slaveDelay=60 -26 -
  27. 27. slaveDelay B A A BPrimary Secondary Sync A after 60 secs from “Insert A” A Secondary slaveDelay=60 -27 -
  28. 28. slaveDelay■ Replica-Set コンフィグで指定する ● slaveDelay=<seconds> を指定したノードはPRIMARYから  指定秒遅れたコピーを持つ様に動作する。 ● priority=0 を同時に指定しなければならない。 – これはslaveDelayノードはPRIMARYに成れない事を意味する ● 殆どの場合hidden=true と併用した方が良い。 – 大抵、クライアント(アプリ)は最新のデータを読みたいはず。 ● slaveDelayはヒューマンエラー対策として有用!  例えば、間違えて“db.dropDatabase()” を発行してしまった場合 通常、全てのsecondary達は直ちにデータファイルを削除してしまう。  よって、データは完全に失われてしまう。  しかしslaveDelayノードでは遅延期間内はまだ消えてない! 急いでslaveDelayノードを落とせ!!(同期を防ぐ) -28 -
  29. 29. Ghost sync & slaveDelay
  30. 30. Ghost sync & slaveDelay Sync targetPrimary Secondary Ghost slave Sync target Ghost target Secondary slaveDelay=60 -30 -
  31. 31. Ghost sync & slaveDelay Inset A APrimary Secondary Secondary slaveDelay=60 -31 -
  32. 32. Ghost sync & slaveDelay Sync immediately A APrimary Secondary Secondary slaveDelay=60 -32 -
  33. 33. Ghost sync & slaveDelay Inset B B A APrimary Secondary Secondary slaveDelay=60 -33 -
  34. 34. Ghost sync & slaveDelay Sync immediately B A A BPrimary Secondary Secondary slaveDelay=60 -34 -
  35. 35. Ghost sync & slaveDelay B A A BPrimary Secondary Sync A after 60 secs from “Insert A” A Secondary slaveDelay=60 -35 -
  36. 36. Its OK !!
  37. 37. Ghost sync & slaveDelayPrimary Secondary Secondary slaveDelay=60 -37 -
  38. 38. Ghost sync & slaveDelay Inset A APrimary Secondary Secondary slaveDelay=60 -38 -
  39. 39. Ghost sync & slaveDelay Inset B B APrimary Secondary Secondary slaveDelay=60 -39 -
  40. 40. Ghost sync & slaveDelay B A A Primary Secondary Sync immediately, but delayed implicitlySync A after 60 secs from “Insert A” A Secondary slaveDelay=60 -40 -
  41. 41. No good ...
  42. 42. Ghost sync & slaveDelay■ Ghost syncとslaveDelayは相性が悪い slaveDelay ノードはPRIMARYノードから遅れているので同期元として 選ばれるべきでは無い。 slaveOkで動作しているクライアントはPrimaryのデータ更新しても secondaryからはからは古いデータしか読めない状況になる!! slaveDelayノードを同期元として選んでしまったノードは、クライアン ト(アプリ)からリクエストを受けてはならない。 ( MAINTAINANCE か HIDDENとして扱われるべき) -42 -
  43. 43. [slaveDelay with Ghostsync] https://jira.mongodb.org/browse/SERVER-8476 対策よろ。。
  44. 44. 補足.
  45. 45. Vote with ghost syncPrimary SecondarySecondary Secondary Secondary -45 -
  46. 46. Vote with ghost syncPrimary SecondarySecondary Secondary Secondary -46 -
  47. 47. Vote with ghost syncPrimary SecondarySecondary Secondary Secondary -47 -
  48. 48. Vote with ghost syncPrimary SecondarySecondary Secondary Secondary -48 -
  49. 49. Vote with ghost syncSecondary PrimarySecondary Secondary Secondary -49 -
  50. 50. Vote with ghost syncSecondary SecondarySecondary Primary Secondary -50 -
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×