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