Method One
Overview:
Moosefs is a distributed file system, Moosefs file system architecture includes the following four roles:
1 Management Server managing Server (Master)
2 Meta data log server Metalogger servers (metalogger)
3 Data Storage server servers (chunkservers)
4 Client Mount using computers
Various role roles:
1 Management Server: Responsible for the management of each data storage server, file read and write scheduling, file space recovery and recovery. Multi-node copy
2 Meta Data Log server: is responsible for backing up the master server's change log file with a Changelog_ml.*.mfs file type so that it can be replaced when the master server has a problem
3 Data Storage Server: Responsible for connecting the Management Server, follow the Management Server scheduling, provide storage space, and provide customers with data transmission.
4 Client: The data storage server managed on the remote Management Server is hooked up through the fuse kernel interface. It looks like the shared file system works the same as the local UNIX file system.
Installation Environment
Master Server
Master 10.0.0.141 Centos5.5 (64X)
Metalogger Server
Metalogger 10.0.0.142 Centos5.5 (64X)
Chunk Servers
Chunk01 10.0.0.143 Centos5.5 (64X)
Chunk02 10.0.0.144 Centos5.5 (64X)
Client Server
client01 10.0.0.150 Centos5.5 (64X)
client02 10.0.0.155 Centos5.5 (64X)
—————————————————-
master installation (10.0.0.141)
Mkdir-p/root/tools/moosefs/
cd/root/tools/moosefs/
/USR/SBIN/GROUPADD-G 660 MFS
/usr/sbin/useradd-g MFS mfs-u 660-s/sbin/nologin
wget http://www.moosefs.org/tl_files/mfscode/mfs-1.6.20-2.tar.gz
Tar zxvf mfs-1.6.20-2.tar.gz
CD mfs-1.6.20-2
./configure
–prefix=/elain/apps/mfs
–sysconfdir=/elain/apps/mfs/etc
–localstatedir=/elain/apps/mfs/lib
–with-default-user=mfs
–with-default-group=mfs
–disable-mfschunkserver
–disable-mfsmount
Make && make install
Cd..
cd/elain/apps/mfs/etc/
CP Mfsmaster.cfg.dist Mfsmaster.cfg
CP Mfsmetalogger.cfg.dist Mfsmetalogger.cfg
CP Mfsexports.cfg.dist Mfsexports.cfg
VI mfsexports.cfg
10.0.0.0/24/rw,alldirs,maproot=0
Cd/elain/apps/mfs/lib/mfs
CP Metadata.mfs.empty Metadata.mfs
Vi/etc/hosts
10.0.0.141 Mfsmaster
Running the MFS service
/elain/apps/mfs/sbin/mfsmaster start
Master Metaloggers Module:listen on *:9419
Master Chunkservers Module:listen on *:9420
Main master server Module:listen on *:9421
Running the Monitoring platform
/elain/apps/mfs/sbin/mfscgiserv
Starting simple CGI server (Host:any, port:9425, RootPath:/elain/apps/mfs/share/mfscgi)
In this case, you can access through the browser: http://10.0.0.141:9425/to see how master is running
—————————————————–
Metalogger installation (10.0.0.142)
cd/root/tools/
/USR/SBIN/GROUPADD-G 660 MFS
/usr/sbin/useradd-g MFS mfs-u 660-s/sbin/nologin
wget http://www.moosefs.org/tl_files/mfscode/mfs-1.6.20-2.tar.gz
Tar zxvf mfs-1.6.20-2.tar.gz
CD mfs-1.6.20-2
./configure
–prefix=/elain/apps/mfs
–sysconfdir=/elain/apps/mfs/etc
–localstatedir=/elain/apps/mfs/lib
–with-default-user=mfs
–with-default-group=mfs
–disable-mfschunkserver
–disable-mfsmount
Make && make install
Cd..
cd/elain/apps/mfs/etc/
CP Mfsmetalogger.cfg.dist Mfsmetalogger.cfg
Vi/etc/hosts
10.0.0.141 Mfsmaster
/elain/apps/mfs/sbin/mfsmetalogger start
—————————————————-
CHUNK01 installation (10.0.0.143)
cd/root/tools/
/USR/SBIN/GROUPADD-G 660 MFS
/usr/sbin/useradd-g MFS mfs-u 660-s/sbin/nologin
wget http://www.moosefs.org/tl_files/mfscode/mfs-1.6.20-2.tar.gz
Tar zxvf mfs-1.6.20-2.tar.gz
CD mfs-1.6.20-2
./configure
–prefix=/elain/apps/mfs
–sysconfdir=/elain/apps/mfs/etc
–localstatedir=/elain/apps/mfs/lib
–with-default-user=mfs
–with-default-group=mfs
–disable-mfsmaster
Make && make install
Cd..
cd/elain/apps/mfs/etc/
CP Mfschunkserver.cfg.dist Mfschunkserver.cfg
CP Mfshdd.cfg.dist Mfshdd.cfg
Vi/etc/hosts
10.0.0.141 Mfsmaster
mkdir/data/mfschunks{1,2}
Chown-r mfs:mfs/data/mfschunks{1,2}
Vi/elain/apps/mfs/etc/mfshdd.cfg
/data/mfschunks1
/data/mfschunks2
/elain/apps/mfs/sbin/mfschunkserver start
————————————————-
CHUNK02 installation (10.0.0.144)
cd/root/tools/
/USR/SBIN/GROUPADD-G 660 MFS
/usr/sbin/useradd-g MFS mfs-u 660-s/sbin/nologin
wget http://www.moosefs.org/tl_files/mfscode/mfs-1.6.20-2.tar.gz
Tar zxvf mfs-1.6.20-2.tar.gz
CD mfs-1.6.20-2
./configure
–prefix=/elain/apps/mfs
–sysconfdir=/elain/apps/mfs/etc
–localstatedir=/elain/apps/mfs/lib
–with-default-user=mfs
–with-default-group=mfs
–disable-mfsmaster
Make && make install
Cd..
cd/elain/apps/mfs/etc/
CP Mfschunkserver.cfg.dist Mfschunkserver.cfg
CP Mfshdd.cfg.dist Mfshdd.cfg
Vi/etc/hosts
10.0.0.141 Mfsmaster
mkdir/data/mfschunks{1,2}
Chown-r mfs:mfs/data/mfschunks{1,2}
Vi/elain/apps/mfs/etc/mfshdd.cfg
/data/mfschunks1
/data/mfschunks2
/elain/apps/mfs/sbin/mfschunkserver start
———————————————————
Client01 Server Installation (10.0.0.150)
cd/root/tools/
/USR/SBIN/GROUPADD-G 660 MFS
/usr/sbin/useradd-g MFS mfs-u 660-s/sbin/nologin
wget http://cdnetworks-kr-2.dl.sourceforge.net/project/fuse/fuse-2.X/2.8.5/fuse-2.8.5.tar.gz
TAR-ZXVF fuse-2.8.5.tar.gz
CD fuse-2.8.5
./configure
Make
Make install
Cd..
Run the following export command, otherwise the MOOSEFS system will fail to mount
Vi/etc/profile
Export Pkg_config_path=/usr/local/lib/pkgconfig: $PKG _config_path
Source/etc/profile
cd/root/tools/moosefs/
wget http://www.moosefs.org/tl_files/mfscode/mfs-1.6.20-2.tar.gz
TAR-ZXVF mfs-1.6.20-2.tar.gz
CD mfs-1.6.20-2
./configure
–prefix=/elain/apps/mfs
–sysconfdir=/elain/apps/mfs/etc
–localstatedir=/www/lib
–with-default-user=mfs
–with-default-group=mfs
–enable-mfsmount
Make && make install
Cd..
Vi/etc/hosts
10.0.0.141 Mfsmaster
Hook operation
Mkdir-p/elain/data/htdocs/elain/upload
/elain/apps/mfs/bin/mfsmount/elain/data/htdocs/elain/upload/-H Mfsmaster
Umount-l/elain/data/htdocs/elain/upload
——————————————————-
Client02 Server Installation (10.0.0.155)
cd/root/tools/
/USR/SBIN/GROUPADD-G 660 MFS
/usr/sbin/useradd-g MFS mfs-u 660-s/sbin/nologin
wget http://cdnetworks-kr-2.dl.sourceforge.net/project/fuse/fuse-2.X/2.8.5/fuse-2.8.5.tar.gz
Tar zxvf fuse-2.8.5.tar.gz
CD fuse-2.8.5
./configure
Make
Make install
Cd..
Run the following export command, otherwise the MOOSEFS system will fail to mount
Vi/etc/profile
Export Pkg_config_path=/usr/local/lib/pkgconfig: $PKG _config_path
Source/etc/profile
#加载fuse
Modprobe Fuse
[Root@web1 ~#]lsmod |grep fuse
fuse 83057 8
wget http://www.moosefs.org/tl_files/mfscode/mfs-1.6.20-2.tar.gz
TAR-ZXVF mfs-1.6.20-2.tar.gz
CD mfs-1.6.20-2
./configure
–prefix=/elain/apps/mfs
–sysconfdir=/elain/apps/mfs/etc
–localstatedir=/elain/apps/mfs/lib
–with-default-user=mfs
–with-default-group=mfs
–enable-mfsmount
Make && make install
Cd..
Vi/etc/hosts
10.0.0.141 Mfsmaster
Hook operation
Mkdir-p/mnt/mfs
/elain/apps/mfs/bin/mfsmount/mnt/mfs-h Mfsmaster
Installation completed.
Stop Moosefs
To safely stop the moosefs cluster, it is recommended that you perform the following steps:
Umount-l/mnt/mfs #客户端卸载MooseFS File system
/elain/apps/mfs/sbin/mfschunkserver Stop #停止 Chunk server process
/elain/apps/mfs/sbin/mfsmetalogger Stop #停止 Metalogger process
/elain/apps/mfs/sbin/mfsmaster Stop #停止主控 master server process
Secure Boot moosefs Cluster
/elain/apps/mfs/sbin/mfsmaster Start #启动 Master process
/elain/apps/mfs/sbin/mfschunkserver start #启动 chunkserver process
/elain/apps/mfs/sbin/mfsmetalogger start #启动 Metalogger process
/elain/apps/mfs/bin/mfsmount/mnt/mfs-h Master #客户端挂载 moosefs File system
How to use the moosefs command and reference documentation:
Http://www.moosefs.org/reference-guide.html#using-moosefs
Http://www.moosefs.org/moosefs-faq.html
FAQ:
/elain/apps/mfs/bin/mfsmount/elain/data/htdocs/elain/upload-h Master
Mfsmaster accepted connection with PARAMETERS:READ-WRITE,RESTRICTED_IP; Root mapped to Root:root
Fuse:device not found, try ' modprobe fuse '
Error in Fuse_mount
Answer: Modprobe fuse
[root@client01 ~]# lsmod |grep Fuse
Fuse 83057 6
Method Two
Environment Introduction:
Os:centos 6.3 x86_64
Server1-mfsmaster & Mfschunkserver
Server2-mfsmetalogger & Mfschunkserver & Mfsclient
Server3-mfschunkserver
1. What is Moosefs
Moosefs is a fault tolerant Distributed file system that supports mounting (via fuse) and the same operations as the local file system.
Moosefs has the following roles:
Primary server: Managing Server (master server)
Data node: Database server (chunk servers)
Backup server: Metadata backup servers (metalogger servers)
Clients: Client computers that access (mount) the files in Moosefs
2. Install the configuration Master server (on Server1 only)
sudo rpm--import http://apt.sw.be/RPM-GPG-KEY.dag.txt
sudo rpm-ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
sudo yum install MFS
Cd/etc/mfs
sudo cp mfsmaster.cfg.dist mfsmaster.cfg
sudo cp mfsmetalogger.cfg.dist mfsmetalogger.cfg
sudo cp mfsexports.cfg.dist mfsexports.cfg
Modify the address of the primary server, such as 10.197.29.251
sudo vim/etc/mfsmetalogger.cfg
1 master_host = 10.197.29.251
Initializing data files
Cd/var/mfs
sudo cp metadata.mfs.empty Metadata.mfs
Installing Web interface Support
sudo yum install mfs-cgi httpd
sudo vim/var/www/html/mfs/index.html
1 document.location.href= "/cgi-bin/mfs/mfs.cgi"
sudo vim/etc/httpd/conf/httpd.conf
1 Listen 9480
Sudo/etc/init.d/mfsmaster restart
SUDO/ETC/INIT.D/HTTPD restart
Accessing the Web interface
http://server1:9480/mfs/
As shown in the following figure
3. Install configuration Backup server (on Server2 only)
sudo rpm--import http://apt.sw.be/RPM-GPG-KEY.dag.txt
sudo rpm-ivh http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
sudo yum install MFS
Cd/etc/mfs
sudo cp mfsmetalogger.cfg.dist mfsmetalogger.cfg
sudo vim/etc/mfsmetalogger.cfg
1 master_host = 10.197.29.251
Sudo/etc/init.d/mfsmetalogger restart
4. Install the Configuration Data node (on server1-3)
sudo rpm--import http://apt.sw.be/RPM-GPG-KEY.dag.txt
sudo rpm-ivh http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
sudo yum install MFS
Cd/etc/mfs
sudo cp mfschunkserver.cfg.dist mfschunkserver.cfg
sudo cp mfshdd.cfg.dist mfshdd.cfg
sudo vim mfschunkserver.cfg
1 master_host = 10.197.29.251
sudo vim mfshdd.cfg
1/mnt/mfschunks1
2/mnt/mfschunks2
sudo mkdir/mnt/mfschunks1/mnt/mfschunks2
sudo chown-r daemon:daemon/mnt/mfschunks*
Sudo/etc/init.d/mfschunkserver restart
Visit the Web interface to check for new Chunkserver
Http://server1:9480/cgi-bin/mfs/mfs.cgi?sections=CS
5. Install the configuration client (on server2-3)
sudo rpm--import http://apt.sw.be/RPM-GPG-KEY.dag.txt
sudo rpm-ivh http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
sudo yum install mfs-client
sudo mkdir-p/mnt/mfsmount
sudo chown-r daemon:daemon/mnt/mfsmount
sudo mfsmount/mnt/mfsmount-h 10.197.29.251
1 Mfsmaster accepted connection with PARAMETERS:READ-WRITE,RESTRICTED_IP; Root mapped to Root:root
df-h | grep MFS
1 10.197.29.251:9421 25G 0 25G 0%/mnt/mfs
6. Test Moosefs
To create a file on Server2 server2.txt:
Cd/mnt/mfsmount
echo "I am from Server2" > Server2.TXT
Check to see if the file exists on the Server3:
Cd/mnt/mfsmount
Ls
1 Server2.TXT