Management Cluster Ceph » Historique » Version 7
Mehdi Abaakouk, 06/11/2015 17:23
1 | 1 | Mehdi Abaakouk | h1. Management Cluster Ceph |
---|---|---|---|
2 | 1 | Mehdi Abaakouk | |
3 | 2 | Mehdi Abaakouk | h2. Ajout d'un OSD classique |
4 | 2 | Mehdi Abaakouk | |
5 | 2 | Mehdi Abaakouk | <pre> |
6 | 2 | Mehdi Abaakouk | $ ceph-disk prepare --zap-disk --cluster-uuid 1fe74663-8dfa-486c-bb80-3bd94c90c967 --fs-type=xfs /dev/sdX |
7 | 2 | Mehdi Abaakouk | $ smartctl --smart=on /dev/sdX # Pour le monitoring. |
8 | 2 | Mehdi Abaakouk | </pre> |
9 | 2 | Mehdi Abaakouk | |
10 | 2 | Mehdi Abaakouk | Pour un HDD: |
11 | 2 | Mehdi Abaakouk | <pre> |
12 | 2 | Mehdi Abaakouk | $ ceph osd crush add osd.<ID> 0 root=default host=g3 |
13 | 2 | Mehdi Abaakouk | </pre> |
14 | 2 | Mehdi Abaakouk | |
15 | 2 | Mehdi Abaakouk | Pour un SSD: |
16 | 2 | Mehdi Abaakouk | <pre> |
17 | 2 | Mehdi Abaakouk | $ ceph osd crush add osd.<ID> 0 root=ssd host=g3-ssd |
18 | 2 | Mehdi Abaakouk | </pre> |
19 | 2 | Mehdi Abaakouk | |
20 | 2 | Mehdi Abaakouk | Ensuite, autoriser Ceph à mettre des data dessus: |
21 | 2 | Mehdi Abaakouk | |
22 | 2 | Mehdi Abaakouk | <pre> |
23 | 2 | Mehdi Abaakouk | $ /root/tools/ceph-reweight-osds.sh osd.<ID> |
24 | 2 | Mehdi Abaakouk | </pre> |
25 | 2 | Mehdi Abaakouk | |
26 | 2 | Mehdi Abaakouk | h2. Ajout d'un OSD qui partage le SSD avec l'OS |
27 | 2 | Mehdi Abaakouk | |
28 | 2 | Mehdi Abaakouk | |
29 | 2 | Mehdi Abaakouk | En général avec ceph, on donne un disque, ceph créé 2 partitions une pour le journal de l'OSD, l'autre pour les datas |
30 | 2 | Mehdi Abaakouk | mais pour le SSD de tetaneutral qui a aussi l'OS, voici la méthode |
31 | 2 | Mehdi Abaakouk | |
32 | 2 | Mehdi Abaakouk | Création manuelle de la partition de data ceph /dev/sda2 ici |
33 | 7 | Mehdi Abaakouk | |
34 | 7 | Mehdi Abaakouk | Debian (MBR format): |
35 | 2 | Mehdi Abaakouk | <pre> |
36 | 2 | Mehdi Abaakouk | apt-get install partprobe |
37 | 2 | Mehdi Abaakouk | fdisk /dev/sda |
38 | 2 | Mehdi Abaakouk | |
39 | 2 | Mehdi Abaakouk | n |
40 | 2 | Mehdi Abaakouk | p |
41 | 2 | Mehdi Abaakouk | <enter> |
42 | 2 | Mehdi Abaakouk | <enter> |
43 | 2 | Mehdi Abaakouk | <enter> |
44 | 2 | Mehdi Abaakouk | <enter> |
45 | 2 | Mehdi Abaakouk | w |
46 | 2 | Mehdi Abaakouk | |
47 | 2 | Mehdi Abaakouk | $ partprobe |
48 | 7 | Mehdi Abaakouk | </pre> |
49 | 7 | Mehdi Abaakouk | |
50 | 7 | Mehdi Abaakouk | Ubuntu (GPT format): |
51 | 7 | Mehdi Abaakouk | <pre> |
52 | 7 | Mehdi Abaakouk | # parted /dev/sdb |
53 | 7 | Mehdi Abaakouk | GNU Parted 2.3 |
54 | 7 | Mehdi Abaakouk | Using /dev/sdb |
55 | 7 | Mehdi Abaakouk | Welcome to GNU Parted! Type 'help' to view a list of commands. |
56 | 7 | Mehdi Abaakouk | (parted) print |
57 | 7 | Mehdi Abaakouk | Model: ATA SAMSUNG MZ7KM480 (scsi) |
58 | 7 | Mehdi Abaakouk | Disk /dev/sdb: 480GB |
59 | 7 | Mehdi Abaakouk | Sector size (logical/physical): 512B/512B |
60 | 7 | Mehdi Abaakouk | Partition Table: msdos |
61 | 7 | Mehdi Abaakouk | |
62 | 7 | Mehdi Abaakouk | Number Start End Size Type File system Flags |
63 | 7 | Mehdi Abaakouk | 1 1049kB 20.0GB 20.0GB primary ext4 boot |
64 | 7 | Mehdi Abaakouk | 2 20.0GB 36.0GB 16.0GB primary linux-swap(v1) |
65 | 7 | Mehdi Abaakouk | |
66 | 7 | Mehdi Abaakouk | (parted) mkpart |
67 | 7 | Mehdi Abaakouk | Partition type? primary/extended? |
68 | 7 | Mehdi Abaakouk | Partition type? primary/extended? primary |
69 | 7 | Mehdi Abaakouk | File system type? [ext2]? xfs |
70 | 7 | Mehdi Abaakouk | Start? |
71 | 7 | Mehdi Abaakouk | Start? 36.0GB |
72 | 7 | Mehdi Abaakouk | End? 100% |
73 | 7 | Mehdi Abaakouk | (parted) print |
74 | 7 | Mehdi Abaakouk | Model: ATA SAMSUNG MZ7KM480 (scsi) |
75 | 7 | Mehdi Abaakouk | Disk /dev/sdb: 480GB |
76 | 7 | Mehdi Abaakouk | Sector size (logical/physical): 512B/512B |
77 | 7 | Mehdi Abaakouk | Partition Table: msdos |
78 | 7 | Mehdi Abaakouk | |
79 | 7 | Mehdi Abaakouk | Number Start End Size Type File system Flags |
80 | 7 | Mehdi Abaakouk | 1 1049kB 20.0GB 20.0GB primary ext4 boot |
81 | 7 | Mehdi Abaakouk | 2 20.0GB 36.0GB 16.0GB primary linux-swap(v1) |
82 | 7 | Mehdi Abaakouk | 3 36.0GB 480GB 444GB primary |
83 | 7 | Mehdi Abaakouk | |
84 | 7 | Mehdi Abaakouk | (parted) quit |
85 | 7 | Mehdi Abaakouk | Information: You may need to update /etc/fstab. |
86 | 2 | Mehdi Abaakouk | </pre> |
87 | 2 | Mehdi Abaakouk | |
88 | 2 | Mehdi Abaakouk | On prepare le disk comme normalement |
89 | 2 | Mehdi Abaakouk | |
90 | 2 | Mehdi Abaakouk | <pre> |
91 | 2 | Mehdi Abaakouk | ceph-disk prepare --fs-type=xfs --cluster-uuid 1fe74663-8dfa-486c-bb80-3bd94c90c967 /dev/sda2 |
92 | 2 | Mehdi Abaakouk | ceph-disk activate /dev/sda2 |
93 | 6 | Mehdi Abaakouk | ceph osd crush add osd.<ID> 0 root=ssd host=g3-ssd |
94 | 2 | Mehdi Abaakouk | </pre> |
95 | 2 | Mehdi Abaakouk | |
96 | 5 | Mehdi Abaakouk | Ensuite, autoriser Ceph à mettre des data dessus: |
97 | 5 | Mehdi Abaakouk | |
98 | 5 | Mehdi Abaakouk | <pre> |
99 | 5 | Mehdi Abaakouk | $ /root/tools/ceph-reweight-osds.sh osd.<ID> |
100 | 5 | Mehdi Abaakouk | </pre> |
101 | 2 | Mehdi Abaakouk | |
102 | 2 | Mehdi Abaakouk | h2. Suppression d'un OSD: |
103 | 2 | Mehdi Abaakouk | |
104 | 2 | Mehdi Abaakouk | <pre> |
105 | 2 | Mehdi Abaakouk | name="osd.2" |
106 | 2 | Mehdi Abaakouk | ceph osd out ${name} |
107 | 3 | Mehdi Abaakouk | stop ceph-osd id=${name#osd.} # ou sous debian: /etc/init.d/ceph stop ${name} |
108 | 2 | Mehdi Abaakouk | ceph osd crush remove ${name} |
109 | 2 | Mehdi Abaakouk | ceph auth del ${name} |
110 | 2 | Mehdi Abaakouk | ceph osd rm ${name} |
111 | 2 | Mehdi Abaakouk | ceph osd tree |
112 | 2 | Mehdi Abaakouk | </pre> |
113 | 2 | Mehdi Abaakouk | |
114 | 2 | Mehdi Abaakouk | |
115 | 1 | Mehdi Abaakouk | h2. Remplacement à froid d'un tier cache: |
116 | 1 | Mehdi Abaakouk | |
117 | 1 | Mehdi Abaakouk | upstream doc: http://docs.ceph.com/docs/master/rados/operations/cache-tiering/ |
118 | 1 | Mehdi Abaakouk | |
119 | 1 | Mehdi Abaakouk | <pre> |
120 | 1 | Mehdi Abaakouk | ceph osd tier cache-mode ec8p2c forward |
121 | 1 | Mehdi Abaakouk | rados -p ec8p2c cache-flush-evict-all |
122 | 1 | Mehdi Abaakouk | ceph osd tier remove-overlay ec8p2 |
123 | 1 | Mehdi Abaakouk | ceph osd tier remove ec8p2 ec8p2c |
124 | 1 | Mehdi Abaakouk | |
125 | 1 | Mehdi Abaakouk | rados rmpool ec8p2c ec8p2c --yes-i-really-really-mean-ita |
126 | 1 | Mehdi Abaakouk | ceph osd pool create ec8p2c 128 128 replicated |
127 | 1 | Mehdi Abaakouk | |
128 | 1 | Mehdi Abaakouk | ceph osd tier add ec8p2 ec8p2c |
129 | 1 | Mehdi Abaakouk | ceph osd tier cache-mode ec8p2c writeback |
130 | 1 | Mehdi Abaakouk | ceph osd tier set-overlay ec8p2 ec8p2c |
131 | 1 | Mehdi Abaakouk | |
132 | 1 | Mehdi Abaakouk | ceph osd pool set ec8p2c size 3 |
133 | 1 | Mehdi Abaakouk | ceph osd pool set ec8p2c min_size 2 |
134 | 1 | Mehdi Abaakouk | ceph osd pool set ec8p2c hit_set_type bloom |
135 | 1 | Mehdi Abaakouk | |
136 | 1 | Mehdi Abaakouk | ceph osd pool set ec8p2c hit_set_count 1 |
137 | 1 | Mehdi Abaakouk | ceph osd pool set ec8p2c hit_set_period 3600 |
138 | 1 | Mehdi Abaakouk | ceph osd pool set ec8p2c target_max_bytes 200000000000 |
139 | 1 | Mehdi Abaakouk | ceph osd pool set ec8p2c target_max_objects 10000000 |
140 | 1 | Mehdi Abaakouk | ceph osd pool set ec8p2c cache_target_dirty_ratio 0.4 |
141 | 1 | Mehdi Abaakouk | ceph osd pool set ec8p2c cache_target_full_ratio 0.8 |
142 | 1 | Mehdi Abaakouk | </pre> |