Docs/存储/ceph/p版本安装/10-创建存储策略并和pool关联.md

33 lines
No EOL
938 B
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

1. 添加池
```shell
# ceph osd pool create ssdpool 256 256
# ceph osd pool create hddpool 256 256
## 列出池
# ceph osd lspools
1 .mgr
2 ssdpool
3 hddpool
```
2. 创建规则以使用该设备
```shell
# ceph osd crush rule create-replicated ssd default host ssd
# ceph osd crush rule create-replicated hdd default host hdd
## 查看池规则
# ceph osd crush rule ls
replicated_rule
ssd
hdd
```
3. 将池设置为使用规则
```shell
ceph osd pool set ssdpool crush_rule ssd
ceph osd pool set hddpool crush_rule hdd
```
4. 删除池
```shell
## 删除池时池的名字要输入2次
# ceph osd pool rm testpool --yes-i-really-really-mean-it
Error EPERM: WARNING: this will *PERMANENTLY DESTROY* all data stored in pool testpool.  If you are *ABSOLUTELY CERTAIN* that is what you want, pass the pool name *twice*, followed by --yes-i-really-really-mean-it.
# ceph osd pool rm testpool testpool --yes-i-really-really-mean-it
```