Summary of Ceph practice: CephFS client configuration, cephcephfs

Source: Internet
Author: User

Summary of Ceph practice: CephFS client configuration, cephcephfs
Because CephFS is not very stable at present, it may be used in more experiments.

Before proceeding to this chapter, you need to complete the basic cluster building, please refer to the http://blog.csdn.net/eric_sunah/article/details/40862215

You can attach a file system to a VM or on an independent physical machine. do not perform the following operations on the machine in the ceph cluster.

Prepare for renewal ¶
  1. Use OS Recommendations to determine whether your client OS meets the basic requirements.

  2. Use on Management Nodesceph-deployInceph-clientIf ceph is installed on the node, it is called cephclient.

    ceph-deploy install cephclient
  3. Use on Management Nodesceph-deployCopy the ceph configuration file andceph.client.admin.keyringToOn cephclient

    ceph-deploy admin cephclient

    ceph-deployWill copy the keyring file/Etc/ceph directory. To ensure security, you can set the appropriate permissions for the file (e.g .,sudo chmod +r /etc/ceph/ceph.client.admin.keyring).

  4. Ensure that the Ceph storage cluster is in good running status, and pg is in active + clean status. Make sure that at least one mds service is running.

Create a File System

For a newly created MDS service, although the service is running, its status will not change to Active until the pools and file system are created.

Status at creation time

 
Ceph cluster status
 
Create a Filesystem using the following operations
ceph osd pool create cephfs_data 10ceph osd pool create cephfs_metadata 10ceph fs new leadorfs  cephfs_metadata cephfs_data

After successful creation, the state of the mds stat is as follows:
 
The ceph cluster status, pg quantity, and pool quantity are increased accordingly.
 
Create a Secret file 

By default, a Ceph cluster requires permission verification. To create a key file containing individual users, perform the following steps:

  1. Find the key:

    cat ceph.client.admin.keyring
  2. Copy the user's key used to mount the file system:

    [client.admin]   key = AQCj2YpRiAe6CxAA7/ETt7Hcl9IyxyYciVs47w==.
  3. Create an empty file and copy the key content:

    AQCj2YpRiAe6CxAA7/ETt7Hcl9IyxyYciVs47w==
  4. Use the user's name to save the file (e.g .,Admin. secret).

  5. Set file permissions.

Mount a volume in the form of a Kernel Driver ¶

Mount the file by using the following methods.

sudo mkdir /mnt/mycephfssudo mount -t ceph 192.168.40.107:6789:/ /mnt/mycephfs

Because the ceph cluster performs permission verification by default, you may need to specify the user name and secrte file name when performing this operation:

sudo mount -t ceph 192.168.40.107:6789:/ /mnt/mycephfs -o name=admin,secretfile=admin.secret
Mount a volume in the form of User Space (FUSE ¶Install ceph-fuse yum install-y ceph-fuse
sudo mkdir ~/mycephfssudo ceph-fuse -m 192.168.40.107:6789 ~/mycephfs

Call method of the specified key file

sudo ceph-fuse -k ./ceph.client.admin.keyring -m 192.168.40.107:6789 ~/mycephfs
View the result after mounting. Observe the type
 
Unmount

To unmount a disk, follow these steps:

sudo umount /mnt/mycephfs


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.