Create new pool and place new osd » History » Version 5
Jin-Guk Kwon, 09/14/2020 12:05 PM
1 | 1 | Jin-Guk Kwon | h1. Create new pool and place new osd |
---|---|---|---|
2 | |||
3 | 4 | Jin-Guk Kwon | h2. 1. create pool |
4 | |||
5 | manual |
||
6 | 1 | Jin-Guk Kwon | https://docs.ceph.com/docs/jewel/rados/operations/pools/#create-a-pool |
7 | |||
8 | <pre> |
||
9 | ceph osd pool create {pool-name} {pg-num} [{pgp-num}] [replicated] \ |
||
10 | [crush-ruleset-name] [expected-num-objects] |
||
11 | </pre> |
||
12 | |||
13 | osds are 5~10 --> pg_num 512 |
||
14 | osds are 10~50 --> pg_num 4096 |
||
15 | osds are more than 50 --> need to calculation(pgcalc) |
||
16 | |||
17 | <pre> |
||
18 | ex) ceph osd pool create xruk-ssd-pool 128 128 |
||
19 | </pre> |
||
20 | |||
21 | 4 | Jin-Guk Kwon | h2. 2. create rule |
22 | |||
23 | manual |
||
24 | 1 | Jin-Guk Kwon | https://docs.ceph.com/docs/master/rados/operations/crush-map/#creating-a-rule-for-a-replicated-pool |
25 | |||
26 | <pre> |
||
27 | ceph osd crush rule create-replicated <rule-name> <root> <failure-domain> <class> |
||
28 | </pre> |
||
29 | |||
30 | 3 | Jin-Guk Kwon | <pre> |
31 | 1 | Jin-Guk Kwon | ex) ceph osd crush rule create-replicated xruk-ssd-rule default host xruk-ssd |
32 | </pre> |
||
33 | |||
34 | 5 | Jin-Guk Kwon | h2. 3. set rule on pool |
35 | 4 | Jin-Guk Kwon | |
36 | manual |
||
37 | 1 | Jin-Guk Kwon | https://docs.ceph.com/docs/master/rados/operations/crush-map/#device-classes |
38 | |||
39 | <pre> |
||
40 | ceph osd pool set <pool-name> crush_rule <rule-name> |
||
41 | </pre> |
||
42 | |||
43 | <pre> |
||
44 | ex) ceph osd pool set xruk-ssd-pool crush_rule xruk-ssd-rule |
||
45 | </pre> |
||
46 | 3 | Jin-Guk Kwon | |
47 | 5 | Jin-Guk Kwon | h2. 4. update key |
48 | 4 | Jin-Guk Kwon | |
49 | manual |
||
50 | 2 | Jin-Guk Kwon | https://docs.ceph.com/docs/mimic/rados/operations/user-management/ |
51 | |||
52 | <pre> |
||
53 | ceph auth caps USERTYPE.USERID {daemon} 'allow [r|w|x|*|...] [pool={pool-name}] [namespace={namespace-name}]' [{daemon} 'allow [r|w|x|*|...] [pool={pool-name}] [namespace={namespace-name}]'] |
||
54 | |||
55 | mon 'profile {name}' |
||
56 | osd 'profile {name} [pool={pool-name} [namespace={namespace-name}]]' |
||
57 | </pre> |
||
58 | 1 | Jin-Guk Kwon | |
59 | 2 | Jin-Guk Kwon | <pre> |
60 | 3 | Jin-Guk Kwon | ex) ceph auth caps client.libvirt mon 'profile rbd' osd 'profile rbd pool=xruk-ssd-pool, profile rbd pool=hdd, profile rbd pool=ssd' |
61 | 2 | Jin-Guk Kwon | </pre> |
62 | |||
63 | 5 | Jin-Guk Kwon | h2. 5. set ceph application enable |
64 | 1 | Jin-Guk Kwon | |
65 | <pre> |
||
66 | ceph osd pool application enable <pool-name> <app-name>', where <app-name> is 'cephfs', 'rbd', 'rgw', or freeform for custom applications |
||
67 | </pre> |
||
68 | |||
69 | <pre> |
||
70 | 3 | Jin-Guk Kwon | ex) |
71 | 1 | Jin-Guk Kwon | ~# ceph osd pool application enable xruk-ssd-pool rbd |
72 | enabled application 'rbd' on pool 'xruk-ssd-pool' |
||
73 | </pre> |