I. Introduction to MFS file systems
MFS is an open-source storage system in linux and developed by Poles. The MFS file system can realize the RAID function, which not only saves storage costs, but is not inferior to the professional storage system, and can achieve online expansion. MFS is a semi-distributed file system.
The network composition and operating principles of MFS are as follows:
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/024203H09-0.png "border =" 0 "alt =" "/>
MFS consists of three parts: master server, chunk server, and CLIENT. The master server has only one, while the chunk server and CLIENT can have multiple. The mechanism of MFS read and write processes is as follows:
MFS read Process Working Mechanism
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/0242031435-1.png "border =" 0 "alt =" "/>
MFS write Process Working Mechanism
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/0242036022-2.png "border =" 0 "alt =" "/>
Ii. MFS File System Architecture
The MFS file system structure contains four roles:
1. Management SERVER-MASTER SERVER
2. Metalogger
3. Data Storage SERVER-CHUNK SERVER
4. Client
Iii. MFS compilation and installation example
Installation environment: Centos 6.2
System kernel: 2.6.32-71. el6.x86 _ 64
Software Version: mfs-1.6.15.tar.gz
Server allocation:
Role |
IP |
Master server) |
10.10.11.246 |
Master Backup server Metalogger server) |
10.10.11.247 |
Chunk server) |
10.10.11.243 |
Client host Clients) |
10.10.11.244 |
1. Install the master server./configure during configuration. You can cancel chunk server Installation (-- disable-mfschunkserver) and MooseFS client -- disable-mfsmount ). Follow these steps to install the Master node of the Master node:
1. Add MFS groups and users:
- [root@MFS_Master_246 ~]# groupadd mfs
- [root@MFS_Master_246 ~]# useradd -s /sbin/nologin -g mfs -M mfs
2. download the software package and decompress it for installation:
[Root @ MFS_Master_246 dl] # wget http://ncu.dl.sourceforge.net/project/moosefs/moosefs/1.6.15/mfs-1.6.15.tar.gz
[Root @ MFS_Master_246 dl] # tar zxvf mfs-1.6.15.tar.gz
[Root @ MFS_Master_246 dl] # cd mfs-1.6.15
[Root @ MFS_Master_246 mfs-1.6.15] #./configure -- prefix =/usr/local/mfs -- with-default-user = mfs -- with-default-group = mfs
[Root @ MFS_Master_246 mfs-1.6.15] # make
[Root @ MFS_Master_246 mfs-1.6.15] # make install
After the master is successfully installed, the system automatically generates sample configuration files in the/usr/local/mfs/etc directory. the dist suffix is named. Here we will use these sample files as the target configuration file of the MooseFS master server:
[Root @ MFS_Master_246 mfs-1.6.15] # cd/usr/local/mfs/etc/
[Root @ MFS_Master_246 etc] # cp mfsmaster. cfg. dist mfsmaster. cfg
[Root @ MFS_Master_246 etc] # cp mfsmetalogger. cfg. dist mfsmetalogger. cfg
[Root @ MFS_Master_246 etc] # cp mfsexports. cfg. dist mfsexports. cfg
To change the values of certain items in these configuration files, you need to open the comments before the text line of the specific configuration file and modify the values following it. Because the comment-out row is the default value built in MooseFS.
The Mfsmaster. cfg configuration file contains settings related to the master server master. We do not intend to modify these settings.
The mfsexports. cfg configuration file specifies the client hosts that can remotely connect to the MooseFS file system and what access permissions are granted to the mounted client. For example, we specify that only hosts in the 192.168.1.X network segment can access the entire shared structure Resource (/) of MooseFS in read/write mode (/). In the first line of the configuration file mfsexports. cfg, uncomment and change the asterisk (*) to 10.10.11.0/8 so that we can get the following lines of text:
10.10.11.0/8/rw, alldirs, maproot = 0
The binary metadata and text files changelog will be saved in the/usr/local/mfs/var/mfs directory.
Note: After the MooseFS master runs, the metadata. mfs file size will change, and it is definitely not an empty file.
Modify the host name and the/etc/hosts file to bind the host name mfsmaster to the IP address 10.10.11.246:
[Root @ MFS_Master_246 mfs] # hostname mfsmaster # the new host name is displayed only after the host name is changed and the terminal is reconnected.
10.10.11.246 mfsmaster # modify the/etc/hosts file
Start the master service: [root @ mfsmaster ~] #/Usr/local/mfs/sbin/mfsmaster start
In the production environment, we should set an Automatic startup script so that the MooseFS master can run automatically when the operating system restarts. To monitor the current running status of MooseFS, we can run the CGI Monitoring Service, in this way, you can view the running status of the entire MooseFS in a browser:
[Root @ mfsmaster bin] #/usr/local/mfs/sbin/mfscgiserv
Enter http: // 10.10.11.246: 9425 in the browser to view the running status of the master, as shown in:
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/024203OF-3.png "border =" 0 "alt =" "/>
Iv. Backup Server Backup servermetalogger) Installation
The host used to install metalogger should be more powerful than the master (with at least more memory) in terms of performance. Once the master node of the master server fails, you only need to import changelogs to the metadata file, the backup server metalogger will replace the faulty master to manage the server. The installation of the backup server Metalogger is similar to that of the master server master. The installation command is as follows:
[Root @ MFS_Backup_247 bin] # groupadd mfs
[Root @ MFS_Backup_247 bin] # useradd-s/sbin/nologin-g mfs-M mfs
[Root @ MFS_Backup_247 dl] # wget http://ncu.dl.sourceforge.net/project/moosefs/moosefs/1.6.15/mfs-1.6.15.tar.gz
[Root @ MFS_Backup_247 dl] # tar zxvf mfs-1.6.15.tar.gz
[Root @ MFS_Backup_247 mfs-1.6.15] #./configure -- prefix =/usr/local/mfs -- with-default-user = mfs -- with-default-group = mfs
[Root @ MFS_Backup_247 mfs-1.6.15] # make
[Root @ MFS_Backup_247 mfs-1.6.15] # make install
After installation, the configuration file is under the/usr/local/mfs/etc/directory. If the configuration file is mfsmetalogger. cfg
[Root @ MFS_Backup_247 mfs-1.6.15] # cd/usr/local/mfs/etc/
[Root @ MFS_Backup_247 etc] # cp mfsmetalogger. cfg. dist mfsmetalogger. cfg
Add the following lines to modify the/etc/hosts file.
10.10.11.246 mfsmaster
Start the backup service mfsmetaloger:
[Root @ MFS_Backup_247 etc] #/usr/local/mfs/sbin/mfsmetalogger start
5. Chunk servers installation for the storage block Server
Run the following command on each Chunk servers Host:
[Root @ mfs_chunk bin] # groupadd mfs
[Root @ mfs_chunk bin] # useradd-s/sbin/nologin-g mfs-M mfs
[Root @ mfs_chunk bin] # wget http://ncu.dl.sourceforge.net/project/moosefs/moosefs/1.6.15/mfs-1.6.15.tar.gz
[Root @ mfs_chunk bin] # tar zxvf mfs-1.6.15.tar.gz
[Root @ mfs_chunk bin] # cd mfs-1.6.15
[Root @ mfs_chunk mfs-1.6.15] #./configure -- prefix =/usr/local/mfs -- with-default-group = mfs -- disable-mfsmaster
[Root @ mfs_chunk mfs-1.6.15] # make
[Root @ mfs_chunk mfs-1.6.15] # make install
After installation, the configuration file is in the/usr/local/mfs/etc/directory to prepare the configuration file required for the Chunk server Service:
[Root @ mfs_chunk mfs-1.6.15] # cd/usr/local/mfs/etc/
[Root @ mfs_chunk etc] # cp mfschunkserver. cfg. dist mfschunkserver. cfg
[Root @ mfs_chunk etc] # cp mfshdd. cfg. dist mfshdd. cfg
To test the installation, we keep the mfschunkserver. cfg file unchanged,
In the configuration file mfshdd. cfg, we provide the location of the shared space used by the client to mount the root partition of the MooseFS distributed file system. We recommend that you allocate separate space on the Chunk server for MooseFS. The advantage of doing so is to facilitate the management of the remaining space. Here we assume that two contribution points/mnt/mfschunks1 and/mnt/mfschunks2 will be used. add/mnt/mfschunks1 and/mnt/mfschunks2 to cfg.
Create these two Directories Before startup and ensure that the user mfs has the permission to read and write the partitions to be mounted.
[Root @ mfs_chunk etc] # mkdir/mnt/{mfschunks1, mfschunks2}
[Root @ mfs_chunk etc] # chown mfs. mfs/mnt/mfschunks1/
[Root @ mfs_chunk etc] # chown mfs. mfs/mnt/mfschunks2/
Modify the/etc/hosts file and add the following lines,
10.10.11.246 mfsmaster
Start the chunk server:
[Root @ mfs_chunk ~] #/Usr/local/mfs/sbin/mfschunkserver start
Now, you can access: http: // 10.10.11.246: 9425 in a browser to view all the information of this MooseFS system,
Including master and storage server chunkserver
6. Client User 'computers Installation
To mount a distributed file based on MooseFS, the FUSE Software Package FUSE must be installed on the client host with a version number of at least 2.6, and the recommended version number is fuse with a version number greater than 2.7 ). If the system does not install fuse, you must install it manually. Run the following command on the client:
Install FUSE:
[Root @ MFS_Client_244 dl] # wget http://nchc.dl.sourceforge.net/project/fuse/fuse-2.X/2.9.2/fuse-2.9.2.tar.gz
[Root @ MFS_Client_244 dl] # tar zxvf fuse-2.9.2.tar.gz
[Root @ MFS_Client_244 dl] # cdfuse-2.9.2
[Root @ MFS_Client_244 fuse-2.9.2] #./configure
[Root @ MFS_Client_244 fuse-2.9.2] # make
[Root @ MFS_Client_244 fuse-2.9.2] # make install
To install the client software mfsmount:
[Root @ MFS_Client_244 dl] # wget http://ncu.dl.sourceforge.net/project/moosefs/moosefs/1.6.15/mfs-1.6.15.tar.gz
[Root @ MFS_Client_244 dl] # tar zxvf mfs-1.6.15.tar.gz
[Root @ MFS_Client_244 mfs-1.6.15] # groupadd mfs
[Root @ MFS_Client_244 mfs-1.6.15] # useradd-s/sbin/nologin-g mfs-M mfs
[Root @ MFS_Client_244 mfs-1.6.15] #./configure -- prefix =/usr/local/mfs -- with-default-user = mfs -- with-default-group = mfs
[Root @ MFS_Client_244 mfs-1.6.15] # make
[Root @ MFS_Client_244 mfs-1.6.15] # make install
Modify/etc/hosts and add the following lines:
10.10.11.246 mfsmaster
Assuming that the client's mount point is/mnt/mfs, we will use the following commands to use the MooseFS Distributed Shared File System:
1. Create a mount point: [root @ MFS_Client_244 ~] # Mkdir/mnt/mfs
2, start mounting operation: [root @ MFS_Client_244 mfs-1.6.15] #/usr/local/mfs/bin/mfsmount/mnt/mfs/-H mfsmaster
Use df-h | grep mfs to check the partition status.
Note: SELinux and firewall are all disabled in this experiment. References: http://www.moosefs.org/tl_files/manpageszip/moosefs-step-by-step-tutorial-v.1.1.pdf content. For more blog posts, please visit my 51cto blog and personal blog.
This article from the "ordinary days" blog, please be sure to keep this source http://wolfchen.blog.51cto.com/2211749/1125731