Thuta Learning
Redis
AdvancedData & Databasesအခြေခံ

Sentinel High Availability

Redisသင်ခန်းစာ 23

ဒီခန်းပြီးရင် ဘာတတ်သွားမလဲ

  • Sentinel High Availability concept ကို နားလည်ရှင်းပြနိုင်ရန်
  • နမူနာ Redis command/code ကို ကိုယ်တိုင် run ပြီး output စစ်နိုင်ရန်
  • Tutorial Platform project နှင့် production scenario တွင် မှန်ကန်စွာအသုံးချနိုင်ရန်

နားလည်ထားရမယ့် အချက်

Redis Sentinel က non-clustered Redis deployment တွင် monitoring၊ failure detection၊ leader discovery နဲ့ automated failover ပေးပါတယ်။ Sentinels များ consensus ဖြင့် leader down ဆုံးဖြတ်ကြပြီး replica တစ်ခု promote လုပ်ပါတယ်။ Redis data nodes နှစ်ခုသာမဟုတ်ဘဲ independent failure domains တွင် Sentinel processes အနည်းဆုံးသုံးခုသုံးလေ့ရှိပါတယ်။

လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်

Leader + two replicas + three Sentinels lab ဆောက်ပြီး client ကို static leader hostname မဟုတ်ဘဲ service name ဖြင့် Sentinel discovery သုံးစေမယ်။ Leader kill test တွင် detection time၊ promotion၊ client reconnect၊ write error window နဲ့ stale old-leader fencing ကိုတိုင်းမယ်။

အတူတူ စမ်းရေးကြည့်မယ်

shell
SENTINEL MASTERS
SENTINEL MASTER tutorial-primary
SENTINEL REPLICAS tutorial-primary
SENTINEL SENTINELS tutorial-primary
SENTINEL GET-MASTER-ADDR-BY-NAME tutorial-primary
SENTINEL CKQUORUM tutorial-primary
You should see
Monitored leader၊ replicas၊ peer Sentinels နဲ့ quorum health ရမည်။

၅ မိနစ် စမ်းကြည့်

AZ တစ်ခုဆုံးသွားသည့် scenario အတွက် 3/5 Sentinel placement နဲ့ quorum တွက်ပါ။

သတိလေးတစ်ချက်

Sentinels အားလုံး host/AZ တစ်ခုတည်းထားလျှင် shared failure မှာ quorum အကျိုးမရှိပါ။

Redis — Sentinel — Redis

ဒီနေရာမှာ လူအများမှားတတ်တယ်

  • Sentinels အားလုံး host/AZ တစ်ခုတည်းထားလျှင် shared failure မှာ quorum အကျိုးမရှိပါ။
  • နမူနာ command ကို production Redis ပေါ် တိုက်ရိုက်မစမ်းဘဲ local/test instance နဲ့ recoverable data ပေါ်တွင် အရင်အတည်ပြုပါ။

လေ့ကျင့်ခန်း

AZ တစ်ခုဆုံးသွားသည့် scenario အတွက် 3/5 Sentinel placement နဲ့ quorum တွက်ပါ။

အလုပ်ဖြစ်ကြောင်း ဒီလိုသိမယ်: Monitored leader၊ replicas၊ peer Sentinels နဲ့ quorum health ရမည်။

နောက်ဆုံးပြင်ဆင်ရက်

Progress ကို ဤ browser (ဤစက်) တွင်သာ သိမ်းထားပါသည်။ အခြားစက်များနှင့် sync မလုပ်ပါ။

ဤသင်ခန်းစာတွင် အမှားတွေ့ပါက အကြောင်းကြားရန်သင့် email app ကို ဤသင်ခန်းစာလိပ်စာ ဖြည့်ပြီးသားဖြင့် ဖွင့်ပေးပါမည် — သင်ကိုယ်တိုင် ပို့မှသာ ပို့မည်ဖြစ်သည်။

Sentinel High Availability | Thuta Learning