In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article focuses on "how to build a cephfs file system environment". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to build a cephfs file system environment".
Introduction to building cephfs file system environment
1. Brief introduction of cephfs.
Cephfs is a file system based on ceph cluster and compatible with POSIX standards. When creating a cephfs file system, you need to add a mds service to the ceph cluster, which is responsible for handling the metadata part of the POSIX file system, and the actual data part is handled by the OSDs in the ceph cluster. Cephfs supports both kernel module loading and fuse loading. Both kernel mode and fuse mode realize the loading of cephfs file system by calling libcephfs library, while libcephfs library calls librados library to communicate with ceph cluster, thus realizing the loading of cephfs. The overall frame diagram of cephfs is shown in the following figure.
Second, the process of building cephfs.
The process of building cephfs in the official ceph documentation is very simple and only introduces how to build mds through ceph-deploy. For cases where the ceph-deploy method is not used for ceph cluster deployment, follow the following method for manual configuration.
1. Create a mds working directory.
# mkdir-p / var/lib/ceph/mds/mds.0
2. Modify the configuration file / etc/ceph/ceph.conf file of the ceph cluster and add the relevant contents of mds to this file. The specific additions are as follows:
[mds]
Mds data = / var/lib/ceph/mds/mds.$id
Keyring = / etc/ceph/ceph.mds.$id.keyring
[mds.0]
Host = {hostname}
3. Create mds users to access key and access rights.
# ceph auth get-or-create mds.0 mds' allow' osd 'allow *' mon 'allow rwx' > / etc/ceph/ceph.mds.0.keyring
4. Start the mds service using the ceph startup script.
# / etc/init.d/ceph start mds.0
5. View mdsmap information in ceph cluster.
# ceph-s
Cluster e4251f73-2fe9-4dfc-947f-962843dc6ad9
Health HEALTH_OK
Monmap e1: 1 mons at {axie 192.168.250.58 quorum 6789Unip 0}, election epoch 1, quorum 0a
Mdsmap e22: 1-1-1 up {0=0=up:active}
Osdmap e99: 3 osds: 3 up, 3 in
Pgmap v87493: 2760 pgs, 21 pools, 24935 MB data, 6292 objects
77977 MB used, 1596 GB / 1672 GB avail
2760 active+clean
When you see the above mdsmap line, it means that the mds service is enabled in the current cluster, and once the cephfs feature is available.
Third, load / unload cephfs process.
What I do here is relatively simple, which is the cephfs load operation done on the machine of the ceph cluster. If you load on other clients, you need to copy the ceph cluster configuration file ceph.conf and the user keyring that accesses cephfs to the corresponding client. For kernel loading, you need the kernel module to support cephfs, and for fuse loading, you need to manually install the ceph-fuse package.
1. Load cephfs through kernel module.
# mkdir-p / mnt/mycephfs
# mount-t ceph 127.0.0.1 mnt/mycephfs 6789 mnt/mycephfs
You can then see that cephfs has been successfully mounted to the / mnt/mycephfs directory through the mount command. You can then manipulate the / mnt/mycephfs directory in the same way as you would with the local file system.
2. Uninstall cephfs by kernel module.
# umount / mnt/mycephfs
3. Load cephfs by fuse.
# ceph-fuse-m 127.0.0.1 6789 / mnt/mycephfs
You can then see that cephfs has been successfully mounted to the / mnt/mycephfs directory through the mount command. You can then manipulate the / mnt/mycephfs directory in the same way as you would with the local file system.
4. Uninstall cephfs by fuse.
# fusermount-u / mnt/mycephfs
At this point, I believe that everyone on the "cephfs file system environment building method" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.