-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1137 lines (743 loc) · 43.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
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
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
<link rel="mask-icon" href="/images/logo.svg" color="#222">
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
<script id="hexo-configurations">
var NexT = window.NexT || {};
var CONFIG = {"hostname":"reasonduan.github.io","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"right","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
</script>
<meta property="og:type" content="website">
<meta property="og:title" content="Reason's Blog">
<meta property="og:url" content="https://reasonduan.github.io/index.html">
<meta property="og:site_name" content="Reason's Blog">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="Reason Duan">
<meta name="twitter:card" content="summary">
<link rel="canonical" href="https://reasonduan.github.io/">
<script id="page-configurations">
// https://hexo.io/docs/variables.html
CONFIG.page = {
sidebar: "",
isHome : true,
isPost : false,
lang : 'zh-CN'
};
</script>
<title>Reason's Blog</title>
<noscript>
<style>
.use-motion .brand,
.use-motion .menu-item,
.sidebar-inner,
.use-motion .post-block,
.use-motion .pagination,
.use-motion .comments,
.use-motion .post-header,
.use-motion .post-body,
.use-motion .collection-header { opacity: initial; }
.use-motion .site-title,
.use-motion .site-subtitle {
opacity: initial;
top: initial;
}
.use-motion .logo-line-before i { left: initial; }
.use-motion .logo-line-after i { right: initial; }
</style>
</noscript>
</head>
<body itemscope itemtype="http://schema.org/WebPage">
<div class="container use-motion">
<div class="headband"></div>
<header class="header" itemscope itemtype="http://schema.org/WPHeader">
<div class="header-inner"><div class="site-brand-container">
<div class="site-nav-toggle">
<div class="toggle" aria-label="切换导航栏">
<span class="toggle-line toggle-line-first"></span>
<span class="toggle-line toggle-line-middle"></span>
<span class="toggle-line toggle-line-last"></span>
</div>
</div>
<div class="site-meta">
<a href="/" class="brand" rel="start">
<span class="logo-line-before"><i></i></span>
<h1 class="site-title">Reason's Blog</h1>
<span class="logo-line-after"><i></i></span>
</a>
</div>
<div class="site-nav-right">
<div class="toggle popup-trigger">
</div>
</div>
</div>
<nav class="site-nav">
<ul id="menu" class="main-menu menu">
<li class="menu-item menu-item-home">
<a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>
</li>
<li class="menu-item menu-item-tags">
<a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>
</li>
<li class="menu-item menu-item-categories">
<a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>
</li>
<li class="menu-item menu-item-archives">
<a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>
</li>
</ul>
</nav>
</div>
</header>
<div class="back-to-top">
<i class="fa fa-arrow-up"></i>
<span>0%</span>
</div>
<main class="main">
<div class="main-inner">
<div class="content-wrap">
<div class="content index posts-expand">
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://reasonduan.github.io/Kafka/kafka/consumer-rebalance/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="Reason Duan">
<meta itemprop="description" content="">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Reason's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/Kafka/kafka/consumer-rebalance/" class="post-title-link" itemprop="url">kafka consumer rebalanse 问题解答</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2022-05-20 21:25:26" itemprop="dateCreated datePublished" datetime="2022-05-20T21:25:26+08:00">2022-05-20</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2022-05-21 21:29:25" itemprop="dateModified" datetime="2022-05-21T21:29:25+08:00">2022-05-21</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/Kafka/" itemprop="url" rel="index"><span itemprop="name">Kafka</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="Rebalance问题处理"><a href="#Rebalance问题处理" class="headerlink" title="Rebalance问题处理"></a>Rebalance问题处理</h1><p>最近有个项目,过一段时间就出出现如下问题,现象为offset不再提交,但是观察log数据发现数据还有在消费。</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Attempt to heartbeat failed since group is rebalancing</span><br></pre></td></tr></table></figure>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/Kafka/kafka/consumer-rebalance/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://reasonduan.github.io/KafkaConnect/kafka-connect/connect-es/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="Reason Duan">
<meta itemprop="description" content="">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Reason's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/KafkaConnect/kafka-connect/connect-es/" class="post-title-link" itemprop="url">connect-elasticsearch</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2021-09-06 22:25:26 / 修改时间:22:29:23" itemprop="dateCreated datePublished" datetime="2021-09-06T22:25:26+08:00">2021-09-06</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/KafkaConnect/" itemprop="url" rel="index"><span itemprop="name">KafkaConnect</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h2 id="Kafka-Topic-导入ES"><a href="#Kafka-Topic-导入ES" class="headerlink" title="Kafka Topic 导入ES"></a>Kafka Topic 导入ES</h2><p><a target="_blank" rel="noopener" href="https://docs.confluent.io/platform/current/installation/configuration/connect/index.html">Connector 全局配置</a></p>
<p><a target="_blank" rel="noopener" href="https://docs.confluent.io/platform/current/installation/configuration/connect/sink-connect-configs.html">Connector Sink 配置</a></p>
<p><a target="_blank" rel="noopener" href="https://docs.confluent.io/kafka-connect-elasticsearch/current/configuration_options.html">ES Sink 官方参考</a></p>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/KafkaConnect/kafka-connect/connect-es/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://reasonduan.github.io/KafkaConnect/kafka-connect/connect-http/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="Reason Duan">
<meta itemprop="description" content="">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Reason's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/KafkaConnect/kafka-connect/connect-http/" class="post-title-link" itemprop="url">connect-http</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2021-08-28 21:18:00" itemprop="dateCreated datePublished" datetime="2021-08-28T21:18:00+08:00">2021-08-28</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2021-09-06 22:23:21" itemprop="dateModified" datetime="2021-09-06T22:23:21+08:00">2021-09-06</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/KafkaConnect/" itemprop="url" rel="index"><span itemprop="name">KafkaConnect</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="HTTP-Sink-配置"><a href="#HTTP-Sink-配置" class="headerlink" title="HTTP Sink 配置"></a>HTTP Sink 配置</h1><h2 id="最少配置"><a href="#最少配置" class="headerlink" title="最少配置"></a>最少配置</h2><figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">{</span><br><span class="line"> <span class="attr">"connector.class"</span>: <span class="string">"io.confluent.connect.http.HttpSinkConnector"</span>,</span><br><span class="line"> <span class="attr">"http.api.url"</span>: <span class="string">"http://localhost:8288/api/messages"</span>,</span><br><span class="line"> <span class="attr">"request.method"</span>: <span class="string">"POST"</span>,</span><br><span class="line"> <span class="attr">"topics"</span>: <span class="string">"REASON_HTTP"</span>,</span><br><span class="line"> <span class="attr">"tasks.max"</span>: <span class="string">"1"</span>,</span><br><span class="line"> <span class="attr">"request.body.format"</span>: <span class="string">"json"</span>,</span><br><span class="line"> <span class="attr">"confluent.topic.bootstrap.servers"</span>: <span class="string">"localhost:9092"</span>,</span><br><span class="line"> <span class="attr">"key.converter.schemas.enable"</span>: <span class="string">"false"</span>,</span><br><span class="line"> <span class="attr">"value.converter.schemas.enable"</span>: <span class="string">"false"</span>,</span><br><span class="line"> <span class="attr">"key.converter"</span>: <span class="string">"org.apache.kafka.connect.storage.StringConverter"</span>,</span><br><span class="line"> <span class="attr">"value.converter"</span>: <span class="string">"org.apache.kafka.connect.json.JsonConverter"</span></span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/KafkaConnect/kafka-connect/connect-http/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://reasonduan.github.io/ksqldb/ksqldb/%E7%AA%97%E5%8F%A3%E6%80%BB%E7%BB%93/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="Reason Duan">
<meta itemprop="description" content="">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Reason's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/ksqldb/ksqldb/%E7%AA%97%E5%8F%A3%E6%80%BB%E7%BB%93/" class="post-title-link" itemprop="url">窗口总结</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2021-08-28 21:11:40 / 修改时间:21:19:03" itemprop="dateCreated datePublished" datetime="2021-08-28T21:11:40+08:00">2021-08-28</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/ksqldb/" itemprop="url" rel="index"><span itemprop="name">ksqldb</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h2 id="窗口类型"><a href="#窗口类型" class="headerlink" title="窗口类型"></a>窗口类型</h2><ul>
<li><strong>Hopping Window</strong> 固定时间,重叠窗口</li>
<li><strong>Tumbling Window</strong> 固定时间,不重叠,无间隙的滚动窗口</li>
<li><strong>Session Window</strong> 动态大小,不重叠的数据驱动窗口</li>
</ul>
<p><img src="https://docs.ksqldb.io/en/latest/img/ksql-window-aggregation.png" alt="avatar"></p>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/ksqldb/ksqldb/%E7%AA%97%E5%8F%A3%E6%80%BB%E7%BB%93/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://reasonduan.github.io/ksqldb/ksqldb/KSQLDB%20%E7%BB%86%E8%8A%82%E6%95%B4%E7%90%86/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="Reason Duan">
<meta itemprop="description" content="">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Reason's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/ksqldb/ksqldb/KSQLDB%20%E7%BB%86%E8%8A%82%E6%95%B4%E7%90%86/" class="post-title-link" itemprop="url">KSQLDB 细节整理</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2021-08-28 21:08:23 / 修改时间:21:11:10" itemprop="dateCreated datePublished" datetime="2021-08-28T21:08:23+08:00">2021-08-28</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/ksqldb/" itemprop="url" rel="index"><span itemprop="name">ksqldb</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h2 id="除法问题"><a href="#除法问题" class="headerlink" title="除法问题"></a>除法问题</h2><ul>
<li>double 类型除不尽时结果为null</li>
<li>复杂计算时,先乘再除</li>
</ul>
<h2 id="数据处理"><a href="#数据处理" class="headerlink" title="数据处理"></a>数据处理</h2><ul>
<li>如果有多个job同时处理一个大的数据流,可以先对数据流进行清洗,对提升性能有明显效果。</li>
</ul>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/ksqldb/ksqldb/KSQLDB%20%E7%BB%86%E8%8A%82%E6%95%B4%E7%90%86/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://reasonduan.github.io/redis/redis/Sentinel%20%E6%A8%A1%E5%BC%8FCONFIG%E5%91%BD%E4%BB%A4%E8%A2%AB%E4%BF%AE%E6%94%B9/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="Reason Duan">
<meta itemprop="description" content="">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Reason's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/redis/redis/Sentinel%20%E6%A8%A1%E5%BC%8FCONFIG%E5%91%BD%E4%BB%A4%E8%A2%AB%E4%BF%AE%E6%94%B9/" class="post-title-link" itemprop="url">Sentinel模式CONFIG禁用导致异常</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2021-08-24 18:46:42 / 修改时间:19:01:30" itemprop="dateCreated datePublished" datetime="2021-08-24T18:46:42+08:00">2021-08-24</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/redis/" itemprop="url" rel="index"><span itemprop="name">redis</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="场景"><a href="#场景" class="headerlink" title="场景"></a>场景</h1><p>最近公司在做redis规范,其中有一条就是禁用或者重命名CONFIG命令,然后在部署Redis Sentinel的时候也傻乎乎的就把CONFIG命令给重命名了。今天在查看相关文档时,发现sentinel在做节点管理时会使用CONFIG命令。按照这个逻辑,如果重命名CONFIG命令会导致无法实现故障转移。</p>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/redis/redis/Sentinel%20%E6%A8%A1%E5%BC%8FCONFIG%E5%91%BD%E4%BB%A4%E8%A2%AB%E4%BF%AE%E6%94%B9/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://reasonduan.github.io/redis/redis/Redis%E5%AE%89%E5%85%A8%E8%A7%84%E8%8C%83/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="Reason Duan">
<meta itemprop="description" content="">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Reason's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/redis/redis/Redis%E5%AE%89%E5%85%A8%E8%A7%84%E8%8C%83/" class="post-title-link" itemprop="url">Redis机器产线优化</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2021-08-20 21:36:28" itemprop="dateCreated datePublished" datetime="2021-08-20T21:36:28+08:00">2021-08-20</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2021-08-24 19:02:54" itemprop="dateModified" datetime="2021-08-24T19:02:54+08:00">2021-08-24</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/redis/" itemprop="url" rel="index"><span itemprop="name">redis</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>随着公司Redis使用规模越来越大,redis安全也展现出来了,所以我们经过分析研究做出如下总结。</p>
<p><strong>Redis在部署时,需要满足一下条件则会变得更加安全:</strong></p>
<h2 id="禁止root用户启动redis"><a href="#禁止root用户启动redis" class="headerlink" title="禁止root用户启动redis"></a>禁止root用户启动redis</h2><p>为 Redis 服务创建单独的用户和home目录,使用普通用户启动,安全性往往高很多。</p>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/redis/redis/Redis%E5%AE%89%E5%85%A8%E8%A7%84%E8%8C%83/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://reasonduan.github.io/redis/redis/Redis%E4%BA%A7%E7%BA%BF%E9%85%8D%E7%BD%AE/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="Reason Duan">
<meta itemprop="description" content="">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Reason's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/redis/redis/Redis%E4%BA%A7%E7%BA%BF%E9%85%8D%E7%BD%AE/" class="post-title-link" itemprop="url">Redis机器产线优化</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2021-08-20 21:36:28" itemprop="dateCreated datePublished" datetime="2021-08-20T21:36:28+08:00">2021-08-20</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2021-08-24 19:02:59" itemprop="dateModified" datetime="2021-08-24T19:02:59+08:00">2021-08-24</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/redis/" itemprop="url" rel="index"><span itemprop="name">redis</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h2 id="Redis部署机器最佳系统优化实践执行内容"><a href="#Redis部署机器最佳系统优化实践执行内容" class="headerlink" title="Redis部署机器最佳系统优化实践执行内容"></a>Redis部署机器最佳系统优化实践执行内容</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">vi /etc/sysctl.conf</span><br><span class="line">vm.swappiness = 0</span><br><span class="line">vm.overcommit_memory = 1</span><br><span class="line">net.core.somaxconn = 65535</span><br><span class="line">net.core.netdev_max_backlog = 262144</span><br><span class="line"></span><br><span class="line"># 立即生效</span><br><span class="line">sysctl -p</span><br><span class="line"># 查看</span><br><span class="line">cat /proc/sys/vm/overcommit_memory</span><br><span class="line"></span><br><span class="line">vi /etc/rc.local</span><br><span class="line">if test -f /sys/kernel/mm/transparent_hugepage/enabled; then</span><br><span class="line"> echo 'never' > /sys/kernel/mm/transparent_hugepage/enabled</span><br><span class="line">fi</span><br><span class="line">if test -f /sys/kernel/mm/transparent_hugepage/defrag; then</span><br><span class="line"> echo 'never' > /sys/kernel/mm/transparent_hugepage/defrag</span><br><span class="line">fi</span><br><span class="line"></span><br><span class="line">echo never > /sys/kernel/mm/transparent_hugepage/enabled</span><br></pre></td></tr></table></figure>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/redis/redis/Redis%E4%BA%A7%E7%BA%BF%E9%85%8D%E7%BD%AE/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://reasonduan.github.io/docker/docker/Dockerfile%E8%AF%A6%E8%A7%A3/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="Reason Duan">
<meta itemprop="description" content="">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Reason's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/docker/docker/Dockerfile%E8%AF%A6%E8%A7%A3/" class="post-title-link" itemprop="url">Dockerfile详解</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2021-08-17 21:51:21 / 修改时间:21:58:59" itemprop="dateCreated datePublished" datetime="2021-08-17T21:51:21+08:00">2021-08-17</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/docker/" itemprop="url" rel="index"><span itemprop="name">docker</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>Dockerfile是一种文本文档,其中包含用户在命令行上可以调用的所有命令,使用这些命令来组装Image。</p>
<h2 id="最简单的Dockerfile"><a href="#最简单的Dockerfile" class="headerlink" title="最简单的Dockerfile"></a>最简单的Dockerfile</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#Version: 0.01</span></span><br><span class="line">FROM anapsix/alpine-java:8 <span class="comment">#基于哪个镜像</span></span><br><span class="line">MAINTAINER reason.h.duan <span class="comment">#作者</span></span><br><span class="line">RUN mkdir /opt/rest_demo <span class="comment">#创建一个工作目录,不创建不能上传文件到此目录</span></span><br><span class="line">ADD RestDemo.jar /opt/rest_demo <span class="comment">#上传自己的文件</span></span><br><span class="line">ADD start.sh /opt/rest_demo</span><br><span class="line">WORKDIR /opt/rest_demo <span class="comment">#设置工作目录</span></span><br><span class="line">ENTRYPOINT [<span class="string">"./start.sh"</span>] <span class="comment">#设置容器启动执行脚本</span></span><br><span class="line"></span><br></pre></td></tr></table></figure>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/docker/docker/Dockerfile%E8%AF%A6%E8%A7%A3/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://reasonduan.github.io/docker/docker/Docker%E5%A4%9A%E9%98%B6%E6%9E%84%E5%BB%BA/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="Reason Duan">
<meta itemprop="description" content="">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Reason's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/docker/docker/Docker%E5%A4%9A%E9%98%B6%E6%9E%84%E5%BB%BA/" class="post-title-link" itemprop="url">Docker多阶构建</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2021-08-17 21:36:34 / 修改时间:21:55:27" itemprop="dateCreated datePublished" datetime="2021-08-17T21:36:34+08:00">2021-08-17</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/docker/" itemprop="url" rel="index"><span itemprop="name">docker</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>Docker多阶段构建可以在构建镜像时,只使用工具镜像,但是不将工具镜像的内容打包到最终镜像中。这个可以减少镜像的最终大小。</p>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/docker/docker/Docker%E5%A4%9A%E9%98%B6%E6%9E%84%E5%BB%BA/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<nav class="pagination">
<span class="page-number current">1</span><a class="page-number" href="/page/2/">2</a><a class="extend next" rel="next" href="/page/2/"><i class="fa fa-angle-right" aria-label="下一页"></i></a>
</nav>
</div>
<script>
window.addEventListener('tabs:register', () => {
let { activeClass } = CONFIG.comments;
if (CONFIG.comments.storage) {
activeClass = localStorage.getItem('comments_active') || activeClass;
}
if (activeClass) {
let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
if (activeTab) {
activeTab.click();
}
}
});
if (CONFIG.comments.storage) {
window.addEventListener('tabs:click', event => {
if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
let commentClass = event.target.classList[1];
localStorage.setItem('comments_active', commentClass);
});
}
</script>
</div>
<div class="toggle sidebar-toggle">
<span class="toggle-line toggle-line-first"></span>
<span class="toggle-line toggle-line-middle"></span>
<span class="toggle-line toggle-line-last"></span>
</div>
<aside class="sidebar">
<div class="sidebar-inner">
<ul class="sidebar-nav motion-element">
<li class="sidebar-nav-toc">
文章目录
</li>
<li class="sidebar-nav-overview">
站点概览
</li>
</ul>
<!--noindex-->
<div class="post-toc-wrap sidebar-panel">