root@Kylin:/sys# ceph osd pool create rbd_pool 1024 1024
pool 'rbd_pool' created
root@Kylin:/sys# ceph osd pool set rbd_pool size 3
set pool 9 size to 3
root@Kylin:/sys#
root@Kylin:/sys# ceph osd erasure-code-profile set test_file k=2 m=1 plugin=jerasure ruleset-failure-domain=host technique=reed_sol_van
root@Kylin:/sys# ceph osd pool create bp_ec_pool 1024 1024 erasure test_file
pool 'bp_ec_pool' created
root@Kylin:/sys# ceph osd erasure-code-profile get test_file
directory=/usr/lib/ceph/erasure-code
k=2
m=1
plugin=jerasure
ruleset-failure-domain=host
technique=reed_sol_van
root@Kylin:/sys# ceph osd erasure-code-profile rm test_file
root@Kylin:/sys# ceph osd pool get testrbd size
size: 2
root@Kylin:/sys# ceph osd pool set testrbd size 3
set pool 5 size to 3
root@Kylin:/sys# ceph osd pool get testrbd size
size: 3
root@Kylin:/sys# ceph osd dump | grep pool
pool 1 'summer60sys000' replicated size 2 min_size 1 crush_ruleset 1 object_hash rjenkins pg_num 256 pgp_num 256 last_change 490 flags hashpspool crash_replay_interval 45 stripe_width 0
pool 3 'summer38-fec-691852341313819928811' erasure size 4 min_size 3 crush_ruleset 2 object_hash rjenkins pg_num 1024 pgp_num 1024 last_change 500 flags hashpspool stripe_width 12288
pool 5 'testrbd' replicated size 3 min_size 1 crush_ruleset 0 object_hash rjenkins pg_num 1024 pgp_num 1024 last_change 509 flags hashpspool stripe_width 0
root@Kylin:/sys# rados lspools
summer60sys000
summer38-fec-691852341313819928811
testrbd
root@Kylin:/sys# rados df
pool name KB objects clones degraded unfound rd rd KB wr wr KB
summer38-fec-691852341313819928811 63550735361 15515418 0 0 0 646239 18030316 16363738 63882405016
summer60sys000 61302 1535 0 0 0 298021 2242450 296434 2252475
testrbd 0 0 0 0 0 0 0 0 0
total used 86041904154 15516953
total avail 267288605958
total space 372084556416
root@Kylin:/sys# ceph osd pool ls
summer60sys000
summer38-fec-691852341313819928811
testrbd
root@Kylin:/sys# ceph osd lspools
1 summer60sys000,3 summer38-fec-691852341313819928811,5 testrbd,
root@Kylin:/sys# ceph osd pool set testrbd compress true
set pool 5 compress to true
root@Kylin:/sys# ceph osd pool get testrbd compress
compress: true
root@Kylin:/sys#
root@Kylin:/sys# ceph osd pool set testrbd crypt true
set pool 5 crypt to true
root@Kylin:/sys# ceph osd pool get testrbd crypt
crypt: true
root@Kylin:/sys#
root@Kylin:/sys# ceph osd pool set-quota rbd_pool max_bytes 2097152000
set-quota max_bytes = 2097152000 for pool rbd_pool
root@Kylin:/sys# ceph osd pool get-quota rbd_pool
quotas for pool 'rbd_pool':
max objects: N/A
max bytes : 2000MB
root@Kylin:/sys# ceph osd pool delete test2rbd test2rbd --yes-i-really-really-mean-it
pool 'test2rbd' removed
root@Kylin:/sys# rbd create --size 10240 testrbd/creatrbd
root@Kylin:/sys# rbd -p testrbd ls
creatrbd
root@Kylin:/sys# rbd ls testrbd
creatrbd
root@Kylin:/sys# rbd info testrbd/creatrbd
rbd image 'creatrbd':
size 10240 MB in 2560 objects
order 22 (4096 kB objects)
block_name_prefix: rbd_data.28d5f6b8b4567
format: 2
timestamp: 2021-05-13 09:27:32
features: layering
flags:
root@Kylin:/sys# rbd resize --size 20480 testrbd/creatrbd
Resizing image: 100% complete...done.
root@Kylin:/sys# rbd info testrbd/creatrbd
rbd image 'creatrbd':
size 20480 MB in 5120 objects
order 22 (4096 kB objects)
block_name_prefix: rbd_data.28d5f6b8b4567
format: 2
timestamp: 2021-05-13 09:27:32
features: layering
flags:
testrbd
中的块creatrbd
移动到池test2rbd
中root@Kylin:/sys# rados lspools
summer60sys000
summer38-fec-691852341313819928811
testrbd
test2rbd
root@Kylin:/sys# rbd ls testrbd
creatrbd
root@Kylin:/sys# rbd ls test2rbd
root@Kylin:/sys#
root@Kylin:/sys# rbd snap ls testrbd/creatrbd
SNAPID NAME SIZE
2 snapcreatrbd 20480 MB
root@Kylin:/sys# rbd clone testrbd/creatrbd@snapcreatrbd test2rbd/creatrbd
2021-05-13 09:37:22.310112 ffff93209280 -1 librbd: parent snapshot must be protected
rbd: clone error: (22) Invalid argument
root@Kylin:/sys# rbd snap protect testrbd/creatrbd@snapcreatrbd
root@Kylin:/sys# rbd clone testrbd/creatrbd@snapcreatrbd test2rbd/creatrbd
root@Kylin:/sys# rbd ls testrbd
creatrbd
root@Kylin:/sys# rbd ls test2rbd
creatrbd
root@Kylin:/sys#
root@Kylin:/sys# rbd info testrbd/creatrbd
rbd image 'creatrbd':
size 20480 MB in 5120 objects
order 22 (4096 kB objects)
block_name_prefix: rbd_data.28d5f6b8b4567
format: 2
timestamp: 2021-05-13 09:27:32
features: layering
flags:
root@Kylin:/sys# rbd map --image testrbd/creatrbd
/dev/cephrbd0
root@Kylin:/sys# rbd showmapped
id pool image snap device
0 testrbd creatrbd - /dev/cephrbd0
root@Kylin:/sys#
root@Kylin:/sys# lsblk | grep cephrbd0
cephrbd0 252:0 0 20G 0 disk
root@Kylin:/sys# mkfs.xfs /dev/cephrbd0
meta-data=/dev/cephrbd0 isize=512 agcount=17, agsize=326656 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=0
data = bsize=4096 blocks=5242880, imaxpct=25
= sunit=1024 swidth=1024 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=8 blks, lazy-count=1
realtime =无 extsz=4096 blocks=0, rtextents=0
root@Kylin:/sys# mkdir /rbdtest
root@Kylin:/sys# mount /dev/cephrbd0 /rbdtest/
root@Kylin:/sys# df -h | grep rbd
/dev/cephrbd0 20G 33M 20G 1% /rbdtest
root@Kylin:/sys#
root@Kylin:/sys# umount -l /rbdtest/
root@Kylin:/sys# rbd unmap /dev/rbd/testrbd/creatrbd
root@Kylin:/sys# rbd showmapped
root@Kylin:/sys#
root@Kylin:/sys# tgtadm --lld iscsi --mode target --op new --tid 2 --targetname iqn.2021-05.com.919:192.168.88.105.sn.84736ec1e9db9037c6b1a32
root@Kylin:/sys# tgtadm -L iscsi -m target -o show | grep 'Target 2'
Target 2: iqn.2021-05.com.919:192.168.88.105.sn.84736ec1e9db9037c6b1a32
root@Kylin:/sys# tgtadm -L iscsi -m logicalunit -o new -t 2 -l 1 -b testrbd/creatrbd --bstype rbd
root@Kylin:/sys# tgtadm -L iscsi -m target -o bind -t 2 -I ALL
root@Kylin:/sys# tgtadm -L iscsi -m target -o show
...
Target 2: iqn.2021-05.com.919:192.168.88.105.sn.84736ec1e9db9037c6b1a32
System information:
Driver: iscsi
State: ready
I_T nexus information:
LUN information:
LUN: 0
Type: controller
SCSI ID: IET 00020000
SCSI SN: beaf20
Size: 0 MB, Block size: 1
Online: Yes
Removable media: No
Prevent removal: No
Readonly: No
SWP: No
Thin-provisioning: No
Backing store type: null
Backing store path: None
Backing store flags:
LUN: 1
Type: disk
SCSI ID: IET 00020001
SCSI SN: beaf21
Size: 21475 MB, Block size: 512
Online: Yes
Removable media: No
Prevent removal: No
Readonly: No
SWP: No
Thin-provisioning: No
Backing store type: rbd
Backing store path: testrbd/creatrbd
Backing store flags:
Account information:
ACL information:
ALL
root in iscloud163-200 in ~ via 🐍 v2.7.5
➜ iscsiadm -m discovery -t st -p 192.168.88.105:3260
192.168.88.105:3260,1 iqn.2021-05.com.015:192.168.88.sn.163cbb414ff35ad401c995bb
192.168.88.105:3260,1 iqn.2021-05.com.919:192.168.88.105.sn.84736ec1e9db9037c6b1a32
root in iscloud163-200 in ~ via 🐍 v2.7.5
➜
1 2 3 4 5 6
root@Kylin:/sys# rbd ls test2rbd
creatrbd
root@Kylin:/sys# rbd info test2rbd/creatrbd
rbd image 'creatrbd':
size 20480 MB in 5120 objects
order 22 (4096 kB objects)
block_name_prefix: rbd_data.28d936b8b4567
format: 2
timestamp: 2021-05-13 09:38:02
features: layering
flags:
parent: testrbd/creatrbd@snapcreatrbd
overlap: 20480 MB
root@Kylin:/sys# rbd rename test2rbd/creatrbd test2rbd/creatrbd-del
root@Kylin:/sys# rbd snap ls test2rbd/creatrbd
2021-05-13 09:54:49.068213 ffff83e99280 -1 librbd::ImageCtx: error finding header: (2) No such file or directory
rbd: error opening image creatrbd: (2) No such file or directory
root@Kylin:/sys# rbd -p test2rbd info creatrbd-del | /bin/grep block_name_prefix | /usr/bin/awk -F. '{print $2}'
28d936b8b4567
root@Kylin:/sys# rados -p test2rbd rm rbd_id.creatrbd-del
root@Kylin:/sys# rados -p test2rbd rm rbd_header.28d936b8b4567
root@Kylin:/sys# rados -p test2rbd rmomapkey rbd_directory id_28d936b8b4567
root@Kylin:/sys# rados -p test2rbd rmomapkey rbd_directory name_creatrbd-del
root@Kylin:/sys# rbd ls testrbd
creatrbd
root@Kylin:/sys# rbd trash move creatrbd -p testrbd
rbd: error parsing command 'trash'; -h or --help for usage
root@Kylin:/sys# rbd ls testrbd
creatrbd
newcreatrbd
root@Kylin:/sys# rbd snap create --snap creatrbdsnap testrbd/creatrbd
root@Kylin:/sys# rbd snap create --snap creatrbdsnap2 testrbd/creatrbd
root@Kylin:/sys# rbd snap create --snap creatrbdsnap3 testrbd/creatrbd
root@Kylin:/sys#
root@Kylin:/sys# rbd snap ls testrbd/creatrbd
SNAPID NAME SIZE
4 creatrbdsnap 20480 MB
5 creatrbdsnap2 20480 MB
6 creatrbdsnap3 20480 MB
root@Kylin:/sys# rbd snap protect testrbd/creatrbd@snapcreatrbd
root@Kylin:/sys# rbd ls testrbd
creatrbd
root@Kylin:/sys# rbd snap ls testrbd/creatrbd
SNAPID NAME SIZE
2 snapcreatrbd 20480 MB
root@Kylin:/sys# rbd clone testrbd/creatrbd@snapcreatrbd testrbd/newcreatrbd
root@Kylin:/sys# rbd ls testrbd
creatrbd
newcreatrbd
root@Kylin:/sys#
root@Kylin:/sys# rbd flatten testrbd/newcreatrbd
Image flatten: 100% complete...done.
root@Kylin:/sys# rbd snap unprotect testrbd/creatrbd@snapcreatrbd
root@Kylin:/sys# rbd snap ls testrbd/creatrbd
SNAPID NAME SIZE
2 snapcreatrbd 20480 MB
root@Kylin:/sys# rbd snap rollback testrbd/creatrbd@snapcreatrbd
Rolling back to snapshot: 100% complete...done.
root@Kylin:/sys# rbd snap rm testrbd/creatrbd@snapcreatrbd
root@Kylin:/sys# rbd snap ls testrbd/creatrbd
SNAPID NAME SIZE
4 creatrbdsnap 20480 MB
5 creatrbdsnap2 20480 MB
6 creatrbdsnap3 20480 MB
root@Kylin:/sys# rbd snap purge testrbd/creatrbd
Removing all snapshots: 100% complete...done.
root@Kylin:/sys# rbd snap ls testrbd/creatrbd
root@Kylin:/sys# radosgw-admin user create --uid="summerKing" --display-name="summerKing" --access-key=q88888888
{
"user_id": "summerKing",
"display_name": "summerKing",
"email": "",
"suspended": 0,
"max_buckets": 1000,
"auid": 0,
"subusers": [],
"keys": [
{
"user": "summerKing",
"access_key": "q88888888",
"secret_key": "jTn1W0yrqWEKvVMzOUepDC0SikKfUXtJxZhIcJRX"
}
],
"swift_keys": [],
"caps": [],
"op_mask": "read, write, delete",
"default_placement": "",
"placement_tags": [],
"bucket_quota": {
"enabled": false,
"check_on_raw": false,
"max_size": -1,
"max_size_kb": -1,
"max_objects": -1
},
"user_quota": {
"enabled": false,
"check_on_raw": false,
"max_size": -1,
"max_size_kb": -1,
"max_objects": -1
},
"temp_url_keys": [],
"mfa_ids": []
}
root@Kylin:/sys#
root@Kylin:/sys# radosgw-admin metadata list user
[
"summerKing"
]
root@Kylin:/sys# radosgw-admin user info --uid=summerKing
{
"user_id": "summerKing",
"display_name": "summerKing",
"email": "",
"suspended": 0,
"max_buckets": 1000,
"auid": 0,
"subusers": [],
"keys": [
{
"user": "summerKing",
"access_key": "q88888888",
"secret_key": "jTn1W0yrqWEKvVMzOUepDC0SikKfUXtJxZhIcJRX"
}
],
"swift_keys": [],
"caps": [],
"op_mask": "read, write, delete",
"default_placement": "",
"placement_tags": [],
"bucket_quota": {
"enabled": false,
"check_on_raw": false,
"max_size": -1,
"max_size_kb": -1,
"max_objects": -1
},
"user_quota": {
"enabled": false,
"check_on_raw": false,
"max_size": -1,
"max_size_kb": -1,
"max_objects": -1
},
"temp_url_keys": [],
"mfa_ids": []
}
root@Kylin:/sys# radosgw-admin user modify --uid=summerKing --display-name="xswgogogo" --email=1111111@qq.com
{
"user_id": "summerKing",
"display_name": "xswgogogo",
"email": "1111111@qq.com",
"suspended": 0,
"max_buckets": 1000,
"auid": 0,
"subusers": [],
"keys": [
{
"user": "summerKing",
"access_key": "q88888888",
"secret_key": "jTn1W0yrqWEKvVMzOUepDC0SikKfUXtJxZhIcJRX"
}
],
"swift_keys": [],
"caps": [],
"op_mask": "read, write, delete",
"default_placement": "",
"placement_tags": [],
"bucket_quota": {
"enabled": false,
"check_on_raw": false,
"max_size": -1,
"max_size_kb": -1,
"max_objects": -1
},
"user_quota": {
"enabled": false,
"check_on_raw": false,
"max_size": -1,
"max_size_kb": -1,
"max_objects": -1
},
"temp_url_keys": [],
"mfa_ids": []
}
root@Kylin:/sys# radosgw-admin user rm --uid=summerKing
1
root@Kylin:/sys# radosgw-admin quota set --quota-scope=user --uid=xsw --max-objects=10240 --max-size=10240
root@Kylin:/sys# radosgw-admin user info --uid=xsw
{
"user_id": "xsw",
"display_name": "xswlalala",
"email": "",
"suspended": 0,
"max_buckets": 1000,
"auid": 0,
"subusers": [],
"keys": [
{
"user": "xsw",
"access_key": "q88888888",
"secret_key": "Q7ToQSqlSiECUq63SIia4evfkAkJG5TGxqr2Wacy"
}
],
"swift_keys": [],
"caps": [],
"op_mask": "read, write, delete",
"default_placement": "",
"placement_tags": [],
"bucket_quota": {
"enabled": false,
"check_on_raw": false,
"max_size": -1,
"max_size_kb": -1,
"max_objects": -1
},
"user_quota": {
"enabled": false,
"check_on_raw": false,
"max_size": 10240,
"max_size_kb": 10,
"max_objects": 10240
},
"temp_url_keys": [],
"mfa_ids": []
}
root@Kylin:/sys# radosgw-admin quota enable --quota-scope=user --uid=xsw
root@Kylin:/sys# radosgw-admin user info --uid=xsw
{
"user_id": "xsw",
"display_name": "xswlalala",
"email": "",
"suspended": 0,
"max_buckets": 1000,
"auid": 0,
"subusers": [],
"keys": [
{
"user": "xsw",
"access_key": "q88888888",
"secret_key": "Q7ToQSqlSiECUq63SIia4evfkAkJG5TGxqr2Wacy"
}
],
"swift_keys": [],
"caps": [],
"op_mask": "read, write, delete",
"default_placement": "",
"placement_tags": [],
"bucket_quota": {
"enabled": false,
"check_on_raw": false,
"max_size": -1,
"max_size_kb": -1,
"max_objects": -1
},
"user_quota": {
"enabled": true,
"check_on_raw": false,
"max_size": 10240,
"max_size_kb": 10,
"max_objects": 10240
},
"temp_url_keys": [],
"mfa_ids": []
}
root@Kylin:/sys# radosgw-admin metadata list bucket
[
"bkt"
]
1 2 3 4 5 6
root@Kylin:/sys# radosgw-admin bucket stats --bucket=bkt
{
"bucket": "bkt",
"tenant": "",
"pool": "summer60sys000",
"index_pool": "summer60sys000",
"id": "default.170839.1",
"marker": "default.170839.1",
"owner": "test",
"seconds_upload": false,
"multi_version": false,
"append_write": false,
"ver": "0#1,1#1,2#1,3#1",
"master_ver": "0#0,1#0,2#0,3#0",
"mtime": "2021-05-13 11:39:43.000000",
"max_marker": "0#,1#,2#,3#",
"usage": {},
"bucket_quota": {
"enabled": false,
"check_on_raw": false,
"max_size": -1,
"max_size_kb": -1,
"max_objects": -1
}
}
root@Kylin:/sys# radosgw-admin user stats --uid=test
{
"stats": {
"total_entries": 0,
"total_bytes": 0,
"total_bytes_rounded": 0
},
"last_stats_sync": "0.000000",
"last_stats_update": "2021-05-13 03:39:43.033283Z"
}
root@Kylin:/sys# radosgw-admin quota set --uid=test --quota-scope=bucket --max-objects=20480 --max-size=20480
root@Kylin:/sys# radosgw-admin user info --uid=test
{
"user_id": "test",
"display_name": "test",
"email": "asdasd@qq.com",
"suspended": 0,
"max_buckets": 1000,
"auid": 0,
"subusers": [],
"keys": [
{
"user": "test",
"access_key": "q1234567",
"secret_key": "q1234567"
}
],
"swift_keys": [],
"caps": [],
"op_mask": "read, write, delete",
"default_placement": "",
"placement_tags": [],
"bucket_quota": {
"enabled": false,
"check_on_raw": false,
"max_size": 20480,
"max_size_kb": 20,
"max_objects": 20480
},
"user_quota": {
"enabled": false,
"check_on_raw": false,
"max_size": -1,
"max_size_kb": -1,
"max_objects": -1
},
"temp_url_keys": [],
"mfa_ids": []
}
root@Kylin:/sys# radosgw-admin quota enable --quota-scope=bucket --uid=test
root@Kylin:/sys# radosgw-admin user info --uid=test
{
"user_id": "test",
"display_name": "test",
"email": "asdasd@qq.com",
"suspended": 0,
"max_buckets": 1000,
"auid": 0,
"subusers": [],
"keys": [
{
"user": "test",
"access_key": "q1234567",
"secret_key": "q1234567"
}
],
"swift_keys": [],
"caps": [],
"op_mask": "read, write, delete",
"default_placement": "",
"placement_tags": [],
"bucket_quota": {
"enabled": true,
"check_on_raw": false,
"max_size": 20480,
"max_size_kb": 20,
"max_objects": 20480
},
"user_quota": {
"enabled": false,
"check_on_raw": false,
"max_size": -1,
"max_size_kb": -1,
"max_objects": -1
},
"temp_url_keys": [],
"mfa_ids": []
}
s3cmd --configure
)root in iscloud150-11 in ~ via 🐍 v2.7.5 took 1m9s
➜ s3cmd mb s3://test-bucket
Bucket 's3://test-bucket/' created
1 2 3
root in iscloud150-11 in ~ via 🐍 v2.7.5
➜ s3cmd rb s3://test-bucket
Bucket 's3://test-bucket/' removed
1 2 3
root in iscloud150-11 in ~ via 🐍 v2.7.5
➜ s3cmd mb s3://test-bucket
Bucket 's3://test-bucket/' created
root in iscloud150-11 in ~ via 🐍 v2.7.5
➜ s3cmd put s3test.py s3://test-bucket
upload: 's3test.py' -> 's3://test-bucket/s3test.py' [1 of 1]
516 of 516 100% in 0s 7.95 KB/s done
root in iscloud150-11 in /home
➜ s3cmd get s3://test-bucket/s3test.py
download: 's3://test-bucket/s3test.py' -> './s3test.py' [1 of 1]
516 of 516 100% in 0s 11.55 KB/s done
root in iscloud150-11 in /home via 🐍 v2.7.5
➜ s3cmd ls s3://test-bucket
2021-05-13 05:48 516 s3://test-bucket/s3test.py
root in iscloud150-11 in /home via 🐍 v2.7.5
➜ s3cmd del s3://test-bucket/s3test.py
delete: 's3://test-bucket/s3test.py'
root in iscloud150-11 in /home via 🐍 v2.7.5
用户 | 组 | 其他 |
---|---|---|
读,执行 | 写 | 读,执行 |
root@Kylin:/tmp/test# ll | grep worm_test/
drwxr-xr-x 1 root root 0 May 14 11:28 worm_test/
root@Kylin:/tmp/test# chgrp test-dir worm_test/
root@Kylin:/tmp/test# chown testone worm_test/
root@Kylin:/tmp/test# chmod 525 worm_test/
root@Kylin:/tmp/test# ll | grep worm_test/
dr-x-w-r-x 1 testone test-dir 0 May 14 11:28 worm_test/
root@Kylin:/tmp/test#
总用量 1024004
drw-r---w- 1 root root 1048576000 May 14 13:49 ./
drwxrwxrwt 9 root root 4096 May 14 14:19 ../
-rw-r--r-- 1 root root 1048576000 May 14 13:49 testfile
dr-xrw-r-x 1 root root 0 May 14 11:28 worm_test/
root@Kylin:/tmp/test# getfacl testfile
# file: testfile
# owner: root
# group: root
user::rw-
group::r--
other::r--
root@Kylin:/tmp/test# setfacl -m u:testone:rw testfile
root@Kylin:/tmp/test# setfacl -m g:test-dir:r testfile
root@Kylin:/tmp/test# getfacl -c testfile
user::rw-
user:testone:rw-
group::r--
group:test-dir:r--
mask::rw-
other::r--
root@Kylin:/home/hci_sysadmin# groupadd gptest -g 1509
1
root@Kylin:/home/hci_sysadmin# useradd utest -u 1509 -s /bin//bash -c "don't remove" -G gptest
root@Kylin:/home/hci_sysadmin# id utest
uid=1509(utest) gid=1510(utest) 组=1510(utest),1509(gptest)
root@Kylin:/home/hci_sysadmin#
root@Kylin:/home/hci_sysadmin# mkdir -p /tmp/test
root@Kylin:/home/hci_sysadmin# chmod 755 /tmp/test
root@Kylin:/home/hci_sysadmin# mount -t ceph 88.88.88.101,88.88.88.102,88.88.88.103:'/summer38-fec-691852341313819928811/vr/test-permissions' '/tmp/test' -o readdir_max_bytes=4194304,readdir_max_entries=8192,rasize=134217728,noatime,wr_inflight_limit=9371,pool_id=3
root@Kylin:/home/hci_sysadmin# setfattr -n user.file.used.1509 -v 0 /tmp/test
root@Kylin:/home/hci_sysadmin# setfattr -n user.file.total.1509 -v 100 /tmp/test
root@Kylin:/home/hci_sysadmin# setfattr -n user.vol.used.1509 -v 0 /tmp/test
root@Kylin:/home/hci_sysadmin# setfattr -n user.vol.total.1509 -v 10485760000 /tmp/test
root@Kylin:/home/hci_sysadmin# getfattr -dm ".*" /tmp/test
getfattr:删去绝对路径名最前面的'/'
# file: tmp/test
ceph.dir.entries="0"
ceph.dir.files="0"
ceph.dir.rbytes="0"
ceph.dir.rctime="0.090"
ceph.dir.rentries="1"
ceph.dir.rfiles="0"
ceph.dir.rsubdirs="1"
ceph.dir.subdirs="0"
user.file.total.1509="100"
user.file.total.64056="888888888"
user.file.used.1509="0"
user.vol.total.1509="10485760000"
user.vol.total.64056="10484711424"
user.vol.used.1509="0"
root@Kylin:/home/hci_sysadmin# umount /tmp/test
root@Kylin:/tmp/test# setfattr -x user.file.used.1509 -h /tmp/test
root@Kylin:/tmp/test# setfattr -x user.file.total.1509 -h /tmp/test
root@Kylin:/tmp/test# setfattr -x user.vol.used.1509 -h /tmp/test
root@Kylin:/tmp/test# setfattr -x user.vol.total.1509 -h /tmp/test
root@Kylin:/tmp/test# getfattr -dm ".*" /tmp/test
getfattr:删去绝对路径名最前面的'/'
# file: tmp/test
ceph.dir.entries="0"
ceph.dir.files="0"
ceph.dir.rbytes="0"
ceph.dir.rctime="0.090"
ceph.dir.rentries="1"
ceph.dir.rfiles="0"
ceph.dir.rsubdirs="1"
ceph.dir.subdirs="0"
user.file.total.64056="888888888"
user.vol.total.64056="10484711424"
root@Kylin:/tmp/test# setfattr -n group.file.used.1509 -v 0 /tmp/test
root@Kylin:/tmp/test# setfattr -n group.file.total.1509 -v 200 /tmp/test
root@Kylin:/tmp/test# setfattr -n group.vol.used.1509 -v 0 /tmp/test
root@Kylin:/tmp/test# setfattr -n group.vol.total.1509 -v 20971520000 /tmp/test
root@Kylin:/tmp/test# getfattr -dm ".*" /tmp/test
getfattr:删去绝对路径名最前面的'/'
# file: tmp/test
group.file.total.1509="200"
group.file.used.1509="0"
group.vol.total.1509="20971520000"
group.vol.used.1509="0"
ceph.dir.entries="0"
ceph.dir.files="0"
ceph.dir.rbytes="0"
ceph.dir.rctime="0.090"
ceph.dir.rentries="1"
ceph.dir.rfiles="0"
ceph.dir.rsubdirs="1"
ceph.dir.subdirs="0"
user.file.total.64056="888888888"
user.vol.total.64056="10484711424"
root@Kylin:/tmp/test#
root@Kylin:/tmp/test# setfattr -x group.file.used.1509 /tmp/test
root@Kylin:/tmp/test# setfattr -x group.file.total.1509 /tmp/test
root@Kylin:/tmp/test# setfattr -x group.vol.used.1509 /tmp/test
root@Kylin:/tmp/test# setfattr -x group.vol.total.1509 /tmp/test
root@Kylin:/tmp/test# setfattr -n user.quota -v 52428800000 /tmp/test
root@Kylin:/tmp/test# getfattr -dm ".*" /tmp/test
getfattr:删去绝对路径名最前面的'/'
# file: tmp/test
ceph.dir.entries="0"
ceph.dir.files="0"
ceph.dir.rbytes="0"
ceph.dir.rctime="0.090"
ceph.dir.rentries="1"
ceph.dir.rfiles="0"
ceph.dir.rsubdirs="1"
ceph.dir.subdirs="0"
user.file.total.64056="888888888"
user.quota="52428800000"
user.vol.total.64056="10484711424"
root@Kylin:/tmp/test# setfattr -x user.quota /tmp/test
root@Kylin:/tmp/test# getfattr -dm ".*" /tmp/test
getfattr:删去绝对路径名最前面的'/'
# file: tmp/test
ceph.dir.entries="0"
ceph.dir.files="0"
ceph.dir.rbytes="0"
ceph.dir.rctime="0.090"
ceph.dir.rentries="1"
ceph.dir.rfiles="0"
ceph.dir.rsubdirs="1"
ceph.dir.subdirs="0"
user.file.total.64056="888888888"
user.vol.total.64056="10484711424"
root@Kylin:/tmp/test# setfattr -n file.quota -v 100 /tmp/test/
root@Kylin:/tmp/test# getfattr -dm ".*" /tmp/test
getfattr:删去绝对路径名最前面的'/'
# file: tmp/test
file.quota="100"
ceph.dir.entries="0"
ceph.dir.files="0"
ceph.dir.rbytes="0"
ceph.dir.rctime="0.090"
ceph.dir.rentries="1"
ceph.dir.rfiles="0"
ceph.dir.rsubdirs="1"
ceph.dir.subdirs="0"
user.file.total.64056="888888888"
user.vol.total.64056="10484711424"
root@Kylin:/tmp/test# df -h | grep test
88.88.88.101,88.88.88.102,88.88.88.103:/summer38-fec-691852341313819928811/vr/test-permissions 298T 60T 239T 20% /tmp/test
root@Kylin:/tmp# mount -t ceph -o readdir_max_bytes=4194304,readdir_max_entries=8192,noatime,quota_nearfull_ratio=85,quota_dir,rasize=134217728,pool_id=3,statfs_xattr 88.88.88.101,88.88.88.102,88.88.88.103:'/summer38-fec-691852341313819928811/vr/test-permissions' '/tmp/test'
root@Kylin:/tmp# setfattr -n user.total -v 536870912000 /tmp/test
root@Kylin:/tmp# df -h | grep 500
88.88.88.101,88.88.88.102,88.88.88.103:/summer38-fec-691852341313819928811/vr/test-permissions 500G 0 500G 0% /tmp/test
root@Kylin:/tmp/test# mkdir worm_test
root@Kylin:/tmp/test# ll
总用量 4
drw-r---w- 1 root root 0 May 14 11:28 ./
drwxrwxrwt 9 root root 4096 May 14 11:28 ../
drwxr-xr-x 1 root root 0 May 14 11:28 worm_test/
root@Kylin:/tmp/test# ceph_worm_set -u utest -p q1234567 -d /tmp/test/worm_test/
OK
root@Kylin:/tmp/test# getfattr -dm ".*" /tmp/test/worm_test/
getfattr:删去绝对路径名最前面的'/'
# file: tmp/test/worm_test/
ceph.dir.entries="0"
ceph.dir.files="0"
ceph.dir.rbytes="0"
ceph.dir.rctime="0.090"
ceph.dir.rentries="1"
ceph.dir.rfiles="0"
ceph.dir.rsubdirs="1"
ceph.dir.subdirs="0"
user.username.utest="d4ySaq8FuJEW1bUalZGT3Q=="
root@Kylin:/tmp/test#
root@Kylin:/tmp/test# ceph_worm_set -d /tmp/test/worm_test/ -u utest -p q1234567 -m 08,09,10 -a 01,02,03,04,05,06,07,08,09,10 -w 1,2 -t 00:00:00-11:00:42 -e 1
OK
root@Kylin:/tmp/test# getfattr -dm ".*" /tmp/test/worm_test/
getfattr:删去绝对路径名最前面的'/'
# file: tmp/test/worm_test/
ceph.dir.entries="0"
ceph.dir.files="0"
ceph.dir.rbytes="0"
ceph.dir.rctime="0.090"
ceph.dir.rentries="1"
ceph.dir.rfiles="0"
ceph.dir.rsubdirs="1"
ceph.dir.subdirs="0"
user.day="01,02,03,04,05,06,07,08,09,10"
user.enable="1"
user.month="08,09,10"
user.time="00:00:00-11:00:42"
user.username.utest="d4ySaq8FuJEW1bUalZGT3Q=="
user.week="1,2"
root@Kylin:/tmp/test#
WORM将在08,09,10(月)01,02,03,04,05,06,07,08,09,10(日)周一,周二00:00:00-11:30:39禁用
root@Kylin:/tmp/test# ceph_worm_set -d /tmp/test/worm_test/ -u utest -p q1234567 -m 08,09,10 -a 01,02,03,04,05,06,07,08,09,10 -w 1,2 -t 00:00:00-11:00:42 -e 0
OK
root@Kylin:/tmp/test# getfattr -dm ".*" /tmp/test/worm_test/
getfattr:删去绝对路径名最前面的'/'
# file: tmp/test/worm_test/
ceph.dir.entries="0"
ceph.dir.files="0"
ceph.dir.rbytes="0"
ceph.dir.rctime="0.090"
ceph.dir.rentries="1"
ceph.dir.rfiles="0"
ceph.dir.rsubdirs="1"
ceph.dir.subdirs="0"
user.day="01,02,03,04,05,06,07,08,09,10"
user.enable="0"
user.month="08,09,10"
user.time="00:00:00-11:00:42"
user.username.utest="d4ySaq8FuJEW1bUalZGT3Q=="
user.week="1,2"
root@Kylin:/tmp/test# ceph_worm_set -D /tmp/test/worm_test/ -u utest -p q1234567
OK
root@Kylin:/tmp/test# getfattr -dm ".*" /tmp/test/worm_test/
getfattr:删去绝对路径名最前面的'/'
# file: tmp/test/worm_test/
ceph.dir.entries="0"
ceph.dir.files="0"
ceph.dir.rbytes="0"
ceph.dir.rctime="0.090"
ceph.dir.rentries="1"
ceph.dir.rfiles="0"
ceph.dir.rsubdirs="1"
ceph.dir.subdirs="0"