Difference between revisions of "MooseFS"
From Notes_Wiki
m |
m |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Filesystem or partition tools]] > [[MooseFS]] | |||
'''There are updated articles on this at [[CentOS 8.x Moosefs 3.x]]''' | |||
==Installing mooseFS== | ==Installing mooseFS== | ||
Line 106: | Line 107: | ||
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Filesystem or partition tools]] > [[MooseFS]] |
Latest revision as of 13:43, 24 August 2022
Home > CentOS > CentOS 6.x > Filesystem or partition tools > MooseFS
There are updated articles on this at CentOS 8.x Moosefs 3.x
Installing mooseFS
Installing using yum
- yum install mfs mfs-cgi mfs-client
- groupadd mfs
- useradd -g mfs mfs
Installing from source
- Download latest source code from http://www.moosefs.org/download.html The website also contains tutorials on how to install and use mooseFS
- groupadd mfs
- useradd -g mfs mfs
- tar -xzf mfs-*.tar.gz
- cd mfs-*
- ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --with-default-user=mfs --with-default-group=mfs
- We can disable chunkserver using --disable-mfschunkserver option with configure. We can disable mfsmount with --disable-mfsmount option. These options can be useful for creating dedicated master server which will not act as chunk server.
- We can optionally disable master server installation on chunkserver using --disable-mfsmaster option
- make
- make install
Configuring moooseFS
- Go to /etc/ or /etc/mfs based on where installation is done by source or by yum
- cp mfsmaster.cfg.dist mfsmaster.cfg
- This file is used to configure mfs master server. Refer to man mfsmaster.cfg for information about parameters configured in this file.
- cp mfsexports.cfg.dist mfsexports.cfg
- This file is used to access control which clients can connect to mfs server. Refer to man mfsexports.cfg for more information on syntax and options available in this file.
- Add password=<secret> in mfsexports.cfg file for both / and . Do not leave space between various options they should be separated just by comma (,).
- cp mfsmetalogger.cfg.dist mfsmetalogger.cfg
- This needs to be done only on mfs metalogger server. mfs metalogger server is backup server for mfs master server and takes over mfs operations in case mfs master server fails. Hence there is not point in creating metalogger server on same machine as mfs master server.
- cd /var/mfs; mv metadata.mfs.empty metadata.mfs
- Edit /etc/hosts so that name mfsmaster points to mfsmasters' ethernet IP address.
- service mfsmaster start; chkconfig mfsmaster on
- This only needs to be done on mfsmaster server.
- Use command mfscgiserv to start mfs CGI server. Then open http://<IP_address>:9425/ in browser
- server mfsmetalogger start; chkconfig metalogger on
- This needs to be done only on mfs metalogger server.
- cp mfschunkserver.cfg.dist mfschunkserver.cfg; cp mfshdd.cfg.dist mfshdd.cfg
- No need to do this on dedicated masters if they are not going to be used as chunkservers. More information on mfschunkserver.cfg is available in 'man mfschunkserver.cfg' file.
- Edit file 'mfshdd.cfg' and enter mount points where data for mfs filesystem can be stored. For example if we have two dedicated physical partitions /dev/sda2, /dev/sda3 that we have created for mooseFS and we have mounted them on /mnt/data1 and /mnt/data2. Then specify /mnt/data1 and /mnt/data2 (one on each line) in 'mfshdd.cfg' file.
- Do this only on chunkservers. It is recommended that dedicated partitions are used for mooseFS so that free space calculations can be done properly.
- Use 'chown -R mfs:mfs <mount_point> on all mount points so that user mfs has write access to them. This needs to be done only on chunkservers.
- Use 'service mfschunkserver start; chkconfig mfschunkserver on' on chunkserver.
- Configure all mfschunkserver using steps mentioned above. Do not follow steps that are meant for mfsmaster or mfs metalogger server on dedicated chunk servers. It is very important that /etc/hosts is used to point to proper mfsmaster servers' IP address.
Mounting mooseFS filesystem
- Ensure that /etc/hosts points to correct mfsmaster server.
- Create directory /mnt/mfs where we can mount mfs partition.
- Use command mfsmount /mnt/mfs -H mfsmaster -p to mount mfs partition on /mnt/mfs folder.
- Refer to 'man mfsmount' for more information on mfsmount command. For example we can use -S to mount a subfolder of mfs server rather than mounting entire mfs filesystem.
Controlling replication
By defaults only one copy of each file / folder is stored. To increase replication we can use commands 'mfssetgoal' and 'mfsgetgoal' For example if we want three copies of folder '</mnt/mfs/x86_64' along with three copies of all sub-folders and files then we can use:
mfssetgoal -r 3 /mnt/mfs/x86_64
We can check the current goal / replication value using
mfsgetgoal /mnt/mfs/x86_64
Stopping mooseFS
In order to safely stop the MooseFS cluster you have to do the following steps:
- Unmount the file system on all machines using umount command (in our examples it would be: umount /mnt/mfs)
- Stop the chunk server processes - 'service mfschunkserver stop'
- Stop the metalogger process - 'service mfsmetalogger stop'
- Stop the master server process - 'service mfsmaster stop'
Recovering files
- To recover files special file system mfsmeta needs to be mounted on some directory. Use command 'mfsmount -o mfsmeta' with other arguments same as normal mounting to mount mfsmeta system.
- Directory named trash has all deleted files. If we move any file from trash to folder named 'undel' inside trash then file is restored provided no other file with same name exists on existing moosefs filesystem.
Miscellaneous
Firewall consideration
- Firewall was disabled on machines when above steps were used. With iptables enable incoming connectoins port 9422 on all chunkserver. Enable incoming connections to ports 9419-9421 on master server and meta logger server.
- Port 9425 needs to be allowed on master server for HTTP access for monitoring interface
Removing disks
- We can mark partitions or disks for removal by preceding there names with asterisk('*') and then restarting chunkserver. We can use HTTP CGI interface to ensure that all chunks from those disks have been removed and then safely remove those disks.
Home > CentOS > CentOS 6.x > Filesystem or partition tools > MooseFS