3. The configuration of ceph-deploy uses the file system

We perform the following operations on the admin node to configure the file system using the ceph cluster

Prerequisites

1. Install ceph on the ceph-client node
  1. ceph-deploy install ceph-client
2. Confirm that the ceph cluster is in the active+clean state, and confirm that at least one metadata server is running
  1. ceph -s [-m {monitor-ip-address}] [-k {path/to/ceph.client.admin.keyring}]
  2. #配置好ceph.conf 和 keyring文件之后,直接ceph -s即可

Create a file system

The MDS you have created is not active unless you have created some pools and filesystems
  1. ceph osd pool create cephfs_data <pg_num>
  2. ceph osd pool create cephfs_metadata <pg_num>
  3. ceph fs new <fs_new> cephfs_metadata cephfs_data

Create secret file

The ceph cluster has authentication enabled by default, and you should have a file (not keyring) that holds the key.
Perform the following steps to obtain the secret key of the specified user
1. Identify the user's key in the keyring file
  1. cat ceph.client.admin.keyring
2. Copy the key of the user used to mount the ceph file system, for example:
  1. [client.admin]
  2. key = AQCj2YpRiAe6CxAA7/ETt7Hcl9IyxyYciVs47w==
3. Create a file and write the key to it
  1. AQCj2YpRiAe6CxAA7/ETt7Hcl9IyxyYciVs47w==
4. Save the file name as username (for example: admin.secret)
5. Make sure the user has permissions and is not visible to other users

Use: kernel driver

Mount ceph FS as a kernel driver
  1. mkdir /mnt/mycephfs
  2. mount -t ceph {ip-address-of-monitor}:6789:/ /mnt/mycephfs
The ceph cluster uses the authentication service by default, specifying the username and user secretfile
  1. mount -t ceph 192.168.0.1:6789:/ /mnt/mycephfs -o name=admin,secretfile=admin.secret
Note that the Ceph FS filesystem is mounted on the master node, not the server node.

Use: Userspace filesystem (fuse)

Mount ceph FS as a file system in user space
  1. mkdir ~/mycephfs
  2. ceph-fuse -m {ip-address-of-monitor}:6789 ~/mycephfs
Ceph storage clusters use authentication by default. Specify the keyring if it is not in the default location (i.e. /etc/ceph)
  1. ceph-fuse -k ./ceph/client.admin.keyring -m 192.168.0.1:6789 ~/mycephfs

extra information

See Ceph FS for more information. 
Ceph FS is not as stable as Ceph Block Device and Ceph Object Storage.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325268368&siteId=291194637