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