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

Detailed explanation of MFS distributed File system Construction and Monitoring

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

Share

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

MFS introduction

Official website address: http://www.moosefs.com/

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. The general file system can be used without modifying upper layer applications, and the capacity can be dynamically expanded by attaching new computers or hard disks. The architecture is highly scalable. Deleted files can be retained according to the configured time period (a recycle bin at the file system level), highly reliable (multiple copies of data are stored on different computers), and provide web monitoring interface. Improve the efficiency of random reading or writing, and improve the reading and writing efficiency of a large number of small files. However, mfs caches the structure of the file system into the memory of master. The more files, the greater the memory consumption of master. 8g corresponds to 2500w of files, and 200 million files get 64GB memory. Support for special files (block and character devices, pipes, and sockets), symbolic connections and hard connections.

It includes the following four roles:

The role management server managing server (master) is responsible for the management of each data storage server, file read and write scheduling, file space recovery and recovery. The multi-node copy metadata log server Metalogger server (Metalogger) is responsible for backing up the change log files of the master server, and the file type is changelog_ml.*.mfs, so that when something goes wrong with master server, the working data storage server data servers (chunk servers) obeys the scheduling of the management server, provides storage space, and provides data transfer for customers. A server that actually stores user data. When storing a file, first divide the file into blocks, and then replicate the blocks between the data server chunkserver (the number of copies can be specified manually, it is recommended to set the number of copies to 3). There can be multiple data servers, and the greater the number, the greater the "disk space" that can be used and the higher the reliability. Client mount uses the client computers mount process mfs server to share the storage and use. The hard disk shared by the data storage server managed on the management server is mounted through the fuse kernel interface. The usage of a shared file system is similar to nfs. The client that uses the MFS file system to store and access the host is called MFS. After successfully attaching the MFS file system, you can share this virtual storage as before using NFS.

Introduction of experimental environment

Basic environment table

Host operating system IP address main software Master ServerCentos7.3192.168.137.10moosefs.x86_64.0.3.0.101-1Metalogger ServerCentos7.3192.168.137.11moosefs.x86_64.0.3.0.101-1Chunk server1Centos7.3192.168.137.12moosefs.x86_64.0.3.0.101-1Chunk server2Centos7.3192.168.137.13moosefs.x86_64.0.3.0.101-1ClientCentos7.3192.168.137.14moosefs.x86_64.0.3.0.101-1

Topological graph

Operation steps

Building MFS file system by simulating five virtual machines

Turn off the firewall and selinux

Systemctl stop firewalld

Setenforce 0

Set up Master Server

Install softwar

Curl "https://ppa.moosefs.com/RPM-GPG-KEY-MooseFS" > / etc/pki/rpm-gpg/RPM-GPG-KEY-MooseFS / / add key value

Curl "http://ppa.moosefs.com/MooseFS-3-el7.repo" > / etc/yum.repos.d/MooseFS.repo / / add appropriate library entries

Yum install moosefs-master moosefs-cgi moosefs-cgiserv moosefs-cli-y

Profile interpretation

Cd / etc/mfs/

-rw-r--r--. 1 root root 4057 September 27 15:18 mfsexports.cfg / / output directory configuration file

-rw-r--r--. 1 root root 4057 July 20 19:16 mfsexports.cfg.sample

-rw-r--r--. 1 root root 9015 September 27 15:18 mfsmaster.cfg / / Master configuration file

-rw-r--r--. 1 root root 9015 July 20 19:16 mfsmaster.cfg.sample

-rw-r--r--. 1 root root 1052 September 27 15:18 mfstopology.cfg / / metadata log

-rw-r--r--. 1 root root 1052 July 20 19:16 mfstopology.cfg.sample

Start the service

Systemctl start moosefs-master

Systemctl enable moosefs-master

Netstat-ntap | grep mfs

Tcp 0 0 0.0.0 0 9419 0.0.0 0 V * LISTEN 6217/mfsmaster

