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