In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Moosefs management tips, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
Recently deployed a set of MooseFS system in the real environment, for backup and other purposes, encountered some problems in this process, so find the document to review and understand again, and deepen the understanding of MFS, the following is the little harvest of this learning to share with you.
1. Mount directory management
The Moosefs system supports the client to mount the corresponding subdirectory as needed; if-S is not specified by default, it will be mounted to the root directory (/). When you use used to view the space through df-sh, the current usage of the hard disk of the entire mfs system will be displayed; while mounting the subdirectory will only see the usage of the directory. The specific operations are as follows:
Shell > mfsmount / mnt-H mfsmaster-mount to root directory (/) Shell > mkdir-p / mnt/subdir Shell > umount / mnt Shell > mfsmount / mnt-H mfsmaster-S / subdir-mount to subdirectory (/ subdir)
In the management of Moosefs, you can find a machine as the managed client. In the configuration file mfsexports.cfg, you can limit that only this machine can mount the metadata directory to the root directory. At the same time, you can also restrict that only this machine can mount the client directory (which can be used when erroneous deletion is restored), while other ordinary client clients, according to the needs of different businesses, let the management client create independent-purpose directories for them and mount them to the corresponding subdirectories. In this way, administrative control permissions can be refined. The configuration of Mfsexports.cfg is as follows:
# managing client 192.168.0.2 / rw,alldirs,maproot=0 192.168.0.2. Rw # for db backup sub-folder 192.168.0.20 / backup/db rw.maproot=0 # for image sub-folder 192.168.0.30 / app/image rw.maproot=0
two。 Automatically mount the mfs directory after the client restarts
Shell > vi / etc/rc.local / sbin/modprobe fuse / usr/bin/mfsmount / mnt1-H mfsmaster-S / backup/db / usr/bin/mfsmount / mnt2-H mfsmaster-S / app/image
It is mentioned on the official Moosefs website that versions above 1.6.x can also be automatically mounted to the mfs file system after the system is rebooted by the way of / etc/fstab. After testing, it was not successful because the FUSE module was not loaded into the kernel, so I think the / etc/fstab,FUSE module needs to be compiled into the system kernel in advance. The configuration of fstab is as follows:
Shell > vi / etc/fstab mfsmount / mnt fuse mfsmaster=MASTER_IP,mfsport=9421,_netdev 0 (root directory where MFS is mounted after system restart) mfsmount / mnt fuse mfstermaster=MASTER_IP,mfsport=9421,mfssubfolder=/subdir,_netdev 00 (subdirectory of MFS mounted after system restart)
Using the fstab configuration file mount method, you can test whether the configuration is correct by using the following command:
Shell > mount-a-t fuse
3. Installation of FUSE
The FUSE module is the module that the mfsmount client depends on. The operation we do is first received by the FUSE, then contacted with the mfsmaster through the mfsmount process, and then applied to the chunkserver. FUSE (Filesystem in Userspace), called user-mode file system, provides a framework that allows us to run the file system in user mode, reducing the excessive contact between the development file system and the kernel module. After understanding, we know that the great ZFS is FUSE. In the Moosefs documentation, it is mentioned that the FUSE module will be supported in all versions of the Linux kernel after 2.6.14, that is, there will be a subdirectory of fuse in the system directory / lib/modules/ `uname-r` / kernel/fs/, which will contain a file of fuse.ko. When we compile and install fuse and execute the modprobe fuse command, we can dynamically load the FUSE module into the kernel. Sometimes there is a prompt that the module cannot be found, that is, there is no fuse subdirectory in the / lib/modules/ `uname-r` / kernel/fs/ directory, and the ko file is missing. I encountered it during installation. The kernel is 2.6.18-92.el5 and there is no fusesubdirectory. At that time, the use of fuse-2.8.5, the default compilation installation did not generate this file; later, Mr. Han helped me find a problem, he used the 2.7.4 version of the default compilation and installation (without adding any configure options), modprobe can successfully load the fuse module, then the fuse subdirectory was also created, it was seen on the Internet that the need to add this compilation item-enable-kernel-module.
4. Moosefs can save space
Accidentally found that the file size copied to the mfs directory is much smaller than that under ext3, and at first I thought it was less synchronized some files, so I copied all the files under mfs back to ext3, and found that the size was the same as before, so I vaguely felt that mfs could save space. After testing, I found that mfs can save half of the storage space of small files (I use about 8K), and then I copied a 1.7g file to mfs with a size of 1.6g.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.