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

MFS distributed file system

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

Share

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

1. Brief introduction to MFS:

MooseFS is a network distributed file system with fault tolerance. It distributes the data on multiple physical servers and presents a unified resource to the user.

(1) advantages:

1. High reliability (multiple copies of data are stored on different computers)

2. The dynamic expansion of capacity can be realized by adding a new computer or hard disk.

3. Deleted files can be retained according to a configurable time period (a file system-level Recycle Bin)

4. Coherent snapshots of files that are not affected by access and writes.

(2) Architecture:

1. Management server (master server):

A separate host that manages the entire file system, storing metadata for each file (file size, attributes, location information, including all information about all unconventional files, such as directories, sockets, pipes, and device files)

2. Data server farm (chunk servers):

Any number of commercial servers to store file data and synchronize with each other (if a file has more than one backup)

3. Metadata backup server (metalogger server):

Any number of servers used to store metadata change logs and periodically download major metadata files so that they can be used to manage servers to take over when they are stopped unexpectedly.

4. The client accessing mfs:

Any number of hosts can communicate with the management server (receiving and changing metadata) and data server (changing the actual file data) through the mfsmount process.

Build MFS distributed file system

Modify server hostname

[root@localhost ~] # hostnamectl set-hostname master [root@localhost ~] # su [root@master ~] # [root@localhost ~] # hostnamectl set-hostname log [root@localhost ~] # su [root@log ~] # [root@localhost ~] # hostnamectl set-hostname chunk01 [root@localhost ~] # su [root@chunk01 ~] # [root@localhost ~] # hostnamectl set-hostname chunk02 [root@localhost ~] # su [root@chunk02 ~] # [root@localhost ~] # hostnamectl set -hostname client [root@localhost ~] # su [root@client ~] # build Master server# shutdown firewall [root@master ~] # systemctl stop firewalld.service [root@master ~] # setenforce installation package [root@master ~] # yum install zlib-devel gcc gcc-c++-y # create user [root@master ~] # useradd mfs-s / sbin/nologin# create mount point and mount package file [root@master ~] # makdir / abc [root@ Master ~] # mount.cifs / / 192.168.10.59/LAMP-C7 / abc/Password for root@//192.168.10.59/LAMP-C7: [root@master ~] # cd / abc/rpm/mfs/# decompression package [root@master mfs] # tar zxvf mfs-1.6.27-5.tar.gz-C / opt/ [root@master mfs] # cd / opt/mfs-1.6.27/# compiled source package [root@master mfs -1.6.27] #. / configure\-- prefix=/usr/local/mfs\-- with-default-user=mfs\-- with-default-group=mfs\-- disable-mfschunkserver\-- disable-mfsmount# compile and install [root@master mfs-1.6.27] # make & & make install# copy related file [root@master mfs-1.6.27] # cd / usr/local/mfs/etc/mfs/ [root@master mfs] # cp mfsmaster.cfg.dist mfsmaster .cfg [root@master mfs] # cp mfsexports.cfg.dist mfsexports.cfg [root@master mfs] # cp mfsmetalogger.cfg.distmfsmetalogger.cfg [root@master mfs] # cd / usr/local/mfs/var/mfs/ [root@master mfs] # cp metadata.mfs.empty metadata.mfs# authorizes the user [root@master mfs] # chown-R mfs.mfs / usr/local/mfs/# to enable the service [root@master mfs] # / usr/local/mfs/sbin/mfsmaster start [root @ master ~] # ps-ef | grep mfsmfs 73676 1 0 00:33? 00:00:25 / usr/local/mfs/sbin/mfsmaster startroot 114704 90019 0 08:54 pts/1 00:00:00 grep-- color=auto mfs builds MetaLogger server# shutdown firewall [root@log ~] # systemctl stop firewalld.service [root@log ~] # setenforce installation package [root@log ~] # yum install zlib-devel gcc gcc-c++-y # create user [root@log ~] # useradd mfs- s / sbin/nologin# create mount point and mount package file [root@log ~] # mkdir / abc [root@log ~] # mount.cifs / / 192.168.10.59/LAMP-C7 / abc/Password for root@//192.168.10.59/LAMP-C7: [root@log ~] # cd / abc/rpm/mfs/# decompression package [root@log ~] # tar zxvf mfs- 1.6.27-5.tar.gz-C / opt/ [root@log mfs-1.6.27] # cd / opt/mfs-1.6.27/# compilation Source package [root@log ~] # / configure\-- prefix=/usr/local/mfs\-- with-default-user=mfs\-- with-default-group=mfs\-- disable-mfschunkserver\-- disable-mfsmount# compile and install [root@log mfs-1.6.27] # make & & make install # copy the related file [root@log mfs-1.6.27] # cd / usr/local/mfs/etc/mfs/ [root@log mfs] # cp mfsmetalogger.cfg.dist mfsmetalogger.cfg [root@log mfs] # vim mfsmetalogger.cfg remove 15 lines of comments And modify it to MASTER_HOST = 192.168.18.12 authorize users [root@log ~] # chown-R mfs.mfs / usr/local/mfs/# to enable the service [root@log ~] # / usr/local/mfs/sbin/mfsmetalogger start [root@log ~] # ps-ef | grep mfsroot 45092 21706 0 08:54 pts/1 00:00:00 grep-- color=auto mfsmfs 65494 10 07:20? 00:00:03: build chunkserver

