Saturday, May 23, 2020

Managing block devices with "Stratis" in RHEL8

                              အခု article မှာတော့ အရင် article ရဲ့အဆက်ဖြစ်တဲ့ "Stratis" အကြောင်းကို tutorial လေး လုပ်ပြမှာဖြစ်ပါတယ်။

1. Installing Stratis packages 

                          ထုံးစံအတိုင်း အရင်ဆုံး လိုအပ်တဲ့ packages တွေကို installaiton ပြုလုပ်ပါမယ်။





2. Starting Stratis daemon
                     ပြီးရင်တော့ Stratis daemon ကို #systemctl ဖြင့် start and enable လုပ်မယ်။




3. Check the block devices with #lsblk

                 အရင်ဆုံး Stratis နဲ့ storage pool create မလုပ်ခင် မိမိ system မှာ ရှိတဲ့ block devices တွေကို အရင်စစ်ကြည့်ပါမယ်။ အခုဒီနေရာမှာတော့ ကျွန်တော် /dev/sdb နဲ့ /dev/sdc ကို အသုံးပြုပြသသွားမှာပါ။




4. Start creating a storage pool with Stratis

               အခု စပြီးတော့ Stratis cli ကိုအသုံးပြုပီး storage pool "testpool" တစ်ခု စတင်တည်ဆောက်မှာဖြစ်ပါတယ်။ #stratis pool create ကိုအသုံးပြုထားပီး pool list ကိုပြန်ကြည့်ချင်ရင် #stratis pool list ဖြင့် အသုံးပြုပါတယ်။  Underlying devices တွေကိုကြည့်ချင်ရင်တော့ #stratis blockdev ဖြင့်ကြည့်ပါတယ်။




5. Add additional block device into the existing pool

               အခုကျွန်တော်တို့ /dev/sdb နဲ့စတင်ပီး stratis pool တစ်ခု တည်ဆောက်ပီးတဲ့နောက် အခုလက်ရှိ existing pool ထဲကို နောက်ထပ် additional block device တစ်ခုဘယ်လိုထပ်ပြီး ထည့်မလဲဆိုတာ ကြည့်ရအောင်။ ပြီးရင် ကျွန်တော်တို့ #stratis pool list ဖြင့် ပြန်ကြည့်ရင် underlying devices နေရာမှာ နောက်ထပ် block device တစ်ခု တိုးလာတာ တွေ့ရမှာဖြစ်ပါတယ်။



6. Creating Filesystem on the existing storage pool

               အိုကေ အခု storage pool တစ်ခု တည်ဆောက်ပီးသွားပြီ ဆိုရင် အဲ့ storage ကို အသုံးပြုဖို့အတွက် Stratis VMFS Filesystem "Default=XFS" ဖြင့် filesystem creation လုပ်ပေးရပါမယ်။ ဒီနေရာမှာ XFS ကို user က #mkfs utiliy ကို သုံးပြီး create လုပ်သွားတာမဟုတ်ပဲ Stratis filesystem အနေနဲ့ပဲအသုံးပြုသွားတာဖြစ်ပါတယ်။
                ပြီးရင်တော့ #stratis filesystem list ဖြင့် ကြည့်လျှင် ကျွန်တော်ဆီမှာ အသုံးပြုလို့ရပြီဖြစ်တဲ့ virtual storage device တစ်ခု ရပြီဖြစ်ပါတယ်။ ပြီးရင်  directory တစ်ခုဆောက်မယ် အဲ့ directory မှာ အခု virtual storage device ကို mount လုပ်မှာဖြစ်ပါတယ်။




 7. Using #df -hT to view the newly mounted file

                 #df -hT ကိုအသုံးပြုပြီး ကျွန်တော်တို့ create လုပ်လိုက်တယ့် virutal storage device တွေ့ရမှာဖြစ်ပါတယ်။ ပြီးတော့ ကျွန်တော်တို့ test file တစ်ခု ဆောက်မယ် အဓိက snap-shot နဲ့ အတူ စမ်းပြချင်တဲ့ အတွက်ပါ။



8. Creating a snapshot of existing virtual storage device

               ကျွန်တော်တို့ LVM မှာလို ပဲ Stratis မှာ snapshot ဖမ်းထားနိင်တဲ့ feature ပါ၀င်ပြီး LVM ထက်ကို ပို ပြီး အသုံးပြုရတာ လွယ်အောင် ပြုလုပ်ပေးထားတာဖြစ်ပါတယ်။ Snapshot ဖမ်းပြီးတဲ့နောက် directory တစ်ခုထပ်တည်ဆောက်ပီး snapshot virtual storage ကို mount လိုက်ရင် original storage device မှာ ရှိနေတဲ့ data တွေ ရှိနေတာကို တွေ့မှာဖြစ်ပါတယ်။ 



9. Reviewing the file system list

            #stratis filesystem list ဖြင့် ကြည့်လျှင် လက်ရှိ original storage device နင့် အတူ snapshot ဖမ်းထားတဲ့ storage device filesystem ကိုပါတွေ့ရမှာဖြစ်ပါတယ်။ နောက်တစ်ခုအနေနဲ့ Stratis storage devices တွေကို permanent အနေနဲ့  /etc/fstab မှာ ရေးချင်ရင် devices တွေရဲ့ UUID ကို #stratis filesystem list (or) #blkid /stratis/xxx/xxxx ဖြင့် ထုတ်ကြည့်ပြီး fstab မှာ သွားရေးပေးလို့ရပါတယ်။



10. Destroying Stratis storage pool

                 အိုကေ နောက်ဆုံးတစ်ခု အနေနဲ့ ကျွန်တော်တို့ လက်ရှိတည်ဆောက်ထားတဲ့ Stratis storage pool ကို ပြန်ပြီး delete လုပ်တာ ဖြစ်ပါတယ်။ Stratis storage pool ကို delete လုပ်ရာမှာ အရင်ဆုံး filesystem ကို delete လုပ်ရပါတယ် ပြီးမှသာ block devices တွေရှိတဲ့ storage pool ကို delete လုပ်ရမှာဖြစ်ပါတယ်။ 


Youtube Video Link

That's it!
Thanks and Enjoy Reading!!! :) 
Follow and Like Root Of Info Page and Root Of Info Youtube Channel.

Share:

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.