In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to use Stratis under Linux, with certain reference value, interested friends can refer to, I hope you have a lot of gains after reading this article, let Xiaobian take you to understand.
Stratis is a volume-managing filesystem (VMF) similar to ZFS and Btrfs. It uses the core idea of storage "pooling," which is adopted by VMFs and stand-alone volume managers such as LVM.
img
To get started with Stratis, we need to add a few disk devices and create a separate pool where multiple file systems can be created.
Install Stratis
Use yum to install stratas by:
[root@localhost ~]# yum -y install stratis*
After installation is complete, set boot enable and start immediately:
[root@localhost ~]# systemctl enable stratisd --now
Check if the following are enabled:
List available disks
Five 2GB disks are added here, and the disks are listed using the following command:
[root@localhost ~]# lsblk
List existing pools and file systems:
Use the following commands to list block devices, strata pools, and file systems:
[root@localhost ~]# stratis blockdev list[root@localhost ~]# stratis pool list[root@localhost ~]# stratis filesystem list
Creating pools and file systems
First, we create a pool of "data01_pool." Add/dev/sda,/dev/sdb,/dev/sdc,/dev/sdd to the pool:
[root@localhost ~]# stratis pool create data01_pool /dev/sd{a.. d}[root@localhost ~]# stratis pool list[root@localhost ~]# stratis blockdev list
The above commands create a "data01_pool" pool, view pools, view block devices.
Create two file systems from the "data01_pool" pool:
[root@localhost ~]# stratis filesystem create data01_pool user_data01[root@localhost ~]# stratis filesystem create data01_pool user_data02
The following command lists the file systems created:
[root@localhost ~]#strata filesystem list or [root@localhost ~]#strata fs list
In the file system listed above, the Device field is the location of the stratis device.
Mount the created file system
Once the file system is created from the pool, create a mount point and mount the file system. By default, when a file system is created, it formats it using the XFS file system.
#Create mount point [root@localhost ~]# mkdir /user_data01[root@localhost ~]# mkdir /user_data02#Mount file system [root@localhost ~]# mount /strata/data01_pool/user_data01 /user_data01/[root@localhost ~]# mount /strata/data01_pool/user_data02 /user_data02/
Use df -h to view the mount:
[root@localhost ~]# df -h /user_data*Filesystem Size Used Avail Use% Mounted on/dev/mapper/stratis-1-359fd7072d8349d390741a1a71f885fb-thin-fs-0657c26979ed443aa4d3a70c15606e1c 1.0T 7.2G 1017G 1% /user_data01/dev/mapper/stratis-1-359fd7072d8349d390741a1a71f885fb-thin-fs-b91b970f23d94eb6b2ed56f347f770d2 1.0T 7.2G 1017G 1% /user_data02
I hope you've observed that we don't format file systems. The Stratis program solved this problem for us and created an XFS-type file system.
Again, due to thin provisioning, by default it will show that the file system size is 1 TB and that the size is only virtual, not real. To check the actual size, you will have to use the Stratis command
Use df -hT /user* to match the file systems of user_data01 and user_data02 mount points. You can see that their types are both in XFS format.
Add an entry for boot mount in/etc/fstab
First you need to get the UUID of the file system, there are two ways:
The first way is to get the UUID of the file system by using the stratas fs list.
[root@localhost ~]# stratis fs list
The second way is to use blkid to get the uuid of the block store and filter out the stratis file system:
[root@localhost ~]# blkid|grep stratis
Here's how to write the pending information to/etc/fstab:
[root@localhost ~]# echo "UUID=0657c26979ed443aa4d3a70c15606e1c /user_data01 xfs defaults,x-systemd.requires=stratis.service 0 0" >> /etc/fstab[root@localhost ~]# echo "UUID=b91b970f23d94eb6b2ed56f347f770d2 /user_data02 xfs defaults,x-systemd.requires=stratis.service 0 0" >> /etc/fstab
Check Stratis daemon version
If you need to check the version of the daemon Stratis is running, use the following command:
[root@localhost ~]# stratis daemon version2.1.0
Thank you for reading this article carefully. I hope that the article "How to Use Stratis under Linux" shared by Xiaobian will help everyone. At the same time, I hope that everyone will support you a lot and pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.