(the configuration of both servers is the same)

# install package [root@chunk01 ~] # yum install zlib-devel gcc gcc-c++-y [root@chunk01 ~] # useradd mfs-s / sbin/nologin# create mount point and mount package file [root@chunk01 ~] # mkdir / abc [root@chunk01 ~] # mount.cifs / / 192.168.10.59/LAMP-C7 / abc/Password for root@//192.168.10.59/LAMP-C7: [root@chunk01 ~] # cd / abc/rpm / mfs/# decompression package [root@chunk01 mfs] # tar zxvf mfs-1.6.27-5.tar.gz-C / opt/ [root@chunk01 mfs] # cd / opt/mfs-1.6.27/# Compiler Source Code package [root@chunk01 mfs-1.6.27] # / configure\-- prefix=/usr/local/mfs\-- with-default-user=mfs\-- with-default-group=mfs\-- disable-mfsmaster\-- disable-mfsmount# compiles and installs Install [root@chunk01 mfs-1.6.27] # make & & make install copy file and modify the configuration file [root@chunk01 mfs-1.6.27] # cd / usr/local/mfs/etc/mfs/ [root@chunk01 mfs] # cp mfschunkserver.cfg.dist mfschunkserver.cfg [root@chunk01 mfs] # cp mfshdd.cfg.dist mfshdd.cfg [root@chunk01 mfs] # vim mfschunkserver.cfg to remove 12 lines of comments And modify it to MASTER_HOST = 192.168.18.128 [root@chunk01 mfs] # vim mfschunkserver.cfg add the directory data/data [root@chunk01 mfs] # mkdir / data [root@chunk01 mfs] # cd [root@chunk01 ~] # chown-R mfs.mfs / data/# at the end of the text to open the service [root@chunk01 ~] # / usr/local/mfs/sbin/mfschunkserver startworking directory: / usr/local/mfs/var/mfslockfile created and lockedinitializing mfschunkserver modules. Hdd space manager: path To scan: / data/hdd space manager: start background hdd scanning (searching for available chunks) main server module: listen on *: 9422no charts data file-initializing empty chartsmfschunkserver daemon initialized properly client configuration # turn off the firewall [root@client ~] # systemctl stop firewalld.service [root@client ~] # setenforce installation package [root@client ~] # yum install gcc gcc-c++ zlib-devel-y [root@client ~] # mkdir / abc [root@client ~] # mount.cifs / / 192. 168.10.59/LAMP-C7 / abc/Password for root@//192.168.10.59/LAMP-C7: [root@client ~] # cd / abc/rpm/mfs/ [root@client mfs] # tar zxvf fuse-2.9.2.tar.gz-C / opt/ [root@client fuse-2.9.2] #. / configure [root@client fuse-2.9.2] # make & & make install [root@client fuse-2.9.2] # vim / etc/profile insert the following sentence exportPKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_ path [root @ client fuse-2.9.2] # source / etc/profile [root@client fuse-2.9.2] # useradd mfs- s / sbin/nologin [root@client fuse-2.9.2] # cd [root@client ~] # cd / abc/rpm/mfs/ [root@client mfs] # tar zxvf mfs-1.6.27-5. Tar.gz-C / opt/ [root@client mfs-1.6.27] #. / configure\-- prefix=/usr/local/mfs\-- with-default-user=mfs\-- with-default-group=mfs\-- disable-mfschunkserver\-- disable-mfsmaster\-- enable-mfsmount# compile and install [root@client mfs-1.6.27] # make & & make install# creation file Mount [root@client mfs-1.6.27] # mkdir / opt/mfs [root@client mfs-1.6.27] # modprobe fuse [root@client mfs-1.6.27] # / usr/local/mfs/bin/mfsmount / opt/mfs-H 192.168.18.128mfsmaster accepted connection with parameters: read-write,restricted_ip The root mapped to root:root optimization client [root@client mfs-1.6.27] # vim / etc/profile inserts the following sentence at the end of the text: export PATH=/usr/local/mfs/bin:$PATH [root@client mfs-1.6.27] # source / etc/profilemater server launch monitoring program [root@master ~] # / usr/local/mfs/sbin/mfscgiserv lockfile created and lockedstarting simple cgi server (host: any, port: 9425, rootpath: / usr/local/mfs/share/mfscgi) [root@master ~] #

Enter the address in the host http://192.168.18.128:9425 to access the page

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