Thuta Learning
ရှာဖွေရန်
Redis
AdvancedData & Databasesbeginner

Sentinel High Availability

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

  • 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 — SentinelRedis

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

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

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

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

You'll know it worked when: Monitored leader၊ replicas၊ peer Sentinels နဲ့ quorum health ရမည်။

Sentinel High Availability | Thuta Learning