In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
MFS principle
MFS is a fault-tolerant network distributed file system, which stores data on multiple physical servers and presents a unified resource to users.
Introduction to the composition of MFS file system
Role
Action
Metadata Server (Master)
A separate host that manages the entire file system stores metadata for each file (file size, attributes, location information, including all information about all unconventional files, such as directories, sockets, pipes, and device files).
Metadata Log Server (Metalogger)
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.
Data Storage Server (chunk servers)
Any number of commercial servers that store file data and synchronize with each other (if a file has more than one backup).
Client (Client)
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.
MFS file system composition diagram
MFS read data processing process:
Client sends a read request to Master
Master informs Client of the required data storage location (Chunk IP&Chunk No.)
Client sends a data request to Chunk
Chunk sends data to Client
MFS write data processing:
Client sends a write request to Master
Master interacts with Chunk, but Master only creates new chunked Chunks on some servers. After successful creation, Chunk informs Master that the creation is successful.
Master tells Client on which Chunk and which Chunks to write data
Client writes data to the specified Chunk
Chunk synchronizes data with other Chunk. After successful synchronization, Chunk informs Client that the data is written successfully.
Client informs Master that this write is complete.
Introduction to the experimental environment:
192.168.218.156
Mainframe
IP address
Master Server192.168.218.130MetaLogger Server192.168.218.157Chunk1 Server
Server192.168.218.145Client Server192.168.218.139
The steps of the experiment:
Install master server:
Yum install gcc gcc-c++ zlib-devel-y
Useradd-s / sbin/nologin mfs
Tar zxvf mfs-1.6.27-5.tar.gz-C / opt
Cd / opt/mfs-1.6.27/
. / configure\
-- prefix=/usr/local/mfs\
-- with-default-user=mfs\
-- with-default-group=mfs\
-- disable-mfschunkserver\ # disable Chunk function
-- disable-mfsmount # disable Client function
Make & & make install
Cd / usr/local/mfs/etc/mfs/
Cp mfsexports.cfg.dist mfsexports.cfg # makes the mount permissions profile effective
Cp mfsmaster.cfg.dist mfsmaster.cfg # gives effect to the master main configuration file
Cp mfstopology.cfg.dist mfstopology.cfg # makes the topology architecture aware profile effective
Cd / usr/local/mfs/var/mfs/
Cp metadata.mfs.empty metadata.mfs # makes the anti-chain file effective
/ usr/local/mfs/sbin/mfsmaster start
Systemctl stop firewalld.service
Setenforce 0
Netstat-ntap | grep mfs
# / usr/local/mfs/sbin/mfsmaster-s # stop service
Set up MetaLogger server:
Yum install gcc gcc-c++ zlib-devel-y
Useradd-s / sbin/nologin mfs
Tar zxvf mfs-1.6.27-5.tar.gz-C / opt
Cd / opt/mfs-1.6.27/
. / configure\
-- prefix=/usr/local/mfs\
-- with-default-user=mfs\
-- with-default-group=mfs\
-- disable-mfschunkserver\
-- disable-mfsmount
Make & & make install
Cd / usr/local/mfs/etc/mfs/
Cp mfsmetalogger.cfg.dist mfsmetalogger.cfg # makes the log profile effective
Vim mfsmetalogger.cfg
MASTER_HOST = 192.168.218.130 # specify Master server address
Cd / usr/local/mfs/var/mfs/
Cp metadata.mfs.empty metadata.mfs # makes the anti-chain file effective
/ usr/local/mfs/sbin/mfsmaster start
Systemctl stop firewalld.service
Setenforce 0
Set up two Chunk servers:
Yum install gcc gcc-c++ zlib-devel-y
Useradd-s / sbin/nologin mfs
Tar zxvf mfs-1.6.27-5.tar.gz-C / opt
Cd / opt/mfs-1.6.27/
. / configure\
-- prefix=/usr/local/mfs\
-- with-default-user=mfs\
-- with-default-group=mfs\
-- disable-mfsmaster\
-- disable-mfsmount
Make & & make install
Cd / usr/local/mfs/etc/mfs/
Cp mfschunkserver.cfg.dist mfschunkserver.cfg # makes the chunk configuration file effective
Cp mfshdd.cfg.dist mfshdd.cfg # gives effect to the hard disk storage space configuration file
Vim mfschunkserver.cfg
MASTER_HOST = 192.168.218.130
Vim mfshdd.cfg
/ data
Mkdir / data
Chown-R mfs.mfs / data/
/ usr/local/mfs/sbin/mfschunkserver start # start the service
Systemctl stop firewalld.service
Setenforce 0
Netstat-ntap | grep mfs
Client configuration
Systemctl stop firewalld.service
Setenforce 0
Yum install gcc gcc-c++ zlib-devel-y
Tar zxvf fuse-2.9.2.tar.gz-C / opt # kernel load package
Cd / opt/fuse-2.9.2/
. / configure
Make & & make install
Vim / etc/profile
Export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
Source / etc/profile
Install the mfs client
Useradd-s / sbin/nologin mfs
Tar zxvf mfs-1.6.27-5.tar.gz-C / opt
Cd / opt/mfs-1.6.27/
. / configure\
-- prefix=/usr/local/mfs\
-- with-default-user=mfs\
-- with-default-group=mfs\
-- disable-mfsmaster\
-- disable-mfschunkserver\
-- enable-mfsmount
Make & & make install
Mkdir / opt/mfs
Modprobe fuse # load fuse module into kernel
/ usr/local/mfs/bin/mfsmount / opt/mfs-H 192.168.218.130 # Mount the MFS service
Optimize customer service
Vim / etc/profile
Export PATH=/usr/local/mfs/bin:$PATH
Source / etc/profile
Echo 'this is testings' > / opt/mfs/abc.txt
Mfssetgoal-r 2 / opt/mfs # sets the number of copies of the file to be copied, and-r indicates recursion
/ opt/mfs:
Inodes with goal changed: 2
Inodes with goal not changed: 0
Inodes with permission denied: 0
Mfsgetgoal-r / opt/mfs # View the number of copies of files copied
/ opt/mfs/abc.txt: 2
Mfsfileinfo / opt/mfs/abc.txt # View the actual number of copies and their nodes
/ opt/mfs/abc.txt:
Chunk 0: 000000000000011400000001 / (id:1 ver:1)
Copy 1: 192.168.218.145:9422
Copy 2: 192.168.218.156:9422
MASTER-Server- starts the monitoring program
[root@master mfs] # / usr/local/mfs/sbin/mfscgiserv
Lockfile created and locked
Starting simple cgi server (host: any, port: 9425, rootpath: / usr/local/mfs/share/mfscgi)
Visit: http://192.168.218.130:9425 to view the MFS monitoring web 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.
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.