Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction to the principle of GlusterFS storage structure

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

I. distributed file system

Distributed file system (Distributed File System) means that the physical storage resources managed by the file system are not directly connected to the local node, but are distributed on the computers of one or more nodes in the computing network. At present, most of the distributed file systems are composed of multiple node computers, and the structure is a typical client / server mode. The popular mode is that when a client needs to store data, the server instructs it to distribute the data to multiple storage nodes to provide faster speed, larger capacity and better redundancy.

At present, there are many popular distributed file systems, such as MooseFS, OpenAFS, GoogleFS. I will not introduce the specific implementation principles here.

II. Overview of GlusterFS

GlusterFS system is an extensible network file system. Compared with other distributed file systems, GlusterFS has the characteristics of high scalability, high availability, high performance and horizontal scalability, and it has no metadata server design, so that the whole service has no hidden danger of single point of failure.

Terminology:

A storage unit in Brick:GFS that is an export directory of a server in a trusted storage pool. Can be identified by hostname and directory name, such as' SERVER:EXPORT'

Client: the device with the GFS volume mounted

Extended Attributes:xattr is a file system feature that allows users or programs to associate files / directories and metadata.

FUSE:Filesystem Userspace is a loadable kernel module that allows non-privileged users to create their own file systems without modifying kernel code. The code that runs the file system in user space is bridged with the kernel through FUSE code.

Geo-Replication

Each file or directory in a GFID:GFS volume is associated with a unique 128bit data, which is used to simulate inode

Namespace: each Gluster volume exports a single ns as the mount point for POSIX

Node: a device with several brick

RDMA: remote direct memory access, which supports direct memory access without the OS of both parties.

RRDNS:round robin DNS is a method that returns different devices through DNS rotation for load balancing.

Self-heal: used for background runs to detect inconsistencies between files and directories in the replica volume and resolve these inconsistencies.

Split-brain: cerebral fissure

Translator:

The configuration file for the Volfile:glusterfs process, usually located in / var/lib/glusterd/vols/volname

Volume: a logical set of bricks

1. Design without metadata.

Metadata is used to describe the location of a file or a given chunk in a distributed file system, in short, the location where a file or chunk is stored. Traditional distributed file systems will set up metadata servers or management servers with similar functions, which are mainly used to manage the storage location relationship between files and data blocks. Compared with other distributed file systems, GlusterFS does not have the concept of centralized or distributed metadata, instead of elastic hashing algorithm. Any server and client in the cluster can use the hash algorithm, path and file name to calculate, then the data can be located and read and write access operations can be performed.

The advantage of this design is that it not only greatly improves the scalability, but also improves the performance and reliability of the system; another remarkable feature is that if a certain file name is given, it will be very fast to find the file location. However, if you want to list files or directories, performance will be greatly degraded, because when listing files or directories, you need to query the node and aggregate the information in each node. At this time, the query efficiency of the distributed file system with metadata service will be much improved.

2. Deployment between servers

In previous versions, the relationship between servers is peer-to-peer, that is to say, each node server has the configuration information of the cluster. The advantage of this is that each node has the configuration information of the node, which is highly autonomous. All information can be queried locally. The information update of each node will be advertised to other nodes to ensure the consistency of information between nodes. However, if the scale of the cluster is large and there are many nodes, the efficiency of information synchronization will decrease and the inconsistency probability of node information will be greatly improved. Therefore, the future version of GlusterFS has a tendency to change to centralized management.

3. Client access process

When the client accesses GlusterFS storage, the program first reads and writes data by accessing the mount point. For users and programs, the cluster file system is transparent, and users and programs simply do not feel whether the file system is local or on a remote server. The read and write operations will be handed over to VFS (Virtual File System), the VFS will pass the request to the FUSE kernel module, and the FUSE will pass the data to the GlusterFS Client through the device / dev/fuse. Finally, it is calculated by GlusterFS Client, and finally the request or data is sent to GlusterFS Server through the network.

Third, the mode of GlusterFS cluster

The mode of the GlusterFS cluster is only the structure in which the data is stored in the cluster, similar to the level in the disk array.

1. Distributed volumes (Distributed Volume)

Also known as hash volume, similar to RAID0, the file is not sliced, the file is written to the hard disk of each node according to the hash algorithm, the advantage is large capacity, the disadvantage is no redundancy.

The create volume instructions are as follows:

Gluster volume create test-volume server1:/exp1 server2:/exp2 server3:/exp3 server4:/exp4

2. Copy volume (Replicated Volume)

Equivalent to raid1, the number of copies, which determines the size of the cluster, is usually used in combination with distributed volumes or stripe volumes to solve the redundancy defects of the first two types of storage volumes. The disadvantage is low disk utilization.

Duplicate volumes can be created with a specified number of replicas, usually 2 or 3, which will be stored on different brick of the volume, so several replicas must provide at least multiple brick, and when one server fails, you can read data from another server, so replicating GlusterFS volumes improves data reliability for colleagues, and also provides data redundancy.

The create volume instructions are as follows:

Gluster volume create test-volume replica 2 transport tcp server1:/exp1 server2:/exp2

3. Distributed replication volumes (Distributed Replicated Volume)

Distributed replication GlusterFS volumes combine the characteristics of distributed and replication Gluster volumes, which looks similar to RAID10, but in fact, RAID10 is essentially striped, but distributed replication GlusterFS volumes do not.

The create volume instructions are as follows:

Gluster volume create test-volume replica 2 transport tcp server1:/exp1 server2:/exp2 server3:/exp3 server4:/exp4

4. Stripe Volume (Striped Volume)

Equivalent to raid0, files are written evenly on the hard disk of each node, with the advantage of distributed read and write and good performance as a whole. The disadvantage is that there is no redundancy, and random read and write in fragments may cause the hard disk IOPS to become saturated.

The create volume instructions are as follows:

Gluster volume create test-volume stripe 2 transport tcp server1:/exp1 server2:/exp2

5. Distributed stripe volume (Distributed Striped Volume)

When the size of a single file is very large and there are more clients, the stripe volume can no longer meet the demand, so it is a better choice to combine distribution with striping. Its performance is related to the number of servers.

The create volume instructions are as follows:

Gluster volume create test-volume stripe 4 transport tcp server1:/exp1 server2:/exp2 server3:/exp3 server4:/exp4 server5:/exp5 server6:/exp6 server7:/exp7 server8:/exp8

Reference document: http://gluster.readthedocs.io/en/latest/Quick-Start-Guide/Architecture/

IV. For the installation and application of GlusterFS, please click to view

Http://wzlinux.blog.51cto.com/8021085/1949619

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report