Tcp 0 0 0.0.0.0 9420 0.0.0. 0 LISTEN 6217/mfsmaster

Tcp 0 0 0.0.0.0 9421 0.0.0. 0 LISTEN 6217/mfsmaster

Set up MetalLogger Server

Installation

Curl "https://ppa.moosefs.com/RPM-GPG-KEY-MooseFS" > / etc/pki/rpm-gpg/RPM-GPG-KEY-MooseFS / / add key value

Curl "http://ppa.moosefs.com/MooseFS-3-el7.repo" > / etc/yum.repos.d/MooseFS.repo / / add appropriate library entries

Yum install moosefs-metalogger-y

Modify the configuration file

Vim / etc/mfs/mfsmetalogger.cfg

MASTER_HOST = 192.168.137.10 / / Line 52, remove the comments and change the address to the primary server.

Start the service

Systemctl start moosefs-metalogger

Systemctl enable moosefs-metalogger

Netstat-ntap | grep mfs

Tcp 0 0 192.168.137.11:36766 192.168.137.10:9419 ESTABLISHED 73521/mfsmetalogger

Set up Chunk Server

The construction steps of the two Chunk Server are exactly the same.

Installation

Curl "https://ppa.moosefs.com/RPM-GPG-KEY-MooseFS" > / etc/pki/rpm-gpg/RPM-GPG-KEY-MooseFS / / add key value

Curl "http://ppa.moosefs.com/MooseFS-3-el7.repo" > / etc/yum.repos.d/MooseFS.repo / / add appropriate library entries

Yum install moosefs-chunkserver-y

Modify the configuration file

Modify one

Vim / etc/mfs/mfschunkserver.cfg

MASTER_HOST = 192.168.137.10 / / Line 77, point the address to the primary server

Revision two

Vim / etc/mfs/mfshdd.cfg

/ gongxiang / / add a shared directory on the last line

Mkdir / gongxiang / / create a shared directory

Chown-R mfs:mfs / gongxiang / / authorizes the shared directory

Start the service

Systemctl start moosefs-chunkserver

Systemctl enable moosefs-chunkserver

Netstat-ntap | grep mfs

Tcp 0 0 0.0.0 0 9422 0.0.0 0 V * LISTEN 71921/mfschunkserve

Tcp 00 192.168.137.13:59006 192.168.137.10:9420 ESTABLISHED 71921/mfschunkserve

Construction of Client

Installation

Curl "https://ppa.moosefs.com/RPM-GPG-KEY-MooseFS" > / etc/pki/rpm-gpg/RPM-GPG-KEY-MooseFS / / add key value

Curl "http://ppa.moosefs.com/MooseFS-3-el7.repo" > / etc/yum.repos.d/MooseFS.repo / / add appropriate library entries

Yum install moosefs-client-y

Load the fuse module into the kernel

Modprobe fuse

Mount a shared directory

Mkdir / opt/mfs / / create mount point

Mfsmount / opt/mfs/-H 192.168.137.10 / / mount, address is master address

Df-h

File system capacity used available used% mount point

/ dev/sda6 21G 4.1G 17G 20% /

Devtmpfs 896M 0 896m 0% / dev

Tmpfs 911M 0911M 0% / dev/shm

Tmpfs 911M 11M 900m 2% / run

Tmpfs 911M 0911M 0% / sys/fs/cgroup

/ dev/sda2 9.8G 33m 9.8G 1% / opt

/ dev/sda3 4.9G 89M 4.8G 2% / home

/ dev/sda1 1014M 165M 850M 17% / boot

Tmpfs 183M 64K 183M 1% / run/user/1000

Tmpfs 183M 0 183M 0% / run/user/0

192.168.137.10 9421 58G 8.1G 50G 14% / opt/mfs

MFS monitoring

Monitoring is enabled on the main server

Mfscgiserv

Lockfile created and locked

Starting simple cgi server (host: any, port: 9425, rootpath: / usr/share/mfscgi)

Access the 192.168.137.10 9425 host address

Fill in the primary server address

Interface

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