Skip to content

Commit 7346386

Browse files
添加主备分区说明
1 parent cb09f80 commit 7346386

File tree

4 files changed

+6
-264
lines changed

4 files changed

+6
-264
lines changed

Linux/深入理解Linux内核.adoc

Lines changed: 0 additions & 243 deletions
Original file line numberDiff line numberDiff line change
@@ -169,249 +169,6 @@ image::image-2023-12-24-16-05-50-650.png[]
169169
以上就是计算机进行内存寻址的全过程,当然分页单元的过程主要是软件实现的,这里没有对linux的实现接口进行说明,如果感兴趣的可以下载linux 2.6版本查看,虽然新版本的linux分页单元有改动,但是还是推荐你看下2.6版本的,这个版本的功能实现更加的纯粹,也更容易理解。
170170
****
171171

172-
173-
174-
175-
176-
177-
178-
179-
180-
181-
182-
183-
184-
185-
186-
187-
188-
189-
190-
191-
192-
193-
194-
195-
196-
197-
198-
199-
200-
201-
202-
203-
204-
205-
206-
207-
208-
209-
210-
211-
212-
213-
214-
215-
216-
217-
218-
219-
220-
221-
222-
223-
224-
225-
226-
227-
228-
229-
230-
231-
232-
233-
234-
235-
236-
237-
238-
239-
240-
241-
242-
243-
244-
245-
246-
247-
248-
249-
250-
251-
252-
253-
254-
255-
256-
257-
258-
259-
260-
261-
262-
263-
264-
265-
266-
267-
268-
269-
270-
271-
272-
273-
274-
275-
276-
277-
278-
279-
280-
281-
282-
283-
284-
285-
286-
287-
288-
289-
290-
291-
292-
293-
294-
295-
296-
297-
298-
299-
300-
301-
302-
303-
304-
305-
306-
307-
308-
309-
310-
311-
312-
313-
314-
315-
316-
317-
318-
319-
320-
321-
322-
323-
324-
325-
326-
327-
328-
329-
330-
331-
332-
333-
334-
335-
336-
337-
338-
339-
340-
341-
342-
343-
344-
345-
346-
347-
348-
349-
350-
351-
352-
353-
354-
355-
356-
357-
358-
359-
360-
361-
362-
363-
364-
365-
366-
367-
368-
369-
370-
371-
372-
373-
374-
375-
376-
377-
378-
379-
380-
381-
382-
383-
384-
385-
386-
387-
388-
389-
390-
391-
392-
393-
394-
395-
396-
397-
398-
399-
400-
401-
402-
403-
404-
405-
406-
407-
408-
409-
410-
411-
412-
413-
414-
415172
=== 进程
416173

417174

MQ/kafka.adoc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ image::mq/image-2024-09-24-15-34-08-363.png[]
7373

7474
=== 高可用
7575

76-
高可用说白了就是灾备,如上图如果一个分区所在的broker节点挂了,那么broker里面所有的消息就丢失了,那么消息队列所谓的高可用也就无从谈起。有办法解决吗?渣男都知道多搞几个备胎,身为程序员的你又怎么能不给分区整几个备胎呢?我们可以为每个分区都分配几个备胎,说专业点叫副本(replicas)。因此,每隔分区又被分区Leader和Follower。Leader负责应对
76+
高可用说白了就是灾备,如上图如果一个分区所在的broker节点挂了,那么broker里面所有的消息就丢失了,那么消息队列所谓的高可用也就无从谈起。有办法解决吗?渣男都知道多搞几个备胎,身为程序员的你又怎么能不给分区整几个备胎呢?我们可以为每个分区都分配几个备胎,说专业点叫副本(replicas)。因此,每隔分区又被分区Leader和Follower。Leader负责应对生产者和消费者的读写请求,Follower只管同步Leader的消息。
77+
78+
.主备机分区
79+
image::mq/image-2024-09-24-21-14-51-364.png[]
80+
81+
7782

7883

7984

102 KB
Loading

src/main.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,12 @@
2323
using namespace std;
2424

2525

26-
27-
28-
29-
30-
31-
32-
33-
34-
3526
int main(int argc, char* argv[]) {
3627

3728

3829

3930

4031

41-
char buff[1024] {0};
42-
snprintf(buff, sizeof(buff), "%s%s%s", "mc%%consumer", "_", "test");
43-
printf("buff = %s\n", buff);
44-
45-
46-
47-
//
48-
49-
50-
51-
5232

5333

5434

0 commit comments

Comments
 (0)