#创建fsceph osd lspools
ceph osd pool create cephfs_metadata 64
ceph osd pool create cephfs_data 64
ceph fs new fs_test cephfs_metadata cephfs_data
ceph fs ls
[root@test ~]# ceph fs ls
name: fs_test, metadata pool: cephfs_metadata, data pools: [cephfs_data ]
[root@test ~]#
#配置源
apt-get update
echo deb http://download.ceph.com/debian buster main | sudo tee /etc/apt/sources.list.d/ceph.list
wget -q -O- 'http://download.ceph.com/keys/release.asc' | sudo apt-key add -
apt-get update
#安装ceph客户端,sudo apt install ceph-common
#创建fs挂载目录,复制ceph的key和配置文件,ceph.secres是ceph.client.admin.keyring中的秘钥
mkdir /opt/ceph
cd /etc/cephca
┌──(root㉿kali)-[/etc/ceph]
└─# ll
total 16
-rw-r--r-- 1 root root 151 Dec 12 23:30 ceph.client.admin.keyring
-rw-r--r-- 1 root root 269 Dec 12 23:30 ceph.conf
-rw-r--r-- 1 root root 41 Dec 12 23:41 ceph.secret
-rw-r--r-- 1 root root 92 Dec 4 11:05 rbdmap┌──(root㉿kali)-[/etc/ceph]
└─# cat ceph.secret
AQAP3lpn6y8bGBAA9ZxuiZHlq/zO5K5kdIG1xg==┌──(root㉿kali)-[/etc/ceph]
└─#
直接挂载
mount -t ceph 192.168.159.130:6789:/ /opt/ceph/ -o name=admin,secretfile=/etc/ceph/ceph.secret
#挂在块存储
rbd map --pool cloudpods rdb_1 #pool:cloudpods image:rdb_1
└─# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 80.1G 0 disk
└─sda1 8:1 0 80.1G 0 part /
rbd0 254:0 0 1G 0 disk /mnt
#挂载
mount /dev/rbd0 /mnt
windows安装这两个
配置文件:
[global]
fsid = 22455eba-a87d-405c-af65-d1bf8defce76
public_network = 192.168.159.130/24
cluster_network = 192.168.26.130/24
mon_initial_members = test
mon_host = 192.168.159.130
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx
[global]
log to stderr = true
; Uncomment the following in order to use the Windows Event Log
; log to syslog = true
run dir = C:/ProgramData/ceph/out
crash dir = C:/ProgramData/ceph/out
; Use the following to change the cephfs client log level
; debug client = 2
[client]
keyring = C:/ProgramData/ceph/ceph.client.admin.keyring
; log file = C:/ProgramData/ceph/out/$name.$pid.log
admin socket = C:/ProgramData/ceph/out/$name.$pid.asok
挂载执行:
ceph-dokan.exe -c c:\ProgramData\Ceph\ceph.conf -l x