Red Hat Storage Management 2--volume type and creation

Source: Internet
Author: User
Tags gluster



Red Hat Storage Management 2--volume type and creation






Third, the management of volume



The main object of Red Hat Storage server Management is Volume,volume is a collection of brick logic, this kind of collection method also has many, different collection way represents different volume type, there are seven major types






1. Volume type






Distributed



Distributed: Distributes files evenly to different bricks (evenly distributed by number of files), if a volume contains only 1 brick, also called distributed volume, so distributed volume must contain at least 1 brick



650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/BD/wKioL1WFIsPQTERrAAJZbIUVgcI968.jpg "title=" 1.png " alt= "Wkiol1wfispqterraajzbiuvgci968.jpg"/>






Replicated



Copying the file to the nature of replication in different bricks, because the file is in the form of replication, then relicated volume need at least 2 brick, if a file to be copied in the form of 2 brick, called two-way Replicated volume, if it is saved in 3 brick, called three-wayreplicated volume, then Three-way must have at least 3 brick



650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/C1/wKiom1WFJnPQfzp9AAJWzUldLIc539.jpg "title=" 2.png " alt= "Wkiom1wfjnpqfzp9aajwzuldlic539.jpg"/>



650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/C1/wKiom1WFIkewl_AoAAJfh5euGbo459.jpg "style=" float: none; "title=" 3.png "alt=" Wkiom1wfikewl_aoaajfh5eugbo459.jpg "/>






Striped



Fragment stores the files into equal-length fragments in different bricks. Stripedvolume requires at least 2 brick, which first divides a file into several file fragments at a specified length, and then stores the fragments of these files in different brick, as seen in brick, where different fragments exist in the form of the original file name. But only part of the file, not all.



650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/BD/wKioL1WFJwXjrU49AAJDcIL8Kaw859.jpg "title=" 4.png " alt= "Wkiol1wfjwxjru49aajdcil8kaw859.jpg"/>






Distributed replicated Volume



The combination of distributed and replicated, previously said that distribute need at least 1 brick,replicated at least 2 brick, then a distributed replicated volume need at least 1x2=2 brick , this can also be called: distributedxreplicated=1x2, then figure 6.2 above is a 1x2 distributedreplicated volume, figure 6.3 is a 1x3 distributed Replicated volume. is a 2x2 distributedreplicated volume. Stored procedures: The first time you create a 2x2 distributed replicated volume, you have divided 4 brick into two parts (distributed=2), then two brick in each section, These two brick are (two-way) replicated, storing the same files. So if we have two files, first distribute two files into two parts (distributed=2), then copy each file into two files (replicated=2) and then separate them into different brick. Figure 6.5 is a 2x3 distributed replicated volume.



650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/C1/wKiom1WFJWOimIyUAALBuevULQM616.jpg "style=" float: none; "title=" 5.png "alt=" Wkiom1wfjwoimiyuaalbuevulqm616.jpg "/>



650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/BD/wKioL1WFJxnAgglSAALO2ZRnLFA460.jpg "style=" float: none; "title=" 6.png "alt=" Wkiol1wfjxnagglsaalo2zrnlfa460.jpg "/>






Distributed Striped Volume



Combining distributed and fragmented, distributed requires at least 1 brick,striped of at least 2 brick,1 distributed striped volume at least 1x2=2 brick, and Figure 6.6 is a 1x 2 of distributed Stripedvolume. is a 2x2 distributed striped volume. Stored procedure: First, when creating 2x2 distributed Stripedvolume, 4 brick are divided into two parts (distributed=2), then two brick in each section, two brick is striped= 2 fragment storage type, if there are two files to be stored in this volume, first of all two files into two blocks (distributed=2), and then each file into equal-size fragments, and then deposited in brick respectively.



650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/BD/wKioL1WFJz6QO63SAAKsDM_3ziw933.jpg "title=" 7.png " alt= "Wkiol1wfjz6qo63saaksdm_3ziw933.jpg"/>






Striped Replicated Volume



Combining fragment and replication, is a 2x2 striped replicated volume that stores data by splitting the file into fragments, dividing the fragments into two parts according to the rules (striped=2), and then copying the two parts separately (replicated= 2) deposit in different brick.



650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/C1/wKiom1WFJaTBHAUxAAK2xSJ4rOM679.jpg "title=" 8.png " alt= "Wkiom1wfjatbhauxaak2xsj4rom679.jpg"/>






Distributed striped Replicated Volume



6.8 can also be said to be 1x2x2 distributedstriped replicated volume, the data storage first distribution and then the fragment copy. is a 2x2x2 distributed striped replicated volume, it needs 2x2x2=8 brick.



650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/C1/wKiom1WFJcazcUiaAAK2q-MxDgs942.jpg "title=" 9.png " alt= "Wkiom1wfjcazcuiaaak2q-mxdgs942.jpg"/>






Summary



In fact, three basic types are based on distributed.



Distributed mode is not any action before distributing the file.



Replicated mode is to copy files into multiple files and do distribution operations.



Striped mode is to split the file into multiple fragments and then drop the fragments for distribution operations.



650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/BD/wKioL1WFJ4zATDILAAHWPYdigCs384.jpg "title=" 10.png "alt=" Wkiol1wfj4zatdilaahwpydigcs384.jpg "/>









