Management Cluster Ceph » Historique » Version 17
Mehdi Abaakouk, 09/12/2016 16:43
1 | 10 | Mehdi Abaakouk | {{>toc}} |
---|---|---|---|
2 | 1 | Mehdi Abaakouk | |
3 | 10 | Mehdi Abaakouk | h1. Management Cluster Ceph |
4 | 9 | Mehdi Abaakouk | |
5 | 8 | Mehdi Abaakouk | h2. Liens |
6 | 8 | Mehdi Abaakouk | |
7 | 8 | Mehdi Abaakouk | * [[Openstack Management TTNN]] |
8 | 8 | Mehdi Abaakouk | * [[Openstack Setup VM pas dans openstack]] |
9 | 8 | Mehdi Abaakouk | * [[Openstack Installation nouvelle node du cluster]] |
10 | 8 | Mehdi Abaakouk | * [[Openstack Installation TTNN]] |
11 | 8 | Mehdi Abaakouk | * "Openstack tools for ttnn":/projects/git-tetaneutral-net/repository/openstack-tools |
12 | 8 | Mehdi Abaakouk | |
13 | 2 | Mehdi Abaakouk | h2. Ajout d'un OSD classique |
14 | 2 | Mehdi Abaakouk | |
15 | 2 | Mehdi Abaakouk | <pre> |
16 | 11 | Mehdi Abaakouk | $ ceph-disk prepare --zap-disk --cluster-uuid 1fe74663-8dfa-486c-bb80-3bd94c90c967 --fs-type=ext4 /dev/sdX |
17 | 2 | Mehdi Abaakouk | $ smartctl --smart=on /dev/sdX # Pour le monitoring. |
18 | 2 | Mehdi Abaakouk | </pre> |
19 | 2 | Mehdi Abaakouk | |
20 | 17 | Mehdi Abaakouk | Récuperer l'id avec (c'est celui tout en bas pas accroché à l'arbre): |
21 | 17 | Mehdi Abaakouk | |
22 | 17 | Mehdi Abaakouk | <pre> |
23 | 17 | Mehdi Abaakouk | ceph osd tree |
24 | 17 | Mehdi Abaakouk | </pre> |
25 | 17 | Mehdi Abaakouk | |
26 | 2 | Mehdi Abaakouk | Pour un HDD: |
27 | 1 | Mehdi Abaakouk | <pre> |
28 | 17 | Mehdi Abaakouk | $ ceph osd crush add osd.<ID> 0 root=default host=<host> |
29 | 2 | Mehdi Abaakouk | </pre> |
30 | 2 | Mehdi Abaakouk | |
31 | 1 | Mehdi Abaakouk | Pour un SSD: |
32 | 2 | Mehdi Abaakouk | <pre> |
33 | 17 | Mehdi Abaakouk | $ ceph osd crush add osd.<ID> 0 root=ssd host=<host>-ssd |
34 | 2 | Mehdi Abaakouk | </pre> |
35 | 2 | Mehdi Abaakouk | |
36 | 2 | Mehdi Abaakouk | Ensuite, autoriser Ceph à mettre des data dessus: |
37 | 2 | Mehdi Abaakouk | |
38 | 2 | Mehdi Abaakouk | <pre> |
39 | 2 | Mehdi Abaakouk | $ /root/tools/ceph-reweight-osds.sh osd.<ID> |
40 | 2 | Mehdi Abaakouk | </pre> |
41 | 2 | Mehdi Abaakouk | |
42 | 16 | Mehdi Abaakouk | h2. Ajout d'un OSD qui partage le SSD avec l'OS (OBSOLETE PLUS COMPATIBLE AVEC LES FUTURES VERSION DE CEPH) |
43 | 2 | Mehdi Abaakouk | |
44 | 2 | Mehdi Abaakouk | |
45 | 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 |
46 | 2 | Mehdi Abaakouk | mais pour le SSD de tetaneutral qui a aussi l'OS, voici la méthode |
47 | 2 | Mehdi Abaakouk | |
48 | 2 | Mehdi Abaakouk | Création manuelle de la partition de data ceph /dev/sda2 ici |
49 | 7 | Mehdi Abaakouk | |
50 | 7 | Mehdi Abaakouk | Debian (MBR format): |
51 | 2 | Mehdi Abaakouk | <pre> |
52 | 2 | Mehdi Abaakouk | apt-get install partprobe |
53 | 2 | Mehdi Abaakouk | fdisk /dev/sda |
54 | 2 | Mehdi Abaakouk | |
55 | 2 | Mehdi Abaakouk | n |
56 | 2 | Mehdi Abaakouk | p |
57 | 2 | Mehdi Abaakouk | <enter> |
58 | 2 | Mehdi Abaakouk | <enter> |
59 | 2 | Mehdi Abaakouk | <enter> |
60 | 2 | Mehdi Abaakouk | <enter> |
61 | 2 | Mehdi Abaakouk | w |
62 | 2 | Mehdi Abaakouk | |
63 | 2 | Mehdi Abaakouk | $ partprobe |
64 | 7 | Mehdi Abaakouk | </pre> |
65 | 7 | Mehdi Abaakouk | |
66 | 7 | Mehdi Abaakouk | Ubuntu (GPT format): |
67 | 7 | Mehdi Abaakouk | <pre> |
68 | 7 | Mehdi Abaakouk | # parted /dev/sdb |
69 | 7 | Mehdi Abaakouk | GNU Parted 2.3 |
70 | 7 | Mehdi Abaakouk | Using /dev/sdb |
71 | 7 | Mehdi Abaakouk | Welcome to GNU Parted! Type 'help' to view a list of commands. |
72 | 7 | Mehdi Abaakouk | (parted) print |
73 | 7 | Mehdi Abaakouk | Model: ATA SAMSUNG MZ7KM480 (scsi) |
74 | 7 | Mehdi Abaakouk | Disk /dev/sdb: 480GB |
75 | 7 | Mehdi Abaakouk | Sector size (logical/physical): 512B/512B |
76 | 7 | Mehdi Abaakouk | Partition Table: msdos |
77 | 7 | Mehdi Abaakouk | |
78 | 7 | Mehdi Abaakouk | Number Start End Size Type File system Flags |
79 | 7 | Mehdi Abaakouk | 1 1049kB 20.0GB 20.0GB primary ext4 boot |
80 | 7 | Mehdi Abaakouk | 2 20.0GB 36.0GB 16.0GB primary linux-swap(v1) |
81 | 7 | Mehdi Abaakouk | |
82 | 7 | Mehdi Abaakouk | (parted) mkpart |
83 | 7 | Mehdi Abaakouk | Partition type? primary/extended? |
84 | 7 | Mehdi Abaakouk | Partition type? primary/extended? primary |
85 | 7 | Mehdi Abaakouk | File system type? [ext2]? xfs |
86 | 7 | Mehdi Abaakouk | Start? |
87 | 7 | Mehdi Abaakouk | Start? 36.0GB |
88 | 7 | Mehdi Abaakouk | End? 100% |
89 | 7 | Mehdi Abaakouk | (parted) print |
90 | 7 | Mehdi Abaakouk | Model: ATA SAMSUNG MZ7KM480 (scsi) |
91 | 7 | Mehdi Abaakouk | Disk /dev/sdb: 480GB |
92 | 7 | Mehdi Abaakouk | Sector size (logical/physical): 512B/512B |
93 | 7 | Mehdi Abaakouk | Partition Table: msdos |
94 | 7 | Mehdi Abaakouk | |
95 | 7 | Mehdi Abaakouk | Number Start End Size Type File system Flags |
96 | 7 | Mehdi Abaakouk | 1 1049kB 20.0GB 20.0GB primary ext4 boot |
97 | 7 | Mehdi Abaakouk | 2 20.0GB 36.0GB 16.0GB primary linux-swap(v1) |
98 | 7 | Mehdi Abaakouk | 3 36.0GB 480GB 444GB primary |
99 | 7 | Mehdi Abaakouk | |
100 | 7 | Mehdi Abaakouk | (parted) quit |
101 | 7 | Mehdi Abaakouk | Information: You may need to update /etc/fstab. |
102 | 2 | Mehdi Abaakouk | </pre> |
103 | 2 | Mehdi Abaakouk | |
104 | 2 | Mehdi Abaakouk | On prepare le disk comme normalement |
105 | 2 | Mehdi Abaakouk | |
106 | 2 | Mehdi Abaakouk | <pre> |
107 | 12 | Mehdi Abaakouk | ceph-disk prepare --fs-type=ext4 --cluster-uuid 1fe74663-8dfa-486c-bb80-3bd94c90c967 /dev/sda2 |
108 | 2 | Mehdi Abaakouk | ceph-disk activate /dev/sda2 |
109 | 6 | Mehdi Abaakouk | ceph osd crush add osd.<ID> 0 root=ssd host=g3-ssd |
110 | 2 | Mehdi Abaakouk | </pre> |
111 | 2 | Mehdi Abaakouk | |
112 | 5 | Mehdi Abaakouk | Ensuite, autoriser Ceph à mettre des data dessus: |
113 | 5 | Mehdi Abaakouk | |
114 | 5 | Mehdi Abaakouk | <pre> |
115 | 5 | Mehdi Abaakouk | $ /root/tools/ceph-reweight-osds.sh osd.<ID> |
116 | 5 | Mehdi Abaakouk | </pre> |
117 | 2 | Mehdi Abaakouk | |
118 | 14 | Mehdi Abaakouk | h2. Vider un OSD: |
119 | 14 | Mehdi Abaakouk | |
120 | 14 | Mehdi Abaakouk | <pre> |
121 | 14 | Mehdi Abaakouk | vider_osp(){ |
122 | 14 | Mehdi Abaakouk | name="$1" |
123 | 14 | Mehdi Abaakouk | ceph osd out ${name} |
124 | 14 | Mehdi Abaakouk | ceph osd crush reweight ${name} 0 |
125 | 14 | Mehdi Abaakouk | ceph osd reweight ${name} 0 |
126 | 14 | Mehdi Abaakouk | } |
127 | 14 | Mehdi Abaakouk | </pre> |
128 | 14 | Mehdi Abaakouk | |
129 | 2 | Mehdi Abaakouk | h2. Suppression d'un OSD: |
130 | 2 | Mehdi Abaakouk | |
131 | 2 | Mehdi Abaakouk | <pre> |
132 | 13 | Mehdi Abaakouk | remove_osd(){ |
133 | 13 | Mehdi Abaakouk | name="$1" |
134 | 13 | Mehdi Abaakouk | ceph osd out ${name} |
135 | 13 | Mehdi Abaakouk | stop ceph-osd id=${name#osd.} # ou sous debian: /etc/init.d/ceph stop ${name} |
136 | 13 | Mehdi Abaakouk | ceph osd crush remove ${name} |
137 | 13 | Mehdi Abaakouk | ceph auth del ${name} |
138 | 13 | Mehdi Abaakouk | ceph osd rm ${name} |
139 | 13 | Mehdi Abaakouk | ceph osd tree |
140 | 13 | Mehdi Abaakouk | } |
141 | 2 | Mehdi Abaakouk | </pre> |
142 | 2 | Mehdi Abaakouk | |
143 | 15 | Mehdi Abaakouk | h2. Arrêter les IO de recovery: |
144 | 15 | Mehdi Abaakouk | |
145 | 15 | Mehdi Abaakouk | <pre> |
146 | 15 | Mehdi Abaakouk | ceph osd set nobackfill |
147 | 15 | Mehdi Abaakouk | ceph osd set norebalance |
148 | 15 | Mehdi Abaakouk | ceph osd set norecover |
149 | 15 | Mehdi Abaakouk | </pre> |
150 | 15 | Mehdi Abaakouk | |
151 | 1 | Mehdi Abaakouk | h2. Remplacement à froid d'un tier cache: |
152 | 1 | Mehdi Abaakouk | |
153 | 1 | Mehdi Abaakouk | upstream doc: http://docs.ceph.com/docs/master/rados/operations/cache-tiering/ |
154 | 1 | Mehdi Abaakouk | |
155 | 1 | Mehdi Abaakouk | <pre> |
156 | 1 | Mehdi Abaakouk | ceph osd tier cache-mode ec8p2c forward |
157 | 1 | Mehdi Abaakouk | rados -p ec8p2c cache-flush-evict-all |
158 | 1 | Mehdi Abaakouk | ceph osd tier remove-overlay ec8p2 |
159 | 1 | Mehdi Abaakouk | ceph osd tier remove ec8p2 ec8p2c |
160 | 1 | Mehdi Abaakouk | |
161 | 1 | Mehdi Abaakouk | rados rmpool ec8p2c ec8p2c --yes-i-really-really-mean-ita |
162 | 1 | Mehdi Abaakouk | ceph osd pool create ec8p2c 128 128 replicated |
163 | 1 | Mehdi Abaakouk | |
164 | 1 | Mehdi Abaakouk | ceph osd tier add ec8p2 ec8p2c |
165 | 1 | Mehdi Abaakouk | ceph osd tier cache-mode ec8p2c writeback |
166 | 1 | Mehdi Abaakouk | ceph osd tier set-overlay ec8p2 ec8p2c |
167 | 1 | Mehdi Abaakouk | |
168 | 1 | Mehdi Abaakouk | ceph osd pool set ec8p2c size 3 |
169 | 1 | Mehdi Abaakouk | ceph osd pool set ec8p2c min_size 2 |
170 | 1 | Mehdi Abaakouk | ceph osd pool set ec8p2c hit_set_type bloom |
171 | 1 | Mehdi Abaakouk | |
172 | 1 | Mehdi Abaakouk | ceph osd pool set ec8p2c hit_set_count 1 |
173 | 1 | Mehdi Abaakouk | ceph osd pool set ec8p2c hit_set_period 3600 |
174 | 1 | Mehdi Abaakouk | ceph osd pool set ec8p2c target_max_bytes 200000000000 |
175 | 1 | Mehdi Abaakouk | ceph osd pool set ec8p2c target_max_objects 10000000 |
176 | 1 | Mehdi Abaakouk | ceph osd pool set ec8p2c cache_target_dirty_ratio 0.4 |
177 | 1 | Mehdi Abaakouk | ceph osd pool set ec8p2c cache_target_full_ratio 0.8 |
178 | 1 | Mehdi Abaakouk | </pre> |