References:
Http://www.moosefs.org/tl_files/manpageszip/moosefs-step-by-step-tutorial-cn-v.1.1.pdf
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.
The moosefs has several 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 (only on Server1)
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 the data file
Cd/var/mfs
sudo cp metadata.mfs.empty Metadata.mfs
Install 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
Sudo/etc/init.d/mfsmaster restart
SUDO/ETC/INIT.D/HTTPD restart
Accessing the Web interface
http://server1:9480/mfs/
As shown
3. Install the Configuration Backup server (only on Server2)
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
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 the existence of the file on Server3:
Cd/mnt/mfsmount
Ls
Server2.TXT
Original link: http://heylinux.com/archives/2467.html
Installing the deployment moosefs Distributed File system on CentOS