2. Volume creation and management



Before creating the volume we need to be clear about the type of volume we want to create, how many brick,brick the type needs, and so on, we have to plan ahead.






Basic command to create volume (i.e. create distributed type volume)


Gluster volume Create Volume_Name brick_name ...


Example: Create a distributedvolume with 2 brick


[root@rhs0 ~]# gluster volume create new_volume [transporttcp|rdma|tcp,rdma] rhs0:/bricks/brick1/brick/ rhs1:/bricks/brick11/brick
volume create: new_volume: success: please start the volume to accessdata
[root@rhs0 ~]# gluster volume info
Volume Name: new_volume
Type: Distribute
Status: Created
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: rhs0:/bricks/brick1/brick/
Brick2: rhs1:/bricks/brick11/brick


Create replicated Type Volume



Basic commands


Gluster volume Create volume_name [transport TCP|RDMA|TCP,RDMA] Replicacount brick_name ...


Create a two-wayreplicated that contains 2 brick volume


[root@rhs0 ~]# gluster volume create rep replica 2 > rhs0:/bricks/brick1/brick/ > rhs1:/bricks/brick11/brick
volume create: rep: success: please start the volume to access data
[root@rhs0 ~]# gluster volume info
Volume Name: rep
Type: Replicate
Volume ID: d7fdb75b-9451-41f7-93f0-48df06b103a7
Status: Created
Snap Volume: no
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: rhs0:/bricks/brick1/brick
Brick2: rhs1:/bricks/brick11/brick
Options Reconfigured:
performance.readdir-ahead: on
snap-max-hard-limit: 256
snap-max-soft-limit: 90
auto-delete: disable



Basic commands for creating striped-type volume


Gluster volume Create volume_name [transport TCP|RDMA|TCP,RDMA] Stripe countbrick_name


Compared to creating replicated volume, the replica count is changed to stripe count, and the other is unchanged.






So if we're going to create a hybrid volume, how do we configure it?



We already know that the volume default is the distributed type, so we just need to add the required brick quantity on replicated or striped basis, for example we want to create 2x 2 distributedreplicated Volume We simply add 4 brick on the basis of creating the replicated volume command and it will automatically become distributedreplicated volume, which is 2x 2 of distributedreplicated volume, if we add 6 brick, it becomes 3x2 distributedreplicated volume. Similarly distributed Stripedvolume is the same.



Example:


[root@rhs0 ~]# gluster volume create rep replica 2 > rhs0:/bricks/brick1/brick/ > rhs1:/bricks/brick11/brick/ > rhs2:/bricks/brick21/brick/ > rhs3:/bricks/brick31/brick/
volume create: rep: success: please start the volume to access data
[root@rhs0 ~]# gluster volume info
Volume Name: rep
Type: Distributed-Replicate
Volume ID: d7fdb75b-9451-41f7-93f0-48df06b103a7
Status: Created
Snap Volume: no
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: rhs0:/bricks/brick1/brick
Brick2: rhs1:/bricks/brick11/brick
Brick2: rhs2:/bricks/brick21/brick
Brick2: rhs3:/bricks/brick31/brick
Options Reconfigured:
performance.readdir-ahead: on
snap-max-hard-limit: 256
snap-max-soft-limit: 90
auto-delete: disable

Create striped Replicated Volume



Basic commands


Gluster volume Create volume_name [transport TCP|RDMA|TCP,RDMA] stripe countreplica COUNT brick_name ...


If it is a 2x2 striped replicatedvolume, then the count value is 2,brick_name to have 4 BRICK. I'm not actually working here.






Create distributed stripedreplicated Volume



Striped replicated volume command based on a sufficient number of brick, will automatically become distributed stripedreplicated volume, on top of which we add 4 brick is a 2x2 striped Replicatedvolume, then if the addition of 8 brick will automatically become 2x2x2 distributed stripedreplicated volume









D istributed, replicated, striped three types of features



Distributed only distributes files evenly based on the number of files, but if a server goes down, the data is lost



Replicated files are copied and stored on multiple servers, reducing the risk of data loss from downtime



Striped is mainly used in the environment containing more large files, can make up the distributed of the number of files to distribute the shortcomings






Issues to be aware of in creating volume



1, the server must turn on the Glusterd service



2. The server must be in a trusted storage pool



3. The brick added in volume is a directory under the brick mount point



4, the same brick can only appear in a volume



5, if the creation of the volume failed, the added brick needs to be re-uninstalled, and then reformatted, formatted with-F forced to format, and then re-mount, and then the mount point to create subdirectories before you can reuse the brick.



Specific steps:


[root@rhs0~]# umount  /bricks/brick1
[root@rhs0~]# mkfs.xfs –I size=512 /dev/vg_bricks/brick1 –f
[root@rhs0~]# mkdir /bricks/brick1 –p
[root@rhs0~]# mount –a
[root@rhs0~]# mkdir /bricks/brick1/brick


Another way is to uninstall brick, then remove the LV, and then use the script to create a new brick






This article is from the "0 basic Linux" blog, so be sure to keep this source http://huangmh77.blog.51cto.com/10041435/1663848



Red Hat Storage Management 2--volume type and creation


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.