-
Notifications
You must be signed in to change notification settings - Fork 1
/
atom.xml
506 lines (297 loc) · 178 KB
/
atom.xml
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
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>DongSheng's Blog</title>
<icon>https://www.gravatar.com/avatar/2e394ffb56f8f004acd7419b61a7c933</icon>
<subtitle>记录点滴,不断突破</subtitle>
<link href="/atom.xml" rel="self"/>
<link href="https://mds1455975151.github.io/"/>
<updated>2023-08-07T23:55:17.563Z</updated>
<id>https://mds1455975151.github.io/</id>
<author>
<name>DongSheng</name>
<email>[email protected]</email>
</author>
<generator uri="http://hexo.io/">Hexo</generator>
<entry>
<title>ingress-nginx问题记录</title>
<link href="https://mds1455975151.github.io/archives/9d0802cc.html"/>
<id>https://mds1455975151.github.io/archives/9d0802cc.html</id>
<published>2023-08-07T11:31:05.000Z</published>
<updated>2023-08-07T23:55:17.563Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><blockquote><p>ingress-nginx问题记录</p></blockquote><a id="more"></a><h1 id="proxy-body-size参数修改"><a href="#proxy-body-size参数修改" class="headerlink" title="proxy-body-size参数修改"></a>proxy-body-size参数修改</h1><h1 id="TCP4层转发配置"><a href="#TCP4层转发配置" class="headerlink" title="TCP4层转发配置"></a>TCP4层转发配置</h1><h1 id="POD内应用程序获取用户真实IP"><a href="#POD内应用程序获取用户真实IP" class="headerlink" title="POD内应用程序获取用户真实IP"></a>POD内应用程序获取用户真实IP</h1><figure class="highlight plain"><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">kind: ConfigMap</span><br><span class="line">apiVersion: v1</span><br><span class="line">metadata:</span><br><span class="line"> name: nginx-configuration</span><br><span class="line">data:</span><br><span class="line"> enable-underscores-in-headers: "true" # 是否在标题名称中启用下划线, 缺省默认为off,表示如果请求中header name中包含下划线,则忽略掉不会传递到后端代理或者应用程序,即获取不到该Header</span><br><span class="line"> compute-full-forwarded-for: 'true' # 将remote address附加到X-Forwarded-For Header而不是替换它。当启用此选项后端应用程序负责根据自己的受信任代理列表排除并提取客户端 IP。</span><br><span class="line"> use-forwarded-headers: 'true'</span><br><span class="line"> use-proxy-protocol: 'true'</span><br><span class="line"> forwarded-for-header: X-Forwarded-For # 用于设置标识客户端的原始IP地址的字段,默认: X-Forwarded-For</span><br><span class="line"> # enable-real-ip:</span><br><span class="line"> # proxy-real-ip-cidr:</span><br><span class="line"> # http-snippet: |</span><br><span class="line"> # real_ip_header X-Forwarded-For;</span><br><span class="line"> # set_real_ip_from 0.0.0.0/0;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">修改ingress-nginx的service的配置</span><br><span class="line">externalTrafficPolicy: Local (由Cluster改为Local)</span><br></pre></td></tr></table></figure><h1 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h1><ul><li><a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#use-forwarded-headers" target="_blank" rel="noopener">ingress官方文档</a></li><li><a href="https://help.aliyun.com/zh/ack/ack-managed-and-ack-dedicated/support/troubleshooting-nginx-ingress-exceptions" target="_blank" rel="noopener">阿里云Nginx Ingress异常问题排查</a></li></ul><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a></li><li><a href="https://www.toutiao.com/c/user/3916271538/#mid=1560038863835138" target="_blank" rel="noopener">今日头条</a></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/undefined.html">https://mds1455975151.github.io/archives/undefined.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
<blockquote><p>ingress-nginx问题记录</p></blockquote>
</summary>
</entry>
<entry>
<title>Prometheus监控之API接口实践</title>
<link href="https://mds1455975151.github.io/archives/94ebcc6.html"/>
<id>https://mds1455975151.github.io/archives/94ebcc6.html</id>
<published>2023-07-31T00:34:19.000Z</published>
<updated>2023-07-31T01:22:10.305Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><blockquote><p>Prometheus提供了一组API促进自动化和其他系统集成。</p></blockquote><a id="more"></a><h1 id="概述"><a href="#概述" class="headerlink" title="概述"></a>概述</h1><p>Prometheus提供了两类接口,一类是管理Prometheus实例的操作,例如健康检查、就绪检查、加载配置及退出。第二类则是对Prometheus数据的操作,包括增删改查4大大类。</p><p>接口能做什么?例如: 监控数据自动备份、统计Prometheus实例信息、监控完整性检查、资源利用率系统数据来源等等</p><h1 id="API接口"><a href="#API接口" class="headerlink" title="API接口"></a>API接口</h1><h2 id="查询接口"><a href="#查询接口" class="headerlink" title="查询接口"></a>查询接口</h2><figure class="highlight plain"><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><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br></pre></td><td class="code"><pre><span class="line"># Instant queries</span><br><span class="line">GET /api/v1/query</span><br><span class="line">POST /api/v1/query</span><br><span class="line"></span><br><span class="line"># Range queries</span><br><span class="line">GET /api/v1/query_range</span><br><span class="line">POST /api/v1/query_range</span><br><span class="line"></span><br><span class="line"># Formatting query expressions</span><br><span class="line">GET /api/v1/format_query</span><br><span class="line">POST /api/v1/format_query</span><br><span class="line"></span><br><span class="line"># Querying metadata</span><br><span class="line">GET /api/v1/series</span><br><span class="line">POST /api/v1/series</span><br><span class="line"></span><br><span class="line">GET /api/v1/labels</span><br><span class="line">POST /api/v1/labels</span><br><span class="line"></span><br><span class="line">GET /api/v1/label/<label_name>/values</span><br><span class="line"></span><br><span class="line">GET /api/v1/query_exemplars</span><br><span class="line">POST /api/v1/query_exemplars</span><br><span class="line"></span><br><span class="line"># Targets</span><br><span class="line">GET /api/v1/targets</span><br><span class="line"></span><br><span class="line"># Rules</span><br><span class="line">GET /api/v1/rules</span><br><span class="line"></span><br><span class="line"># Alerts</span><br><span class="line">GET /api/v1/alerts</span><br><span class="line"></span><br><span class="line"># Querying target metadata</span><br><span class="line">GET /api/v1/targets/metadata</span><br><span class="line"></span><br><span class="line"># Querying metric metadata</span><br><span class="line">GET /api/v1/metadata</span><br><span class="line"></span><br><span class="line"># Alertmanagers</span><br><span class="line">GET /api/v1/alertmanagers</span><br><span class="line"></span><br><span class="line"># Status</span><br><span class="line"># Config</span><br><span class="line">GET /api/v1/status/config</span><br><span class="line"></span><br><span class="line"># Flags</span><br><span class="line">GET /api/v1/status/flags</span><br><span class="line"></span><br><span class="line"># Runtime Information</span><br><span class="line">GET /api/v1/status/runtimeinfo</span><br><span class="line"></span><br><span class="line"># Build Information</span><br><span class="line">GET /api/v1/status/buildinfo</span><br><span class="line"></span><br><span class="line"># TSDB Stats</span><br><span class="line">GET /api/v1/status/tsdb</span><br><span class="line"></span><br><span class="line"># WAL Replay Stats</span><br><span class="line">GET /api/v1/status/walreplay</span><br><span class="line"></span><br><span class="line"># Snapshot</span><br><span class="line">POST /api/v1/admin/tsdb/snapshot</span><br><span class="line">PUT /api/v1/admin/tsdb/snapshot</span><br><span class="line"></span><br><span class="line"># Delete Series</span><br><span class="line">POST /api/v1/admin/tsdb/delete_series</span><br><span class="line">PUT /api/v1/admin/tsdb/delete_series</span><br><span class="line"></span><br><span class="line"># Clean Tombstones</span><br><span class="line">POST /api/v1/admin/tsdb/clean_tombstones</span><br><span class="line">PUT /api/v1/admin/tsdb/clean_tombstones</span><br><span class="line"></span><br><span class="line"># Remote Write Receiver(依赖配置--web.enable-remote-write-receiver)</span><br><span class="line">/api/v1/write</span><br></pre></td></tr></table></figure><h2 id="管理接口"><a href="#管理接口" class="headerlink" title="管理接口"></a>管理接口</h2><figure class="highlight plain"><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></pre></td><td class="code"><pre><span class="line"># 健康检查Health check</span><br><span class="line">GET /-/healthy</span><br><span class="line">HEAD /-/healthy</span><br><span class="line"></span><br><span class="line"># 就绪检查Readiness check</span><br><span class="line">GET /-/ready</span><br><span class="line">HEAD /-/ready</span><br><span class="line"></span><br><span class="line"># 重新加载配置Reload(依赖配置--web.enable-lifecycle)</span><br><span class="line">PUT /-/reload</span><br><span class="line">POST /-/reload</span><br><span class="line"></span><br><span class="line"># 退出Quit(依赖配置--web.enable-lifecycle)</span><br><span class="line">PUT /-/quit</span><br><span class="line">POST /-/quit</span><br></pre></td></tr></table></figure><h1 id="接口实践"><a href="#接口实践" class="headerlink" title="接口实践"></a>接口实践</h1><blockquote><p>利用监控接口实现Prometheus实例信息监控</p></blockquote><p><img src="/archives/94ebcc6/01.jpg" alt></p><h1 id="参照资料"><a href="#参照资料" class="headerlink" title="参照资料"></a>参照资料</h1><ul><li><a href="https://prometheus.io/docs/prometheus/latest/querying/api/" target="_blank" rel="noopener">https://prometheus.io/docs/prometheus/latest/querying/api/</a></li><li><a href="https://prometheus.io/docs/prometheus/latest/management_api/" target="_blank" rel="noopener">https://prometheus.io/docs/prometheus/latest/management_api/</a></li></ul><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a></li><li><a href="https://www.toutiao.com/c/user/3916271538/#mid=1560038863835138" target="_blank" rel="noopener">今日头条</a></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/94ebcc6.html">https://mds1455975151.github.io/archives/94ebcc6.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
<blockquote><p>Prometheus提供了一组API促进自动化和其他系统集成。</p></blockquote>
</summary>
<category term="Prometheus" scheme="https://mds1455975151.github.io/tags/Prometheus/"/>
<category term="Thanos" scheme="https://mds1455975151.github.io/tags/Thanos/"/>
<category term="API" scheme="https://mds1455975151.github.io/tags/API/"/>
</entry>
<entry>
<title>容器化案例四:Java服务容器化</title>
<link href="https://mds1455975151.github.io/archives/bc1fe45c.html"/>
<id>https://mds1455975151.github.io/archives/bc1fe45c.html</id>
<published>2023-07-26T00:31:56.000Z</published>
<updated>2023-07-26T04:17:02.239Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><blockquote><p>包括Springboot,Dubbo,Tomcat三个类型</p></blockquote><a id="more"></a><h1 id="编译"><a href="#编译" class="headerlink" title="编译"></a>编译</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mvn clean package -Dmaven.test.skip=true -T 1C -Dmaven.compile.fork=true -P production --settings /root/.m2/settings.xml</span><br></pre></td></tr></table></figure><h1 id="Dockerfile文件编写"><a href="#Dockerfile文件编写" class="headerlink" title="Dockerfile文件编写"></a>Dockerfile文件编写</h1><figure class="highlight plain"><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">FROM harbor.k8s.xxx.com/iflow_public/java-app:oraclejdk-8u321-jre-alpine-1.0.61</span><br><span class="line"></span><br><span class="line">COPY ./target/*.gz /data/source/</span><br><span class="line"></span><br><span class="line">ENV JAVA_OPTS="-XX:ActiveProcessorCount=2 -XX:MaxRAMPercentage=75.0 -XX:InitialRAMPercentage=75.0 -XX:MinRAMPercentage=75.0 -XX:+DisableExplicitGC -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses -XX:+CMSClassUnloadingEnabled -XX:+ParallelRefProcEnabled -XX:+CMSScavengeBeforeRemark -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCDateStamps -XX:ErrorFile=/data/var/log/hs_err_pid%p.log -XX:HeapDumpPath=/data/var/log/ -Xloggc:/data/var/log/gc%t.log -XX:+PrintGC -XX:+CMSParallelRemarkEnabled -XX:LargePageSizeInBytes=128m -XX:MaxTenuringThreshold=15 -XX:SurvivorRatio=6 -Dfile.encoding=UTF-8"</span><br><span class="line"></span><br><span class="line">ENV START_CLASS="com.xxx.aigc.plateform.PlateformApplication"</span><br><span class="line"></span><br><span class="line">ENV ENABLE_PP_AGENT="1"</span><br><span class="line">ENV PP_AGENT_PATH="/usr/local/pinpoint-agent2"</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">CMD [ "sh", "-c", "start_app.sh" ]</span><br></pre></td></tr></table></figure><h1 id="Deployment及Service文件编写"><a href="#Deployment及Service文件编写" class="headerlink" title="Deployment及Service文件编写"></a>Deployment及Service文件编写</h1><figure class="highlight plain"><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><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br></pre></td><td class="code"><pre><span class="line">{{$MODULE := "serve" }}</span><br><span class="line">{{$TRUE_APP_NAME := (printf "%v-%v" .Env.FLOW_STANDARD_NAME $MODULE)}}</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">---</span><br><span class="line">apiVersion: apps/v1</span><br><span class="line">kind: Deployment</span><br><span class="line">metadata:</span><br><span class="line"> name: {{$TRUE_APP_NAME}}-deploy</span><br><span class="line"> labels:</span><br><span class="line"> rd: {{.Env.CMP_RD}}</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> project-name: {{.Env.FLOW_PROJECT_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line">spec:</span><br><span class="line"> replicas: {{if eq .Env.FLOW_DIST_ENV "pre"}}1{{else}}1{{end}}</span><br><span class="line"> selector:</span><br><span class="line"> matchLabels:</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> project-name: {{.Env.FLOW_PROJECT_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line"> template:</span><br><span class="line"> metadata:</span><br><span class="line"> annotations:</span><br><span class="line"> alibabacloud.com/burst-resource: eci</span><br><span class="line"> labels:</span><br><span class="line"> rd: {{.Env.CMP_RD}}</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> project-name: {{.Env.FLOW_PROJECT_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line"> spec:</span><br><span class="line"> dnsConfig:</span><br><span class="line"> options:</span><br><span class="line"> - name: ndots</span><br><span class="line"> value: "3"</span><br><span class="line"> imagePullSecrets:</span><br><span class="line"> - name: harbor-registry</span><br><span class="line"> containers:</span><br><span class="line"> - name: serve</span><br><span class="line"> image: {{.Env.IMAGE_NAME}}</span><br><span class="line"> imagePullPolicy: Always</span><br><span class="line"> startupProbe:</span><br><span class="line"> tcpSocket:</span><br><span class="line"> port: 8080</span><br><span class="line"> initialDelaySeconds: 15</span><br><span class="line"> periodSeconds: 10</span><br><span class="line"> timeoutSeconds: 1</span><br><span class="line"> successThreshold: 1</span><br><span class="line"> failureThreshold: 30</span><br><span class="line"> livenessProbe:</span><br><span class="line"> tcpSocket:</span><br><span class="line"> port: 8080</span><br><span class="line"> initialDelaySeconds: 10</span><br><span class="line"> periodSeconds: 10</span><br><span class="line"> timeoutSeconds: 1</span><br><span class="line"> successThreshold: 1</span><br><span class="line"> failureThreshold: 15</span><br><span class="line"> env:</span><br><span class="line"> - name: JAVA_APP_OPTS</span><br><span class="line"> value: {{if eq .Env.FLOW_DIST_ENV "pre"}}"-Denv=PRO -Didc=pre"{{else}}"-Denv=PRO"{{end}}</span><br><span class="line"> - name: ENABLE_PP_AGENT</span><br><span class="line"> value: {{if eq .Env.FLOW_DIST_ENV "pre"}}"0"{{else}}"1"{{end}}</span><br><span class="line"> resources:</span><br><span class="line"> limits:</span><br><span class="line"> cpu: 200m</span><br><span class="line"> memory: 4094Mi</span><br><span class="line"> requests:</span><br><span class="line"> cpu: 100m</span><br><span class="line"> memory: 2048Mi</span><br><span class="line"> ports:</span><br><span class="line"> - containerPort: {{.Env.CMP_PORT}}</span><br><span class="line"> name: web</span><br><span class="line"> protocol: TCP</span><br><span class="line"> volumeMounts:</span><br><span class="line"> - name: logs</span><br><span class="line"> mountPath: /tmp/log</span><br><span class="line"> - name: filebeat-data</span><br><span class="line"> mountPath: /data/var/log</span><br><span class="line"> - name: filebeat-sidecar</span><br><span class="line"> image: harbor.k8s.xxx.com/iflow/custom-filebeat:7.10.1-5</span><br><span class="line"> resources:</span><br><span class="line"> limits:</span><br><span class="line"> cpu: 50m</span><br><span class="line"> memory: "100Mi"</span><br><span class="line"> requests:</span><br><span class="line"> cpu: 50m</span><br><span class="line"> memory: "100Mi"</span><br><span class="line"> volumeMounts:</span><br><span class="line"> - name: logs</span><br><span class="line"> mountPath: /tmp/log</span><br><span class="line"> - name: filebeat-data</span><br><span class="line"> mountPath: /data/var/log</span><br><span class="line"> volumes:</span><br><span class="line"> - name: logs</span><br><span class="line"> emptyDir: {}</span><br><span class="line"> - name: filebeat-data</span><br><span class="line"> emptyDir: {}</span><br><span class="line">...</span><br><span class="line">---</span><br><span class="line">apiVersion: v1</span><br><span class="line">kind: Service</span><br><span class="line">metadata:</span><br><span class="line"> name: {{$TRUE_APP_NAME}}-svc</span><br><span class="line"> labels:</span><br><span class="line"> rd: {{.Env.CMP_RD}}</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line">spec:</span><br><span class="line"> type: ClusterIP</span><br><span class="line"> selector:</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line"> ports:</span><br><span class="line"> - name: web</span><br><span class="line"> protocol: TCP</span><br><span class="line"> port: {{.Env.CMP_PORT}}</span><br><span class="line"> targetPort: {{.Env.CMP_PORT}}</span><br><span class="line">...</span><br></pre></td></tr></table></figure><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a></li><li><a href="https://www.toutiao.com/c/user/3916271538/#mid=1560038863835138" target="_blank" rel="noopener">今日头条</a></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/bc1fe45c.html">https://mds1455975151.github.io/archives/bc1fe45c.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
Java项目容器化
</summary>
<category term="Kubernetes" scheme="https://mds1455975151.github.io/tags/Kubernetes/"/>
<category term="容器化" scheme="https://mds1455975151.github.io/tags/%E5%AE%B9%E5%99%A8%E5%8C%96/"/>
<category term="Java" scheme="https://mds1455975151.github.io/tags/Java/"/>
<category term="Springboot" scheme="https://mds1455975151.github.io/tags/Springboot/"/>
<category term="Dubbo" scheme="https://mds1455975151.github.io/tags/Dubbo/"/>
</entry>
<entry>
<title>容器化案例三:NodeJS服务容器化</title>
<link href="https://mds1455975151.github.io/archives/76a112a5.html"/>
<id>https://mds1455975151.github.io/archives/76a112a5.html</id>
<published>2023-07-25T13:10:05.000Z</published>
<updated>2023-07-25T23:59:32.939Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><blockquote><p>公司部分教研、课件服务使用Nodejs实现,这篇文章记录相关服务容器化内容。</p></blockquote><a id="more"></a><h1 id="编译打包"><a href="#编译打包" class="headerlink" title="编译打包"></a>编译打包</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install</span><br></pre></td></tr></table></figure><h1 id="Dockerfile文件编写"><a href="#Dockerfile文件编写" class="headerlink" title="Dockerfile文件编写"></a>Dockerfile文件编写</h1><figure class="highlight plain"><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></pre></td><td class="code"><pre><span class="line">FROM harbor.k8s.xxx.com/iflow_public/slide:node-pdf.1.0.6</span><br><span class="line"></span><br><span class="line">ADD ./target.tar.gz /data/source/node-pdf</span><br><span class="line"></span><br><span class="line">RUN echo '127.0.0.1 local.xxx.com' >> /etc/hosts</span><br><span class="line"></span><br><span class="line">WORKDIR /data/source/node-pdf</span><br></pre></td></tr></table></figure><h1 id="Deployment及Service文件编写"><a href="#Deployment及Service文件编写" class="headerlink" title="Deployment及Service文件编写"></a>Deployment及Service文件编写</h1><figure class="highlight plain"><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><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br></pre></td><td class="code"><pre><span class="line">{{$MODULE := "serve" }}</span><br><span class="line">{{$TRUE_APP_NAME := (printf "%v-%v" .Env.FLOW_STANDARD_NAME $MODULE)}}</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">---</span><br><span class="line">apiVersion: apps/v1</span><br><span class="line">kind: Deployment</span><br><span class="line">metadata:</span><br><span class="line"> name: {{$TRUE_APP_NAME}}-deploy</span><br><span class="line"> labels:</span><br><span class="line"> rd: {{.Env.CMP_RD}}</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> project-name: {{.Env.FLOW_PROJECT_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line">spec:</span><br><span class="line"> replicas: {{if eq .Env.FLOW_DIST_ENV "pre"}}1{{else}}2{{end}}</span><br><span class="line"> selector:</span><br><span class="line"> matchLabels:</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> project-name: {{.Env.FLOW_PROJECT_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line"> template:</span><br><span class="line"> metadata:</span><br><span class="line"> annotations:</span><br><span class="line"> alibabacloud.com/burst-resource: eci</span><br><span class="line"> labels:</span><br><span class="line"> rd: {{.Env.CMP_RD}}</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> project-name: {{.Env.FLOW_PROJECT_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line"> spec:</span><br><span class="line"> dnsConfig:</span><br><span class="line"> options:</span><br><span class="line"> - name: ndots</span><br><span class="line"> value: "3"</span><br><span class="line"> imagePullSecrets:</span><br><span class="line"> - name: harbor-registry</span><br><span class="line"> containers:</span><br><span class="line"> - name: serve</span><br><span class="line"> startupProbe:</span><br><span class="line"> tcpSocket:</span><br><span class="line"> port: {{.Env.CMP_PORT}}</span><br><span class="line"> initialDelaySeconds: 15</span><br><span class="line"> periodSeconds: 10</span><br><span class="line"> timeoutSeconds: 1</span><br><span class="line"> successThreshold: 1</span><br><span class="line"> failureThreshold: 30</span><br><span class="line"> livenessProbe:</span><br><span class="line"> tcpSocket:</span><br><span class="line"> port: {{.Env.CMP_PORT}}</span><br><span class="line"> initialDelaySeconds: 10</span><br><span class="line"> periodSeconds: 10</span><br><span class="line"> timeoutSeconds: 1</span><br><span class="line"> successThreshold: 1</span><br><span class="line"> failureThreshold: 15</span><br><span class="line"> ports:</span><br><span class="line"> - containerPort: {{.Env.CMP_PORT}}</span><br><span class="line"> name: web</span><br><span class="line"> protocol: TCP</span><br><span class="line"> volumeMounts:</span><br><span class="line"> - name: logs</span><br><span class="line"> mountPath: /tmp/log</span><br><span class="line"> - name: filebeat-data</span><br><span class="line"> mountPath: /data/var/log</span><br><span class="line"> image: {{.Env.IMAGE_NAME}}</span><br><span class="line"> imagePullPolicy: Always</span><br><span class="line"> command: ["sh", "-c", "pm2-runtime start src/index.js"]</span><br><span class="line"> resources:</span><br><span class="line"> limits:</span><br><span class="line"> cpu: 1000m</span><br><span class="line"> memory: 2048Mi</span><br><span class="line"> requests:</span><br><span class="line"> cpu: 70m</span><br><span class="line"> memory: 512Mi</span><br><span class="line"> env:</span><br><span class="line"> - name: TZ</span><br><span class="line"> value: Asia/Shanghai</span><br><span class="line"> - name: NODE_ENV</span><br><span class="line"> value: {{if eq .Env.FLOW_DIST_ENV "prod"}}"prod"{{else}}"prod"{{end}}</span><br><span class="line"> - name: filebeat-sidecar</span><br><span class="line"> image: harbor.k8s.xxx.com/iflow/custom-filebeat:7.10.1-5</span><br><span class="line"> resources:</span><br><span class="line"> limits:</span><br><span class="line"> memory: "200Mi"</span><br><span class="line"> requests:</span><br><span class="line"> memory: "50Mi"</span><br><span class="line"> volumeMounts:</span><br><span class="line"> - name: logs</span><br><span class="line"> mountPath: /tmp/log</span><br><span class="line"> - name: filebeat-data</span><br><span class="line"> mountPath: /data/var/log</span><br><span class="line"> volumes:</span><br><span class="line"> - name: logs</span><br><span class="line"> emptyDir: {}</span><br><span class="line"> - name: filebeat-data</span><br><span class="line"> emptyDir: {}</span><br><span class="line">...</span><br><span class="line"></span><br><span class="line">---</span><br><span class="line">apiVersion: v1</span><br><span class="line">kind: Service</span><br><span class="line">metadata:</span><br><span class="line"> name: {{$TRUE_APP_NAME}}-svc</span><br><span class="line"> labels:</span><br><span class="line"> rd: {{.Env.CMP_RD}}</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line">spec:</span><br><span class="line"> type: ClusterIP</span><br><span class="line"> selector:</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line"> ports:</span><br><span class="line"> - name: web</span><br><span class="line"> protocol: TCP</span><br><span class="line"> port: {{.Env.CMP_PORT}}</span><br><span class="line"> targetPort: {{.Env.CMP_PORT}}</span><br></pre></td></tr></table></figure><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a></li><li><a href="https://www.toutiao.com/c/user/3916271538/#mid=1560038863835138" target="_blank" rel="noopener">今日头条</a></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/76a112a5.html">https://mds1455975151.github.io/archives/76a112a5.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
<blockquote><p>公司部分教研、课件服务使用Nodejs实现,这篇文章记录相关服务容器化内容。</p></blockquote>
</summary>
<category term="NodeJS项目容器化" scheme="https://mds1455975151.github.io/categories/NodeJS%E9%A1%B9%E7%9B%AE%E5%AE%B9%E5%99%A8%E5%8C%96/"/>
<category term="Kubernetes" scheme="https://mds1455975151.github.io/tags/Kubernetes/"/>
<category term="容器化" scheme="https://mds1455975151.github.io/tags/%E5%AE%B9%E5%99%A8%E5%8C%96/"/>
<category term="Nodejs" scheme="https://mds1455975151.github.io/tags/Nodejs/"/>
<category term="pm2" scheme="https://mds1455975151.github.io/tags/pm2/"/>
</entry>
<entry>
<title>容器化案例二:Python服务容器化</title>
<link href="https://mds1455975151.github.io/archives/acd906c.html"/>
<id>https://mds1455975151.github.io/archives/acd906c.html</id>
<published>2023-07-25T11:16:25.000Z</published>
<updated>2023-07-25T11:29:08.730Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><blockquote><p>公司的AI项目和运维项目基本都是Python项目,这里记录下Python项目的容器化知识。</p></blockquote><a id="more"></a><h1 id="Dockerfile文件编写"><a href="#Dockerfile文件编写" class="headerlink" title="Dockerfile文件编写"></a>Dockerfile文件编写</h1><figure class="highlight plain"><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><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br></pre></td><td class="code"><pre><span class="line">FROM python:3.6.8-slim</span><br><span class="line"></span><br><span class="line">LABEL Maintainer="[email protected]" \</span><br><span class="line"> Description="Python Project based on Alpine Linux."</span><br><span class="line"></span><br><span class="line"># Enable unbuffered logging</span><br><span class="line">ENV PYTHONUNBUFFERED=1</span><br><span class="line"></span><br><span class="line"># Enable Profiler</span><br><span class="line">ENV ENABLE_PROFILER=1</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">RUN set -x \</span><br><span class="line"> && echo "deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib" > /etc/apt/sources.list \</span><br><span class="line"> && echo "deb http://mirrors.aliyun.com/debian/ stretch-proposed-updates main non-free contrib" >> /etc/apt/sources.list \</span><br><span class="line"> && echo "deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib" >> /etc/apt/sources.list \</span><br><span class="line"> && echo "deb-src http://mirrors.aliyun.com/debian/ stretch-proposed-updates main non-free contrib" >> /etc/apt/sources.list \</span><br><span class="line"> && apt-get update \</span><br><span class="line"> && apt-get install -y --no-install-recommends --no-install-recommends curl telnet net-tools g++ \</span><br><span class="line"> && rm -rf /var/lib/apt/lists/*</span><br><span class="line"></span><br><span class="line"># get packages</span><br><span class="line">COPY requirements.txt .</span><br><span class="line"></span><br><span class="line">RUN pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com</span><br><span class="line"></span><br><span class="line">RUN pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com</span><br><span class="line"></span><br><span class="line">WORKDIR /data/source/</span><br><span class="line"></span><br><span class="line">COPY . .</span><br><span class="line"></span><br><span class="line">RUN \cp ${project_name}/_settings_prod.py ${project_name}/settings.py</span><br><span class="line"></span><br><span class="line">RUN sed -i '/if query is not None:/d' /usr/local/lib/python3.6/site-packages/django/db/backends/mysql/operations.py && \</span><br><span class="line"> sed -i '/query = query.decode/d' /usr/local/lib/python3.6/site-packages/django/db/backends/mysql/operations.py</span><br><span class="line"></span><br><span class="line">EXPOSE 9999</span><br><span class="line"></span><br><span class="line">ENTRYPOINT [ "python", "manage.py", "runserver","0.0.0.0:9999" ]</span><br></pre></td></tr></table></figure><h1 id="Deployment及Service文件编写"><a href="#Deployment及Service文件编写" class="headerlink" title="Deployment及Service文件编写"></a>Deployment及Service文件编写</h1><figure class="highlight plain"><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><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br></pre></td><td class="code"><pre><span class="line">{{$MODULE := "serve" }}</span><br><span class="line">{{$TRUE_APP_NAME := (printf "%v-%v" .Env.FLOW_STANDARD_NAME $MODULE)}}</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">---</span><br><span class="line">apiVersion: apps/v1</span><br><span class="line">kind: Deployment</span><br><span class="line">metadata:</span><br><span class="line"> name: {{$TRUE_APP_NAME}}-deploy</span><br><span class="line"> labels:</span><br><span class="line"> rd: {{.Env.CMP_RD}}</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> project-name: {{.Env.FLOW_PROJECT_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line">spec:</span><br><span class="line"> replicas: {{.Env.D_STATUS_REPLICAS}}</span><br><span class="line"> selector:</span><br><span class="line"> matchLabels:</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> project-name: {{.Env.FLOW_PROJECT_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line"> template:</span><br><span class="line"> metadata:</span><br><span class="line"> annotations:</span><br><span class="line"> alibabacloud.com/burst-resource: eci</span><br><span class="line"> labels:</span><br><span class="line"> rd: {{.Env.CMP_RD}}</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> project-name: {{.Env.FLOW_PROJECT_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line"> spec:</span><br><span class="line"> dnsConfig:</span><br><span class="line"> options:</span><br><span class="line"> - name: ndots</span><br><span class="line"> value: "3"</span><br><span class="line"> imagePullSecrets:</span><br><span class="line"> - name: harbor-registry</span><br><span class="line"> containers:</span><br><span class="line"> - name: serve</span><br><span class="line"> image: {{.Env.IMAGE_NAME}}</span><br><span class="line"> imagePullPolicy: Always</span><br><span class="line"> readinessProbe:</span><br><span class="line"> tcpSocket:</span><br><span class="line"> port: {{.Env.CMP_PORT}}</span><br><span class="line"> initialDelaySeconds: 15</span><br><span class="line"> periodSeconds: 10</span><br><span class="line"> timeoutSeconds: 1</span><br><span class="line"> successThreshold: 1</span><br><span class="line"> failureThreshold: 30</span><br><span class="line"> env:</span><br><span class="line"> - name: JAVA_APP_OPTS</span><br><span class="line"> value: {{if eq .Env.FLOW_DIST_ENV "pre"}}"-Denv=PRO -Didc=pre"{{else}}"-Denv=PRO"{{end}}</span><br><span class="line"> - name: ENABLE_PP_AGENT</span><br><span class="line"> value: {{if eq .Env.FLOW_DIST_ENV "pre"}}"0"{{else}}"1"{{end}}</span><br><span class="line"> resources:</span><br><span class="line"> limits:</span><br><span class="line"> cpu: 3000m</span><br><span class="line"> memory: 4096Mi</span><br><span class="line"> requests:</span><br><span class="line"> cpu: 2000m</span><br><span class="line"> memory: 2048Mi</span><br><span class="line"> ports:</span><br><span class="line"> - containerPort: {{.Env.CMP_PORT}}</span><br><span class="line"> name: web</span><br><span class="line"> protocol: TCP</span><br><span class="line"> volumeMounts:</span><br><span class="line"> - name: logs</span><br><span class="line"> mountPath: /tmp/log</span><br><span class="line"> - name: xxx</span><br><span class="line"> mountPath: /data/xxx</span><br><span class="line"> volumeMounts:</span><br><span class="line"> - name: logs</span><br><span class="line"> mountPath: /tmp/log</span><br><span class="line"> volumes:</span><br><span class="line"> - name: xxx</span><br><span class="line"> persistentVolumeClaim:</span><br><span class="line"> claimName: xxx</span><br><span class="line"> - name: logs</span><br><span class="line"> emptyDir: {}</span><br><span class="line">...</span><br><span class="line"></span><br><span class="line">---</span><br><span class="line">apiVersion: v1</span><br><span class="line">kind: Service</span><br><span class="line">metadata:</span><br><span class="line"> name: {{$TRUE_APP_NAME}}-svc</span><br><span class="line"> labels:</span><br><span class="line"> rd: {{.Env.CMP_RD}}</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line">spec:</span><br><span class="line"> type: ClusterIP</span><br><span class="line"> selector:</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line"> ports:</span><br><span class="line"> - name: web</span><br><span class="line"> protocol: TCP</span><br><span class="line"> port: {{.Env.CMP_PORT}}</span><br><span class="line"> targetPort: {{.Env.CMP_PORT}}</span><br></pre></td></tr></table></figure><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a></li><li><a href="https://www.toutiao.com/c/user/3916271538/#mid=1560038863835138" target="_blank" rel="noopener">今日头条</a></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/acd906c.html">https://mds1455975151.github.io/archives/acd906c.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
Python项目容器化
</summary>
<category term="Django" scheme="https://mds1455975151.github.io/tags/Django/"/>
<category term="Python" scheme="https://mds1455975151.github.io/tags/Python/"/>
<category term="Kubernetes" scheme="https://mds1455975151.github.io/tags/Kubernetes/"/>
<category term="uwsgi" scheme="https://mds1455975151.github.io/tags/uwsgi/"/>
<category term="容器化" scheme="https://mds1455975151.github.io/tags/%E5%AE%B9%E5%99%A8%E5%8C%96/"/>
</entry>
<entry>
<title>容器化案例一:.NET服务容器化</title>
<link href="https://mds1455975151.github.io/archives/4b774b02.html"/>
<id>https://mds1455975151.github.io/archives/4b774b02.html</id>
<published>2023-07-25T01:05:32.000Z</published>
<updated>2023-07-25T23:52:08.778Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><blockquote><p>公司教研系统、课件系统、截图服务还有一些其他零散的后台管理系统使用.NET服务编写,这篇文章记录相关服务容器化内容。</p></blockquote><a id="more"></a><h1 id="编译打包"><a href="#编译打包" class="headerlink" title="编译打包"></a>编译打包</h1><figure class="highlight plain"><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></pre></td><td class="code"><pre><span class="line">dotnet restore --configfile "NuGet.config" "ContractFile/ContractFile.csproj"</span><br><span class="line">cd ContractFile</span><br><span class="line">dotnet build "ContractFile.csproj" -c Release -o ./app/ContractFile</span><br><span class="line">dotnet publish "ContractFile.csproj" -c Release -o ./app/ContractFile</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">dotnet restore --configfile "NuGet.config" "ContractFile.WorkerService/ContractFile.WorkerService.csproj"</span><br><span class="line">cd ContractFile.WorkerService</span><br><span class="line">dotnet build "ContractFile.WorkerService.csproj" -c Release -o ./app/ContractFile.WorkerService</span><br><span class="line">dotnet publish "ContractFile.WorkerService.csproj" -c Release -o ./app/ContractFile.WorkerService</span><br></pre></td></tr></table></figure><blockquote><p>该项目分多个模块,分别单独部署</p></blockquote><h1 id="Dockerfile文件编写"><a href="#Dockerfile文件编写" class="headerlink" title="Dockerfile文件编写"></a>Dockerfile文件编写</h1><figure class="highlight plain"><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></pre></td><td class="code"><pre><span class="line">FROM harbor.k8s.xxx.com/public/dot_net6.0</span><br><span class="line"></span><br><span class="line">WORKDIR /app</span><br><span class="line"></span><br><span class="line">RUN set -e</span><br><span class="line"></span><br><span class="line">RUN apt-get -y update && \</span><br><span class="line"> apt-get install -y traceroute inetutils-ping telnet net-tools curl</span><br><span class="line"></span><br><span class="line">RUN sed -i 's/TLSv1.2/TLSv1/g' /etc/ssl/openssl.cnf && \</span><br><span class="line"> sed -i 's/DEFAULT@SECLEVEL=2/DEFAULT@SECLEVEL=1/g' /etc/ssl/openssl.cnf</span><br><span class="line"></span><br><span class="line">COPY /AXX_ContractFile/app/AXX_ContractFile /app/</span><br><span class="line"></span><br><span class="line">ENV ASPNETCORE_URLS=http://*:80</span><br><span class="line"></span><br><span class="line">ENTRYPOINT ["dotnet", "ContractFile.dll"]</span><br></pre></td></tr></table></figure><h1 id="deployment文件编写"><a href="#deployment文件编写" class="headerlink" title="deployment文件编写"></a>deployment文件编写</h1><figure class="highlight plain"><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><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br></pre></td><td class="code"><pre><span class="line">{{$MODULE := "contractfileapi" }}</span><br><span class="line">{{$TRUE_APP_NAME := (printf "%v-%v" .Env.FLOW_STANDARD_NAME $MODULE)}}</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">---</span><br><span class="line">apiVersion: apps/v1</span><br><span class="line">kind: Deployment</span><br><span class="line">metadata:</span><br><span class="line"> name: {{$TRUE_APP_NAME}}-deploy</span><br><span class="line"> labels:</span><br><span class="line"> rd: {{.Env.CMP_RD}}</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> project-name: {{.Env.FLOW_PROJECT_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line">spec:</span><br><span class="line"> replicas: {{.Env.D_STATUS_REPLICAS}}</span><br><span class="line"> selector:</span><br><span class="line"> matchLabels:</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> project-name: {{.Env.FLOW_PROJECT_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line"> template:</span><br><span class="line"> metadata:</span><br><span class="line"> annotations:</span><br><span class="line"> alibabacloud.com/burst-resource: eci</span><br><span class="line"> labels:</span><br><span class="line"> rd: {{.Env.CMP_RD}}</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> project-name: {{.Env.FLOW_PROJECT_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line"> spec:</span><br><span class="line"> dnsConfig:</span><br><span class="line"> options:</span><br><span class="line"> - name: ndots</span><br><span class="line"> value: "3"</span><br><span class="line"> imagePullSecrets:</span><br><span class="line"> - name: harbor-registry</span><br><span class="line"> containers:</span><br><span class="line"> - name: serve</span><br><span class="line"> image: {{.Env.IMAGE_NAME}}</span><br><span class="line"> imagePullPolicy: Always</span><br><span class="line"> startupProbe:</span><br><span class="line"> tcpSocket:</span><br><span class="line"> port: {{.Env.CMP_PORT }}</span><br><span class="line"> initialDelaySeconds: 15</span><br><span class="line"> periodSeconds: 10</span><br><span class="line"> timeoutSeconds: 1</span><br><span class="line"> successThreshold: 1</span><br><span class="line"> failureThreshold: 30</span><br><span class="line"> livenessProbe:</span><br><span class="line"> tcpSocket:</span><br><span class="line"> port: {{.Env.CMP_PORT }}</span><br><span class="line"> initialDelaySeconds: 10</span><br><span class="line"> periodSeconds: 10</span><br><span class="line"> timeoutSeconds: 1</span><br><span class="line"> successThreshold: 1</span><br><span class="line"> failureThreshold: 15</span><br><span class="line"> env:</span><br><span class="line"> - name: JAVA_APP_OPTS</span><br><span class="line"> value: {{if eq .Env.FLOW_DIST_ENV "pre"}}"-Denv=PRO -Didc=pre"{{else}}"-Denv=PRO"{{end}}</span><br><span class="line"> - name: ENABLE_PP_AGENT</span><br><span class="line"> value: {{if eq .Env.FLOW_DIST_ENV "pre"}}"0"{{else}}"1"{{end}}</span><br><span class="line"> - name: ASPNETCORE_ENVIRONMENT</span><br><span class="line"> value: {{if eq .Env.FLOW_DIST_ENV "pre"}}"iflowStaging"{{else}}"Production"{{end}}</span><br><span class="line"> resources:</span><br><span class="line"> limits:</span><br><span class="line"> cpu: 1000m</span><br><span class="line"> memory: 2048Mi</span><br><span class="line"> requests:</span><br><span class="line"> cpu: 40m</span><br><span class="line"> memory: 1024Mi</span><br><span class="line"> ports:</span><br><span class="line"> - containerPort: {{.Env.CMP_PORT}}</span><br><span class="line"> name: web</span><br><span class="line"> protocol: TCP</span><br><span class="line"> volumeMounts:</span><br><span class="line"> - name: logs</span><br><span class="line"> mountPath: /tmp/log</span><br><span class="line"> - name: filebeat-data</span><br><span class="line"> mountPath: /data/var/log</span><br><span class="line"></span><br><span class="line"> volumes:</span><br><span class="line"> - name: logs</span><br><span class="line"> persistentVolumeClaim:</span><br><span class="line"> claimName: log-nas</span><br><span class="line"> - name: filebeat-data</span><br><span class="line"> emptyDir: {}</span><br><span class="line">...</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">---</span><br><span class="line">apiVersion: v1</span><br><span class="line">kind: Service</span><br><span class="line">metadata:</span><br><span class="line"> name: {{$TRUE_APP_NAME}}-svc</span><br><span class="line"> labels:</span><br><span class="line"> rd: {{.Env.CMP_RD}}</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line">spec:</span><br><span class="line"> type: ClusterIP</span><br><span class="line"> selector:</span><br><span class="line"> app: {{.Env.FLOW_STANDARD_NAME}}</span><br><span class="line"> module: {{$MODULE}}</span><br><span class="line"> ports:</span><br><span class="line"> - name: web</span><br><span class="line"> protocol: TCP</span><br><span class="line"> port: {{.Env.CMP_PORT}}</span><br><span class="line"> targetPort: {{.Env.CMP_PORT}}</span><br><span class="line">...</span><br></pre></td></tr></table></figure><h1 id="常用的dotnet命令说明"><a href="#常用的dotnet命令说明" class="headerlink" title="常用的dotnet命令说明"></a>常用的dotnet命令说明</h1><figure class="highlight plain"><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></pre></td><td class="code"><pre><span class="line">dotnet new</span><br><span class="line">dotnet test</span><br><span class="line">dotnet clean</span><br><span class="line">dotnet restore 下载依赖</span><br><span class="line">dotnet build 构建</span><br><span class="line">dotnet run 运行</span><br><span class="line">dotnet publish 将应用程序及其依赖项发布到文件夹以部署到托管系统</span><br></pre></td></tr></table></figure><ul><li>所有CLI命令说明: <a href="https://learn.microsoft.com/zh-cn/dotnet/core/tools/" target="_blank" rel="noopener">https://learn.microsoft.com/zh-cn/dotnet/core/tools/</a></li></ul><h1 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h1><ul><li>第一手准确资料<a href="https://docs.microsoft.com/zh-cn/visualstudio/containers/container-build?view=vs-2019&WT.mc_id=visualstudio_containers_aka_containerfastmode" target="_blank" rel="noopener">微软官网</a></li></ul><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a></li><li><a href="https://www.toutiao.com/c/user/3916271538/#mid=1560038863835138" target="_blank" rel="noopener">今日头条</a></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/4b774b02.html">https://mds1455975151.github.io/archives/4b774b02.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
.NET项目容器化
</summary>
<category term="Kubernetes" scheme="https://mds1455975151.github.io/tags/Kubernetes/"/>
<category term=".NET" scheme="https://mds1455975151.github.io/tags/NET/"/>
<category term="Dotnet" scheme="https://mds1455975151.github.io/tags/Dotnet/"/>
<category term="Deployment" scheme="https://mds1455975151.github.io/tags/Deployment/"/>
<category term="Service" scheme="https://mds1455975151.github.io/tags/Service/"/>
<category term="微软" scheme="https://mds1455975151.github.io/tags/%E5%BE%AE%E8%BD%AF/"/>
</entry>
<entry>
<title>多云管理系统建设</title>
<link href="https://mds1455975151.github.io/archives/3f64b2ab.html"/>
<id>https://mds1455975151.github.io/archives/3f64b2ab.html</id>
<published>2023-07-24T01:11:36.000Z</published>
<updated>2023-07-24T02:43:39.627Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><blockquote><p>本文介绍建设一个完整的企业运维系统设计的功能模块思考</p></blockquote><a id="more"></a><p><img src="/archives/3f64b2ab/%E6%82%9F%E7%A9%BA%E5%A4%9A%E4%BA%91%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F.png" alt></p><p>部分系统待更新</p><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a></li><li><a href="https://www.toutiao.com/c/user/3916271538/#mid=1560038863835138" target="_blank" rel="noopener">今日头条</a></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/3f64b2ab.html">https://mds1455975151.github.io/archives/3f64b2ab.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
<blockquote><p>本文介绍建设一个完整的企业运维系统设计的功能模块思考</p></blockquote>
</summary>
</entry>
<entry>
<title>Hexo博客添加文章热度排行页面</title>
<link href="https://mds1455975151.github.io/archives/1814249.html"/>
<id>https://mds1455975151.github.io/archives/1814249.html</id>
<published>2021-10-06T12:57:02.000Z</published>
<updated>2021-10-06T12:58:40.098Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><blockquote></blockquote><a id="more"></a><p><a href="https://blog.garryde.com/archives/48665.html" target="_blank" rel="noopener">参考资料</a></p><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a></li><li><a href="https://www.toutiao.com/c/user/3916271538/#mid=1560038863835138" target="_blank" rel="noopener">今日头条</a></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/1814249.html">https://mds1455975151.github.io/archives/1814249.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
文章热度排行
</summary>
<category term="文章热度排行" scheme="https://mds1455975151.github.io/categories/%E6%96%87%E7%AB%A0%E7%83%AD%E5%BA%A6%E6%8E%92%E8%A1%8C/"/>
<category term="Hexo" scheme="https://mds1455975151.github.io/tags/Hexo/"/>
<category term="Next" scheme="https://mds1455975151.github.io/tags/Next/"/>
<category term="热度" scheme="https://mds1455975151.github.io/tags/%E7%83%AD%E5%BA%A6/"/>
</entry>
<entry>
<title>记一次Kubernetes排查问题记录</title>
<link href="https://mds1455975151.github.io/archives/600c4e5a.html"/>
<id>https://mds1455975151.github.io/archives/600c4e5a.html</id>
<published>2021-09-13T03:54:05.000Z</published>
<updated>2021-09-13T03:54:17.237Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><blockquote></blockquote><a id="more"></a><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a></li><li><a href="https://www.toutiao.com/c/user/3916271538/#mid=1560038863835138" target="_blank" rel="noopener">今日头条</a></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/600c4e5a.html">https://mds1455975151.github.io/archives/600c4e5a.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
<blockquote></blockquote>
</summary>
</entry>
<entry>
<title>GPU基础知识总结</title>
<link href="https://mds1455975151.github.io/archives/4ba15f98.html"/>
<id>https://mds1455975151.github.io/archives/4ba15f98.html</id>
<published>2021-09-05T14:00:02.000Z</published>
<updated>2021-09-05T14:14:06.856Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><blockquote><p>GPU基础知识总结</p></blockquote><a id="more"></a><h1 id="nvidia驱动下载"><a href="#nvidia驱动下载" class="headerlink" title="nvidia驱动下载"></a>nvidia驱动下载</h1><p><a href="https://www.nvidia.com/Download/Find.aspx" target="_blank" rel="noopener">https://www.nvidia.com/Download/Find.aspx</a></p><h1 id="查看资源使用情况工具"><a href="#查看资源使用情况工具" class="headerlink" title="查看资源使用情况工具"></a>查看资源使用情况工具</h1><h2 id="命令行工具"><a href="#命令行工具" class="headerlink" title="命令行工具"></a>命令行工具</h2><ul><li>nvidia-smi</li><li>nvtop</li><li>gpustat</li></ul><h2 id="编程工具"><a href="#编程工具" class="headerlink" title="编程工具"></a>编程工具</h2><ul><li>py3nvml</li><li>py3smi</li></ul><h1 id="资源监控方案"><a href="#资源监控方案" class="headerlink" title="资源监控方案"></a>资源监控方案</h1><ul><li><a href="https://github.com/NVIDIA/gpu-monitoring-tools" target="_blank" rel="noopener">https://github.com/NVIDIA/gpu-monitoring-tools</a></li><li><a href="https://github.com/XuehaiPan/nvitop" target="_blank" rel="noopener">https://github.com/XuehaiPan/nvitop</a></li></ul><h1 id="名词解释"><a href="#名词解释" class="headerlink" title="名词解释"></a>名词解释</h1><ul><li>CUDA<blockquote><p>CUDA(Compute Unified Device Architecture)是显卡厂商 NVIDIA 推出的运算平台。CUDA™ 是一种由 NVIDIA 推出的通用并行计算架构,该架构使 GPU 能够解决复杂的计算问题。它包含了 CUDA 指令集架构(ISA)以及 GPU 内部的并行计算引擎。 开发人员目前可使用 C 语言、C++ 及 FORTRAN 来为 CUDA™ 架构编写程序,所编写出的程序可在支持 CUDA™ 的处理器上以超高性能运行。<br>GPU 云服务器采用 NVIDIA 显卡,则需要安装 CUDA 开发运行环境。</p></blockquote></li></ul><h1 id="推荐资料"><a href="#推荐资料" class="headerlink" title="推荐资料"></a>推荐资料</h1><ul><li><a href="https://www.cnblogs.com/timlly/p/11471507.html" target="_blank" rel="noopener">深入GPU硬件架构及运行机制</a></li></ul><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a></li><li><a href="https://www.toutiao.com/c/user/3916271538/#mid=1560038863835138" target="_blank" rel="noopener">今日头条</a></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/4ba15f98.html">https://mds1455975151.github.io/archives/4ba15f98.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
GPU基础知识总结
</summary>
<category term="GPU" scheme="https://mds1455975151.github.io/tags/GPU/"/>
<category term="AI" scheme="https://mds1455975151.github.io/tags/AI/"/>
<category term="Prometheus" scheme="https://mds1455975151.github.io/tags/Prometheus/"/>
<category term="显存" scheme="https://mds1455975151.github.io/tags/%E6%98%BE%E5%AD%98/"/>
</entry>
<entry>
<title>在线教育公司列表</title>
<link href="https://mds1455975151.github.io/archives/4480c66.html"/>
<id>https://mds1455975151.github.io/archives/4480c66.html</id>
<published>2021-09-05T13:37:22.000Z</published>
<updated>2021-09-05T13:57:10.112Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><blockquote><p>在线教育公司</p></blockquote><a id="more"></a><table><thead><tr><th>公司名称</th><th>公司规模</th><th>公司性质</th><th>公司地址</th><th>官网地址</th></tr></thead><tbody><tr><td>北京新东方教育科技(集团)有限公司</td><td>-</td><td>上市公司</td><td>北京海淀区</td><td></td></tr><tr><td>中公教育</td><td>-</td><td>上市公司</td><td>北京海淀区</td><td></td></tr><tr><td>学而思国际教育集团</td><td>-</td><td>上市公司</td><td>北京海淀区</td><td></td></tr><tr><td>沪江网校</td><td>-</td><td>上市公司</td><td>北京海淀区</td><td></td></tr><tr><td>vipkid 北京大米未来科技有限公司</td><td>-</td><td>上市公司</td><td>北京海淀区</td><td></td></tr><tr><td>北京东大正保科技有限公司</td><td>-</td><td>上市公司</td><td>北京海淀区</td><td></td></tr><tr><td>作业帮 小船出海教育科技(北京)有限公司</td><td>2000人以上</td><td>上市公司</td><td>北京市海淀区上地信息产业基地开拓路1号4层4001</td><td><a href="https://www.zybang.com/" target="_blank" rel="noopener">https://www.zybang.com/</a></td></tr><tr><td>达内</td><td>-</td><td>上市公司</td><td>北京海淀区</td><td></td></tr><tr><td>一起作业</td><td>-</td><td>上市公司</td><td>北京海淀区</td><td></td></tr><tr><td>伴鱼少儿英语</td><td>-</td><td>上市公司</td><td>北京市海淀区花园路街道马甸东路金澳国际大厦写字楼北门</td><td><a href="https://ipalfish.zhiye.com/home" target="_blank" rel="noopener">https://ipalfish.zhiye.com/home</a></td></tr><tr><td>高思教育</td><td>-</td><td>上市公司</td><td>北京市海淀区</td><td>-</td></tr><tr><td>爱学习教育</td><td>-</td><td>上市公司</td><td>北京市海淀区</td><td>-</td></tr><tr><td>无忧英语 深圳大生知行教育科技有限公司</td><td>-</td><td>上市公司</td><td>北京市海淀区</td><td><a href="https://www.51talk.com/" target="_blank" rel="noopener">https://www.51talk.com/</a></td></tr><tr><td>美术宝</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>火花思维</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>瑞思英语</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>编程猫</td><td>-</td><td>-</td><td>-</td><td>-</td></tr></tbody></table><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a></li><li><a href="https://www.toutiao.com/c/user/3916271538/#mid=1560038863835138" target="_blank" rel="noopener">今日头条</a></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/4480c66.html">https://mds1455975151.github.io/archives/4480c66.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
在线教育公司
</summary>
<category term="在线教育" scheme="https://mds1455975151.github.io/tags/%E5%9C%A8%E7%BA%BF%E6%95%99%E8%82%B2/"/>
<category term="双减" scheme="https://mds1455975151.github.io/tags/%E5%8F%8C%E5%87%8F/"/>
<category term="素质教育" scheme="https://mds1455975151.github.io/tags/%E7%B4%A0%E8%B4%A8%E6%95%99%E8%82%B2/"/>
<category term="职业教育" scheme="https://mds1455975151.github.io/tags/%E8%81%8C%E4%B8%9A%E6%95%99%E8%82%B2/"/>
</entry>
<entry>
<title>npm私服部署-verdaccio方案</title>
<link href="https://mds1455975151.github.io/archives/eb9965ee.html"/>
<id>https://mds1455975151.github.io/archives/eb9965ee.html</id>
<published>2021-09-02T13:25:03.000Z</published>
<updated>2021-09-02T14:06:55.728Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><blockquote><p>npm私服verdaccio</p></blockquote><a id="more"></a><h1 id="需求说明"><a href="#需求说明" class="headerlink" title="需求说明"></a>需求说明</h1><ul><li>公司内部组件库统一管理,非公开项目</li><li>私有仓库缓存,提高下包速度</li></ul><h1 id="技术选型"><a href="#技术选型" class="headerlink" title="技术选型"></a>技术选型</h1><h2 id="付费类型"><a href="#付费类型" class="headerlink" title="付费类型"></a>付费类型</h2><ul><li>MyGet</li><li>NPM Org</li></ul><h2 id="免费"><a href="#免费" class="headerlink" title="免费"></a>免费</h2><ul><li>Git</li><li>Nexus</li><li>DIY NPM</li><li>verdaccio(推荐)</li></ul><h1 id="部署实践"><a href="#部署实践" class="headerlink" title="部署实践"></a>部署实践</h1><figure class="highlight plain"><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></pre></td><td class="code"><pre><span class="line"># docker run -d -it \</span><br><span class="line">--name verdaccio \</span><br><span class="line">-p 4873:4873 \</span><br><span class="line">verdaccio/verdaccio</span><br><span class="line">ca3a819c02eac338c69a02aa62b0fc4c28f446a8429524898edacfce2e7bfdc6</span><br><span class="line"># docker ps</span><br><span class="line">CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES</span><br><span class="line">ca3a819c02ea verdaccio/verdaccio "uid_entrypoint /bin…" 3 seconds ago Up 2 seconds 0.0.0.0:4873->4873/tcp verdaccio</span><br></pre></td></tr></table></figure><p><img src="/archives/eb9965ee/03.png" alt></p><h1 id="上传第一个组件"><a href="#上传第一个组件" class="headerlink" title="上传第一个组件"></a>上传第一个组件</h1><figure class="highlight plain"><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><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br></pre></td><td class="code"><pre><span class="line"># npm adduser --registry http://127.0.0.1:4873/</span><br><span class="line">Username: admin</span><br><span class="line">Password:</span><br><span class="line">Email: (this IS public) [email protected]</span><br><span class="line">Logged in as admin on http://127.0.0.1:4873/.</span><br><span class="line"># mkdir nodejs-demo</span><br><span class="line"># cd nodejs-demo</span><br><span class="line"># npm init</span><br><span class="line">This utility will walk you through creating a package.json file.</span><br><span class="line">It only covers the most common items, and tries to guess sensible defaults.</span><br><span class="line"></span><br><span class="line">See `npm help init` for definitive documentation on these fields</span><br><span class="line">and exactly what they do.</span><br><span class="line"></span><br><span class="line">Use `npm install <pkg>` afterwards to install a package and</span><br><span class="line">save it as a dependency in the package.json file.</span><br><span class="line"></span><br><span class="line">Press ^C at any time to quit.</span><br><span class="line">package name: (nodejs-demo)</span><br><span class="line">version: (1.0.0)</span><br><span class="line">description: NPM私服测试组件</span><br><span class="line">entry point: (index.js)</span><br><span class="line">test command:</span><br><span class="line">git repository:</span><br><span class="line">keywords: NPM私服</span><br><span class="line">author: [email protected]</span><br><span class="line">license: (ISC)</span><br><span class="line">About to write to /Users/madongsheng/nodejs-demo/package.json:</span><br><span class="line"></span><br><span class="line">{</span><br><span class="line"> "name": "nodejs-demo",</span><br><span class="line"> "version": "1.0.0",</span><br><span class="line"> "description": "NPM私服测试组件",</span><br><span class="line"> "main": "index.js",</span><br><span class="line"> "scripts": {</span><br><span class="line"> "test": "echo \"Error: no test specified\" && exit 1"</span><br><span class="line"> },</span><br><span class="line"> "keywords": [</span><br><span class="line"> "NPM私服"</span><br><span class="line"> ],</span><br><span class="line"> "author": "[email protected]",</span><br><span class="line"> "license": "ISC"</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">Is this OK? (yes) yes</span><br><span class="line"># tree</span><br><span class="line">.</span><br><span class="line">└── package.json</span><br><span class="line"></span><br><span class="line">0 directories, 1 file</span><br><span class="line"># npm install</span><br><span class="line">npm notice created a lockfile as package-lock.json. You should commit this file.</span><br><span class="line">npm WARN [email protected] No repository field.</span><br><span class="line"></span><br><span class="line"># npm publish --registry http://127.0.0.1:4873/</span><br><span class="line">up to date in 0.455s</span><br><span class="line">npm notice</span><br><span class="line">npm notice 📦 [email protected]</span><br><span class="line">npm notice === Tarball Contents ===</span><br><span class="line">npm notice 202B package.json</span><br><span class="line">npm notice === Tarball Details ===</span><br><span class="line">npm notice name: nodejs-demo</span><br><span class="line">npm notice version: 1.0.0</span><br><span class="line">npm notice package size: 234 B</span><br><span class="line">npm notice unpacked size: 202 B</span><br><span class="line">npm notice shasum: 05a9efab992cf8567fe7d34af7f35febad57eb8a</span><br><span class="line">npm notice integrity: sha512-8pFEZ500Enm/S[...]KMN9VYgshcg9A==</span><br><span class="line">npm notice total files: 1</span><br><span class="line">npm notice</span><br><span class="line">+ [email protected]</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"> ╭────────────────────────────────────────────────────────────────╮</span><br><span class="line"> │ │</span><br><span class="line"> │ New major version of npm available! 6.14.5 → 7.21.1 │</span><br><span class="line"> │ Changelog: https://github.com/npm/cli/releases/tag/v7.21.1 │</span><br><span class="line"> │ Run npm install -g npm to update! │</span><br><span class="line"> │ │</span><br><span class="line"> ╰────────────────────────────────────────────────────────────────╯</span><br></pre></td></tr></table></figure><p><img src="/archives/eb9965ee/04.png" alt><br><img src="/archives/eb9965ee/05.png" alt><br><img src="/archives/eb9965ee/06.png" alt><br><img src="/archives/eb9965ee/07.png" alt></p><h1 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h1><ul><li><a href="https://verdaccio.org/" target="_blank" rel="noopener">官网地址</a></li><li><a href="https://github.com/verdaccio/verdaccio/" target="_blank" rel="noopener">Verdaccio GitHub地址</a></li></ul><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a></li><li><a href="https://www.toutiao.com/c/user/3916271538/#mid=1560038863835138" target="_blank" rel="noopener">今日头条</a></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/eb9965ee.html">https://mds1455975151.github.io/archives/eb9965ee.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
npm私服verdaccio
</summary>
<category term="npm私服" scheme="https://mds1455975151.github.io/tags/npm%E7%A7%81%E6%9C%8D/"/>
<category term="verdaccio" scheme="https://mds1455975151.github.io/tags/verdaccio/"/>
</entry>
<entry>
<title>Kubernetes资源分析工具汇总</title>
<link href="https://mds1455975151.github.io/archives/840cb72e.html"/>
<id>https://mds1455975151.github.io/archives/840cb72e.html</id>
<published>2021-02-23T01:18:56.000Z</published>
<updated>2021-02-23T03:52:59.721Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><blockquote><p>公司业务全面容器化后,Kubernetes集群的稳定性,可用性就非常重要。如何了解集群的整体运行状态,及时发现集群运行的不稳定性因素变的至关重要。推荐几款集群管理工具,帮助我们定期检查集群状态,排查解决集群异常状态。</p></blockquote><a id="more"></a><h1 id="工具概述"><a href="#工具概述" class="headerlink" title="工具概述"></a>工具概述</h1><ul><li>kube-score: 一款静态代码分析工具,可用于Helm、Kustomize和标准YAML文件</li><li>polaris: 一款具有仪表盘的资源分析工具,用于验证webhook或CLI工具</li><li>popeye: 用于扫描kubernetes集群并报告配置中的潜在问题</li></ul><h1 id="kube-score"><a href="#kube-score" class="headerlink" title="kube-score"></a>kube-score</h1><p>GitHub地址: <a href="https://github.com/zegl/kube-score" target="_blank" rel="noopener">https://github.com/zegl/kube-score</a></p><p>项目支持macOS,Linux和window各个平台,安装简单可以快速上手.</p><h2 id="原生YAMLs文件"><a href="#原生YAMLs文件" class="headerlink" title="原生YAMLs文件"></a>原生YAMLs文件</h2><figure class="highlight plain"><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><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br></pre></td><td class="code"><pre><span class="line"># docker run -v $(pwd):/project zegl/kube-score:v1.10.0 score --output-format ci templates/deployment-nginx.yaml</span><br><span class="line">[OK] nginx apps/v1/Deployment</span><br><span class="line">[OK] nginx apps/v1/Deployment</span><br><span class="line">[CRITICAL] nginx apps/v1/Deployment: (nginx) ImagePullPolicy is not set to Always</span><br><span class="line">[CRITICAL] nginx apps/v1/Deployment: The pod does not have a matching NetworkPolicy</span><br><span class="line">[OK] nginx apps/v1/Deployment: The pod is not targeted by a service, skipping probe checks.</span><br><span class="line">[CRITICAL] nginx apps/v1/Deployment: (nginx) Container has no configured security context</span><br><span class="line">[CRITICAL] nginx apps/v1/Deployment: (nginx) CPU limit is not set</span><br><span class="line">[CRITICAL] nginx apps/v1/Deployment: (nginx) Memory limit is not set</span><br><span class="line">[CRITICAL] nginx apps/v1/Deployment: (nginx) CPU request is not set</span><br><span class="line">[CRITICAL] nginx apps/v1/Deployment: (nginx) Memory request is not set</span><br><span class="line">[OK] nginx apps/v1/Deployment</span><br><span class="line">[CRITICAL] nginx apps/v1/Deployment: No matching PodDisruptionBudget was found</span><br><span class="line">[WARNING] nginx apps/v1/Deployment: Deployment does not have a host podAntiAffinity set</span><br><span class="line">[SKIPPED] nginx apps/v1/Deployment: Skipped because the deployment is not targeted by a HorizontalPodAutoscaler</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"># docker run -v $(pwd):/project zegl/kube-score:v1.10.0 score templates/deployment-nginx.yaml </span><br><span class="line">apps/v1/Deployment nginx 💥</span><br><span class="line"> [CRITICAL] Container Image Pull Policy</span><br><span class="line"> · nginx -> ImagePullPolicy is not set to Always</span><br><span class="line"> It's recommended to always set the ImagePullPolicy to Always, to</span><br><span class="line"> make sure that the imagePullSecrets are always correct, and to</span><br><span class="line"> always get the image you want.</span><br><span class="line"> [CRITICAL] Pod NetworkPolicy</span><br><span class="line"> · The pod does not have a matching NetworkPolicy</span><br><span class="line"> Create a NetworkPolicy that targets this pod to control who/what</span><br><span class="line"> can communicate with this pod. Note, this feature needs to be</span><br><span class="line"> supported by the CNI implementation used in the Kubernetes cluster</span><br><span class="line"> to have an effect.</span><br><span class="line"> [CRITICAL] Container Security Context</span><br><span class="line"> · nginx -> Container has no configured security context</span><br><span class="line"> Set securityContext to run the container in a more secure context.</span><br><span class="line"> [CRITICAL] Container Resources</span><br><span class="line"> · nginx -> CPU limit is not set</span><br><span class="line"> Resource limits are recommended to avoid resource DDOS. Set</span><br><span class="line"> resources.limits.cpu</span><br><span class="line"> · nginx -> Memory limit is not set</span><br><span class="line"> Resource limits are recommended to avoid resource DDOS. Set</span><br><span class="line"> resources.limits.memory</span><br><span class="line"> · nginx -> CPU request is not set</span><br><span class="line"> Resource requests are recommended to make sure that the application</span><br><span class="line"> can start and run without crashing. Set resources.requests.cpu</span><br><span class="line"> · nginx -> Memory request is not set</span><br><span class="line"> Resource requests are recommended to make sure that the application</span><br><span class="line"> can start and run without crashing. Set resources.requests.memory</span><br><span class="line"> [CRITICAL] Deployment has PodDisruptionBudget</span><br><span class="line"> · No matching PodDisruptionBudget was found</span><br><span class="line"> It's recommended to define a PodDisruptionBudget to avoid</span><br><span class="line"> unexpected downtime during Kubernetes maintenance operations, such</span><br><span class="line"> as when draining a node.</span><br><span class="line"> [WARNING] Deployment has host PodAntiAffinity</span><br><span class="line"> · Deployment does not have a host podAntiAffinity set</span><br><span class="line"> It's recommended to set a podAntiAffinity that stops multiple pods</span><br><span class="line"> from a deployment from being scheduled on the same node. This</span><br><span class="line"> increases availability in case the node becomes unavailable.</span><br></pre></td></tr></table></figure><blockquote><p>注释:</p><ul><li>–output-format 支持不同的输出格式(human、json、ci,默认为human格式)</li></ul></blockquote><h2 id="其他"><a href="#其他" class="headerlink" title="其他"></a>其他</h2><p>还可以配置更加详细的检测参数,可以更加深入了解。</p><h1 id="polaris"><a href="#polaris" class="headerlink" title="polaris"></a>polaris</h1><p>GitHub地址:<a href="https://github.com/FairwindsOps/polaris" target="_blank" rel="noopener">https://github.com/FairwindsOps/polaris</a></p><p>官网文档:<a href="https://polaris.docs.fairwinds.com/dashboard/#installation" target="_blank" rel="noopener">https://polaris.docs.fairwinds.com/dashboard/</a></p><p>项目支持YAML、Helm、本地二进制文件、Docker等多种运行方式,博客Docker为大家演示效果</p><figure class="highlight plain"><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></pre></td><td class="code"><pre><span class="line">docker run -it -d \</span><br><span class="line"> -p 8080:8080 \</span><br><span class="line"> -v ~/kube-config:/opt/app/config quay.io/fairwinds/polaris:1.2 \</span><br><span class="line"> polaris dashboard --kubeconfig /opt/app/config</span><br></pre></td></tr></table></figure><p>体验视频: <a href="https://youtu.be/dbYYqezmcYg" target="_blank" rel="noopener">https://youtu.be/dbYYqezmcYg</a></p><h1 id="popeye"><a href="#popeye" class="headerlink" title="popeye"></a>popeye</h1><ul><li>官网地址: <a href="https://popeyecli.io/" target="_blank" rel="noopener">https://popeyecli.io/</a></li><li>GitHub地址: <a href="https://github.com/derailed/popeye/" target="_blank" rel="noopener">https://github.com/derailed/popeye/</a></li></ul><h2 id="部署并执行检测"><a href="#部署并执行检测" class="headerlink" title="部署并执行检测"></a>部署并执行检测</h2><ul><li>支持Linux, Window及macOS各个平台</li><li>支持常见的Kubernetes资源类型,<a href="https://popeyecli.io/#sanitizers" target="_blank" rel="noopener">支持清单</a></li><li>支持不同的<a href="https://popeyecli.io/#output-formats" target="_blank" rel="noopener">输出格式</a>,保存位置等等</li></ul><p>以Docker启动方式作为说明</p><figure class="highlight plain"><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></pre></td><td class="code"><pre><span class="line">docker run --rm -it \</span><br><span class="line"> -v $HOME/.kube:/root/.kube \</span><br><span class="line"> -v /tmp:/tmp \</span><br><span class="line"> quay.io/derailed/popeye --save --out html --output-file report.html</span><br></pre></td></tr></table></figure><h2 id="结果说明"><a href="#结果说明" class="headerlink" title="结果说明"></a>结果说明</h2><p>报告格式:<a href="https://www.mdslq.cn/report.html" target="_blank" rel="noopener">案例</a></p><p>常见问题:</p><ul><li>[POP-100] Untagged docker image in use</li><li>[POP-101] Image tagged “latest” in use</li><li>[POP-106] No resources requests/limits defined</li><li>[POP-107] No resource limits defined</li><li>[POP-112] Memory Current/Limit (110Mi/128Mi) reached user 80% threshold (85%)</li><li>[POP-206] No PodDisruptionBudget defined</li><li>[POP-300] Using “default” ServiceAccount</li><li>[POP-301] Connects to API Server? ServiceAccount token is mounted</li><li>[POP-302] Pod could be running as root user. Check SecurityContext/Image</li><li>[POP-400] Used? Unable to locate resource reference</li><li>[POP-403] Deprecated Ingress API group “extensions/v1beta1”. Use “networking.k8s.io/v1beta1” instead</li><li>[POP-501] Unhealthy 11 desired but have 3 available</li><li>[POP-712] Found only one master node</li><li>[POP-708] No node metrics available</li><li>[POP-1000] Available</li><li>[POP-1100] No pods match service selector</li><li>[POP-1105] No associated endpoints</li><li>[POP-1120] Unhealthy ReplicaSet 11 desired but have 3 ready</li></ul><h1 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h1><ul><li>kube-score主要检测YAML文件规范,可以检测YAML中的不规范问题,例如: 镜像tag标识,镜像拉取策略,资源配额缺失,容器安全等各种问题</li><li>polaris和popeye功能类似,都支持可视化结果展示,popeye相对而已检测更全部些,都值得推荐</li></ul><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a></li><li><a href="https://www.toutiao.com/c/user/3916271538/#mid=1560038863835138" target="_blank" rel="noopener">今日头条</a></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/840cb72e.html">https://mds1455975151.github.io/archives/840cb72e.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
<blockquote><p>公司业务全面容器化后,Kubernetes集群的稳定性,可用性就非常重要。如何了解集群的整体运行状态,及时发现集群运行的不稳定性因素变的至关重要。推荐几款集群管理工具,帮助我们定期检查集群状态,排查解决集群异常状态。</p></blockquote>
</summary>
<category term="Kubernetes" scheme="https://mds1455975151.github.io/tags/Kubernetes/"/>
<category term="K8S" scheme="https://mds1455975151.github.io/tags/K8S/"/>
<category term="容器" scheme="https://mds1455975151.github.io/tags/%E5%AE%B9%E5%99%A8/"/>
<category term="资源分享" scheme="https://mds1455975151.github.io/tags/%E8%B5%84%E6%BA%90%E5%88%86%E4%BA%AB/"/>
<category term="polaris" scheme="https://mds1455975151.github.io/tags/polaris/"/>
<category term="kube-score" scheme="https://mds1455975151.github.io/tags/kube-score/"/>
<category term="popeye" scheme="https://mds1455975151.github.io/tags/popeye/"/>
</entry>
<entry>
<title>CentOS 6.x yum源无法使用解决</title>
<link href="https://mds1455975151.github.io/archives/1cc34111.html"/>
<id>https://mds1455975151.github.io/archives/1cc34111.html</id>
<published>2020-12-14T03:27:32.000Z</published>
<updated>2020-12-14T03:29:40.579Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><blockquote><p>CentOS 6.x yum源无法使用解决</p></blockquote><a id="more"></a><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></pre></td><td class="code"><pre><span class="line">os_version=`awk <span class="string">'{print $3}'</span> /etc/redhat-release`</span><br><span class="line">wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo</span><br><span class="line">sed -i <span class="string">"s#mirrors.aliyun.com/centos/\$releasever#mirrors.aliyun.com/centos-vault/<span class="variable">${os_version}</span>#g"</span> CentOS-Base.repo</span><br><span class="line">sed -i <span class="string">"s#mirrors.aliyuncs.com/centos/\$releasever#mirrors.aliyun.com/centos-vault/<span class="variable">${os_version}</span>#g"</span> CentOS-Base.repo</span><br><span class="line">sed -i <span class="string">"s#mirrors.cloud.aliyuncs.com/centos/\$releasever#mirrors.aliyun.com/centos-vault/<span class="variable">${os_version}</span>#g"</span> CentOS-Base.repo</span><br><span class="line">yum clean all</span><br><span class="line">yum makecache</span><br></pre></td></tr></table></figure><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a></li><li><a href="https://www.toutiao.com/c/user/3916271538/#mid=1560038863835138" target="_blank" rel="noopener">今日头条</a></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/1cc34111.html">https://mds1455975151.github.io/archives/1cc34111.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
<blockquote><p>CentOS 6.x yum源无法使用解决</p></blockquote>
</summary>
</entry>
<entry>
<title>自动化测试工具appium部署</title>
<link href="https://mds1455975151.github.io/archives/134400db.html"/>
<id>https://mds1455975151.github.io/archives/134400db.html</id>
<published>2020-05-09T13:06:28.000Z</published>
<updated>2020-05-09T13:16:08.527Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><blockquote><p>协助公司测试同事部署下自动化测试工具Appium</p></blockquote><a id="more"></a><p>记录下,共享给有需要的朋友。安装不得方法,各种报错让人抓狂。</p><p>要点:</p><ul><li>安装最新稳定版本node,系统默认的版本都比较低</li><li>使用cnmp替代npm(解决下载依赖速度问题)</li></ul><figure class="highlight plain"><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></pre></td><td class="code"><pre><span class="line">wget https://nodejs.org/dist/v12.16.3/node-v12.16.3-linux-x64.tar.xz</span><br><span class="line">xz -d node-v12.16.3-linux-x64.tar.xz</span><br><span class="line">tar -xf node-v12.16.3-linux-x64.tar -C /usr/local/</span><br><span class="line">cd /usr/local/ && ln -s node-v12.16.3-linux-x64 node</span><br><span class="line">cat>>/etc/profile<<EOF</span><br><span class="line"></span><br><span class="line"># set for nodejs</span><br><span class="line">export NODE_HOME=/usr/local/node</span><br><span class="line">export PATH=\$NODE_HOME/bin:\$PATH</span><br><span class="line">EOF</span><br><span class="line">source /etc/profile</span><br><span class="line">node -v</span><br><span class="line"></span><br><span class="line">npm install -g cnpm --registry=https://registry.npm.taobao.org</span><br><span class="line">cnpm install -g appium</span><br></pre></td></tr></table></figure><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a></li><li><a href="https://www.toutiao.com/c/user/3916271538/#mid=1560038863835138" target="_blank" rel="noopener">今日头条</a></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/134400db.html">https://mds1455975151.github.io/archives/134400db.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
自动化测试工具Appium部署
</summary>
<category term="DevOps" scheme="https://mds1455975151.github.io/categories/DevOps/"/>
<category term="DevOps" scheme="https://mds1455975151.github.io/tags/DevOps/"/>
<category term="自动化测试" scheme="https://mds1455975151.github.io/tags/%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95/"/>
<category term="Appium" scheme="https://mds1455975151.github.io/tags/Appium/"/>
</entry>
<entry>
<title>运维工程师-非专业安全人员如何确保企业信息安全</title>
<link href="https://mds1455975151.github.io/archives/c747a9a8.html"/>
<id>https://mds1455975151.github.io/archives/c747a9a8.html</id>
<published>2020-04-11T08:16:44.000Z</published>
<updated>2020-04-11T08:19:31.257Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><blockquote><p>企业信息安全守则</p></blockquote><a id="more"></a><ul><li>关于权限,各类授权都遵循最小化授权原则,能授权IP不授权网段,能授权指定端口不授权ALL</li><li>各类服务使用普通账号启动,软件目录授权最小化</li><li>各类密码复杂度要求,并要求定期3个月更新</li><li>线上操作行为审计需要部署堡垒机</li><li>公司外部办公使用OpenVPN+堡垒机方式</li><li>员工电脑全部要求按照杀毒软件,确保企业内部网络安全</li><li>做好业务监控发现问题及时纠正解决</li><li>各类应用软件隐藏版本信息,及时更新到最新稳定版本</li><li>使用Openresty实现web应用防火墙,可以阻挡一些安全攻击,例如:SQL注释,CC攻击、API接口安全</li><li>定期员工培训,强调企业安全防范意识</li><li>时刻关注各类安全事件,加强防范意识</li></ul><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a></li><li><a href="https://www.toutiao.com/c/user/3916271538/#mid=1560038863835138" target="_blank" rel="noopener">今日头条</a></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/c747a9a8.html">https://mds1455975151.github.io/archives/c747a9a8.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
企业信息安全
</summary>
<category term="DevOps" scheme="https://mds1455975151.github.io/categories/DevOps/"/>
<category term="企业信息安全" scheme="https://mds1455975151.github.io/tags/%E4%BC%81%E4%B8%9A%E4%BF%A1%E6%81%AF%E5%AE%89%E5%85%A8/"/>
<category term="运维工程师" scheme="https://mds1455975151.github.io/tags/%E8%BF%90%E7%BB%B4%E5%B7%A5%E7%A8%8B%E5%B8%88/"/>
</entry>
<entry>
<title>HashiCorp Vault入门介绍</title>
<link href="https://mds1455975151.github.io/archives/ff02dc0f.html"/>
<id>https://mds1455975151.github.io/archives/ff02dc0f.html</id>
<published>2020-04-11T06:35:31.000Z</published>
<updated>2020-04-11T08:02:07.866Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><blockquote><p>HashiCorp Vault是一款企业级私密信息管理工具。说起Vault,不得不提它的创造者HashiCorp公司。HashiCorp是一家专注于DevOps工具链的公司,其旗下明星级产品包括Vagrant、Packer、Terraform、Consul、Nomad等,再加上Vault,这些工具贯穿了持续交付的整个流程。</p></blockquote><a id="more"></a><p><img src="/archives/ff02dc0f/04.png" alt="image"></p><h1 id="为什么使用HashiCorp-Vault?"><a href="#为什么使用HashiCorp-Vault?" class="headerlink" title="为什么使用HashiCorp Vault?"></a>为什么使用HashiCorp Vault?</h1><p>企业内各类私密信息安全存储问题需求,例如:ssh key,各类API认证信息,数据库权限等等</p><h1 id="HashiCorp-Vault优势"><a href="#HashiCorp-Vault优势" class="headerlink" title="HashiCorp Vault优势"></a>HashiCorp Vault优势</h1><p>HashiCorp Vault作为集中化的私密信息管理工具,具有以下特点:</p><ul><li>存储私密信息<br>不仅可以存放现有的私密信息,还可以动态生成用于管理第三方资源的私密信息。所有存放的数据都是加密的,任何动态生成的私密信息都有租期,并且到期会自动回收。</li><li>滚动更新秘钥<br>用户可以随时更新存放的私密信息。Vault提供了加密即服务(encryption-as-a-service)的功能,可以随时将密钥滚动到新的密钥版本,同时保留对使用过去密钥版本加密的值进行解密的能力。 对于动态生成的秘密,可配置的最大租赁寿命确保密钥滚动易于实施。</li><li>审计日志<br>保管库存储所有经过身份验证的客户端交互的详细审核日志:身份验证,令牌创建,私密信息访问,私密信息撤销等。 可以将审核日志发送到多个后端以确保冗余副本。</li></ul><p>另外,HaishiCorp Vault提供了多种方式来管理私密信息。用户可以通过命令行、HTTP API等集成到应用中来获取私密信息。HashiCorp Vault也能与Ansible、Chef、Consul等DevOps工具链无缝结合使用。</p><h1 id="HashiCorp-Vault实践"><a href="#HashiCorp-Vault实践" class="headerlink" title="HashiCorp Vault实践"></a>HashiCorp Vault实践</h1><figure class="highlight plain"><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><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br></pre></td><td class="code"><pre><span class="line">[root@node01 ~]# wget https://releases.hashicorp.com/vault/1.4.0/vault_1.4.0_linux_arm64.zip</span><br><span class="line">[root@node01 ~]# unzip vault_1.4.0_linux_arm64.zip</span><br><span class="line">[root@node01 ~]# install vault /usr/local/bin/</span><br><span class="line"></span><br><span class="line">[root@node01 ~]# vault server -dev-listen-address=0.0.0.0:8200 --dev</span><br><span class="line">==> Vault server configuration:</span><br><span class="line"></span><br><span class="line"> Api Address: http://0.0.0.0:8200</span><br><span class="line"> Cgo: disabled</span><br><span class="line"> Cluster Address: https://0.0.0.0:8201</span><br><span class="line"> Listener 1: tcp (addr: "0.0.0.0:8200", cluster address: "0.0.0.0:8201", max_request_duration: "1m30s", max_request_size: "33554432", tls: "disabled")</span><br><span class="line"> Log Level: info</span><br><span class="line"> Mlock: supported: true, enabled: false</span><br><span class="line"> Recovery Mode: false</span><br><span class="line"> Storage: inmem</span><br><span class="line"> Version: Vault v1.4.0</span><br><span class="line"></span><br><span class="line">WARNING! dev mode is enabled! In this mode, Vault runs entirely in-memory</span><br><span class="line">and starts unsealed with a single unseal key. The root token is already</span><br><span class="line">authenticated to the CLI, so you can immediately begin using Vault.</span><br><span class="line"></span><br><span class="line">You may need to set the following environment variable:</span><br><span class="line"></span><br><span class="line"> $ export VAULT_ADDR='http://0.0.0.0:8200'</span><br><span class="line"></span><br><span class="line">The unseal key and root token are displayed below in case you want to</span><br><span class="line">seal/unseal the Vault or re-authenticate.</span><br><span class="line"></span><br><span class="line">Unseal Key: t8B6LCmjcX4mc2cx5XDjzLkYzd1ZSX1Fn3rkq3p50P4=</span><br><span class="line">Root Token: s.yOXkEpKd27M5eYRC1Knv3T6D</span><br><span class="line"></span><br><span class="line">Development mode should NOT be used in production installations!</span><br><span class="line"></span><br><span class="line">==> Vault server started! Log data will stream in below:</span><br><span class="line"></span><br><span class="line">2020-04-11T10:55:49.813+0800 [INFO] proxy environment: http_proxy= https_proxy= no_proxy=</span><br><span class="line">2020-04-11T10:55:49.813+0800 [WARN] no `api_addr` value specified in config or in VAULT_API_ADDR; falling back to detection if possible, but this value should be manually set</span><br><span class="line">2020-04-11T10:55:49.813+0800 [ERROR] core: no seal config found, can't determine if legacy or new-style shamir</span><br><span class="line">2020-04-11T10:55:49.813+0800 [ERROR] core: no seal config found, can't determine if legacy or new-style shamir</span><br><span class="line">2020-04-11T10:55:49.813+0800 [INFO] core: security barrier not initialized</span><br><span class="line">2020-04-11T10:55:49.813+0800 [INFO] core: security barrier initialized: stored=1 shares=1 threshold=1</span><br><span class="line">2020-04-11T10:55:49.814+0800 [INFO] core: post-unseal setup starting</span><br><span class="line">2020-04-11T10:55:49.824+0800 [INFO] core: loaded wrapping token key</span><br><span class="line">2020-04-11T10:55:49.824+0800 [INFO] core: successfully setup plugin catalog: plugin-directory=</span><br><span class="line">2020-04-11T10:55:49.824+0800 [INFO] core: no mounts; adding default mount table</span><br><span class="line">2020-04-11T10:55:49.825+0800 [INFO] core: successfully mounted backend: type=cubbyhole path=cubbyhole/</span><br><span class="line">2020-04-11T10:55:49.825+0800 [INFO] core: successfully mounted backend: type=system path=sys/</span><br><span class="line">2020-04-11T10:55:49.826+0800 [INFO] core: successfully mounted backend: type=identity path=identity/</span><br><span class="line">2020-04-11T10:55:49.827+0800 [INFO] core: successfully enabled credential backend: type=token path=token/</span><br><span class="line">2020-04-11T10:55:49.827+0800 [INFO] core: restoring leases</span><br><span class="line">2020-04-11T10:55:49.827+0800 [INFO] rollback: starting rollback manager</span><br><span class="line">2020-04-11T10:55:49.828+0800 [INFO] expiration: lease restore complete</span><br><span class="line">2020-04-11T10:55:49.831+0800 [INFO] identity: entities restored</span><br><span class="line">2020-04-11T10:55:49.831+0800 [INFO] identity: groups restored</span><br><span class="line">2020-04-11T10:55:49.831+0800 [INFO] core: post-unseal setup complete</span><br><span class="line">2020-04-11T10:55:49.832+0800 [INFO] core: root token generated</span><br><span class="line">2020-04-11T10:55:49.832+0800 [INFO] core: pre-seal teardown starting</span><br><span class="line">2020-04-11T10:55:49.832+0800 [INFO] rollback: stopping rollback manager</span><br><span class="line">2020-04-11T10:55:49.832+0800 [INFO] core: pre-seal teardown complete</span><br><span class="line">2020-04-11T10:55:49.832+0800 [ERROR] core: no seal config found, can't determine if legacy or new-style shamir</span><br><span class="line">2020-04-11T10:55:49.832+0800 [INFO] core.cluster-listener.tcp: starting listener: listener_address=0.0.0.0:8201</span><br><span class="line">2020-04-11T10:55:49.832+0800 [INFO] core.cluster-listener: serving cluster requests: cluster_listen_address=[::]:8201</span><br><span class="line">2020-04-11T10:55:49.832+0800 [INFO] core: post-unseal setup starting</span><br><span class="line">2020-04-11T10:55:49.832+0800 [INFO] core: loaded wrapping token key</span><br><span class="line">2020-04-11T10:55:49.832+0800 [INFO] core: successfully setup plugin catalog: plugin-directory=</span><br><span class="line">2020-04-11T10:55:49.832+0800 [INFO] core: successfully mounted backend: type=system path=sys/</span><br><span class="line">2020-04-11T10:55:49.833+0800 [INFO] core: successfully mounted backend: type=identity path=identity/</span><br><span class="line">2020-04-11T10:55:49.833+0800 [INFO] core: successfully mounted backend: type=cubbyhole path=cubbyhole/</span><br><span class="line">2020-04-11T10:55:49.833+0800 [INFO] core: successfully enabled credential backend: type=token path=token/</span><br><span class="line">2020-04-11T10:55:49.833+0800 [INFO] core: restoring leases</span><br><span class="line">2020-04-11T10:55:49.833+0800 [INFO] rollback: starting rollback manager</span><br><span class="line">2020-04-11T10:55:49.833+0800 [INFO] identity: entities restored</span><br><span class="line">2020-04-11T10:55:49.833+0800 [INFO] identity: groups restored</span><br><span class="line">2020-04-11T10:55:49.833+0800 [INFO] core: post-unseal setup complete</span><br><span class="line">2020-04-11T10:55:49.833+0800 [INFO] core: vault is unsealed</span><br><span class="line">2020-04-11T10:55:49.835+0800 [INFO] core: successful mount: namespace= path=secret/ type=kv</span><br><span class="line">2020-04-11T10:55:49.836+0800 [INFO] expiration: lease restore complete</span><br><span class="line">2020-04-11T10:55:49.836+0800 [INFO] secrets.kv.kv_bb6143ab: collecting keys to upgrade</span><br><span class="line">2020-04-11T10:55:49.836+0800 [INFO] secrets.kv.kv_bb6143ab: done collecting keys: num_keys=1</span><br><span class="line">2020-04-11T10:55:49.836+0800 [INFO] secrets.kv.kv_bb6143ab: upgrading keys finished</span><br></pre></td></tr></table></figure><p>运行起来后检查下应用信息</p><figure class="highlight plain"><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></pre></td><td class="code"><pre><span class="line">[root@node01 ~]# vault status</span><br><span class="line">Key Value</span><br><span class="line">--- -----</span><br><span class="line">Seal Type shamir</span><br><span class="line">Initialized true</span><br><span class="line">Sealed false</span><br><span class="line">Total Shares 1</span><br><span class="line">Threshold 1</span><br><span class="line">Version 1.4.0</span><br><span class="line">Cluster Name vault-cluster-7a108e78</span><br><span class="line">Cluster ID 87b55947-d512-6a0f-a6ab-91e89ea3f4f9</span><br><span class="line">HA Enabled false</span><br><span class="line">[root@node01 ~]# vault auth list</span><br><span class="line">Path Type Accessor Description</span><br><span class="line">---- ---- -------- -----------</span><br><span class="line">token/ token auth_token_d4a43357 token based credentials</span><br></pre></td></tr></table></figure><h1 id="UI界面体验"><a href="#UI界面体验" class="headerlink" title="UI界面体验"></a>UI界面体验</h1><p>登陆地址: http://{ip}:8200/ui/<br><img src="/archives/ff02dc0f/01.png" alt="image"><br>启动后默认会生成一个token信息,每次都会变化,使用该token登陆。Vault支持很多主流认证方式,根据需要增加其他认证方式,本人测试使用的是OpenLDAP。<br><img src="/archives/ff02dc0f/02.png" alt="image"><br>支持的密钥引擎<br><img src="/archives/ff02dc0f/03.png" alt="image"><br>界面就这么内容,很多操作还是依赖于命令行操作。</p><h1 id="启用OpenLDAP认证"><a href="#启用OpenLDAP认证" class="headerlink" title="启用OpenLDAP认证"></a>启用OpenLDAP认证</h1><figure class="highlight plain"><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></pre></td><td class="code"><pre><span class="line">vault auth enable ldap</span><br><span class="line"></span><br><span class="line">vault write auth/ldap/config \</span><br><span class="line"> url="ldap://master-ldap.xxx.com:389" \</span><br><span class="line"> userdn="cn=Users,dc=xxx,dc=com" \</span><br><span class="line"> groupfilter="(&(objectClass=person)(uid={{.Username}}))" \</span><br><span class="line"> groupattr="memberOf" \</span><br><span class="line"> binddn="cn=admin,dc=xxx,dc=com" \</span><br><span class="line"> bindpass='xxx' \</span><br><span class="line"> insecure_tls=false \</span><br><span class="line"> starttls=false</span><br></pre></td></tr></table></figure><blockquote><p>修改配置信息重新执行命令即可更新</p></blockquote><h1 id="业务实践"><a href="#业务实践" class="headerlink" title="业务实践"></a>业务实践</h1><p>基于Vault实现Linux服务器一次性SSH密码登陆</p><ul><li><a href="https://learn.hashicorp.com/vault/secrets-management/sm-ssh-otp" target="_blank" rel="noopener">官网案例</a></li><li><a href="https://releases.hashicorp.com/vault-ssh-helper" target="_blank" rel="noopener">vault-ssh-helper</a></li></ul><h1 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h1><ul><li><a href="https://github.com/hashicorp/vault-ssh-helper" target="_blank" rel="noopener">https://github.com/hashicorp/vault-ssh-helper</a></li></ul><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a></li><li><a href="https://www.toutiao.com/c/user/3916271538/#mid=1560038863835138" target="_blank" rel="noopener">今日头条</a></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/ff02dc0f.html">https://mds1455975151.github.io/archives/ff02dc0f.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
HashiCorp Vault一款企业级私密信息管理工具
</summary>
<category term="DevOps" scheme="https://mds1455975151.github.io/categories/DevOps/"/>
<category term="HashiCorp" scheme="https://mds1455975151.github.io/tags/HashiCorp/"/>
<category term="Vault" scheme="https://mds1455975151.github.io/tags/Vault/"/>
</entry>
<entry>
<title>YAPI高效易用功能强大的API开发者设计的管理平台</title>
<link href="https://mds1455975151.github.io/archives/a8bd9fbc.html"/>
<id>https://mds1455975151.github.io/archives/a8bd9fbc.html</id>
<published>2020-04-10T08:02:33.000Z</published>
<updated>2020-04-10T10:20:47.400Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><blockquote></blockquote><p>每天都有大量的API增长,随着移动应用以及智能设备爆发增长,同时越来越多的零售商、媒体、政府和金融服务公司开始公开Web API,未来API将会使用的越来越多,包括更多的M2M(机器到机器)的通信。现在,每日API调用量在不断飙升,如何能够安全有效将这些API管理起来对于企业而言并不容易。</p><a id="more"></a><h1 id="YAPI概述"><a href="#YAPI概述" class="headerlink" title="YAPI概述"></a>YAPI概述</h1><p>这里推荐一款API管理工具,可以让企业内部接口开发更简单高效,让接口的管理更具可读性、可维护性,让团队协作更合理。</p><ul><li>GitHub地址: <a href="https://github.com/YMFE/yapi" target="_blank" rel="noopener">https://github.com/YMFE/yapi</a></li><li>官网地址: <a href="http://yapi.demo.qunar.com/" target="_blank" rel="noopener">http://yapi.demo.qunar.com/</a></li><li>官网文档: <a href="https://hellosean1025.github.io/yapi/documents/index.html" target="_blank" rel="noopener">https://hellosean1025.github.io/yapi/documents/index.html</a></li></ul><p>优势:</p><ul><li>提供基本的项目分组,项目管理,接口管理功能(对接已有管理平台)</li><li>友好的接口文档,基于websocket的多人协作接口编辑功能和类postman测试工具,让多人协作成倍提升开发效率</li><li>基于Mockjs,使用简单功能强大</li></ul><h1 id="部署实践-快速高效Docker部署方式"><a href="#部署实践-快速高效Docker部署方式" class="headerlink" title="部署实践(快速高效Docker部署方式)"></a>部署实践(快速高效Docker部署方式)</h1><p><a href="https://github.com/jinfeijie/yapi" target="_blank" rel="noopener">https://github.com/jinfeijie/yapi</a><br><a href="https://github.com/fjc0k/docker-YApi" target="_blank" rel="noopener">https://github.com/fjc0k/docker-YApi</a></p><p>ymfe.org</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">docker run -d --name yapi-mongo -p 27017:27017 mongo</span><br><span class="line">npm install -g yapi-cli --registry https://registry.npm.taobao.org</span><br><span class="line">yapi server</span><br></pre></td></tr></table></figure><h1 id="最佳实践"><a href="#最佳实践" class="headerlink" title="最佳实践"></a>最佳实践</h1><ul><li>关闭注册</li><li>OpenLDAP接入<h1 id="效果"><a href="#效果" class="headerlink" title="效果"></a>效果</h1><h1 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h1></li></ul><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a></li><li><a href="https://www.toutiao.com/c/user/3916271538/#mid=1560038863835138" target="_blank" rel="noopener">今日头条</a></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/a8bd9fbc.html">https://mds1455975151.github.io/archives/a8bd9fbc.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
高效,易用,功能强大的API开发者设计的管理平台
</summary>
<category term="API管理" scheme="https://mds1455975151.github.io/categories/API%E7%AE%A1%E7%90%86/"/>
<category term="OpenLDAP" scheme="https://mds1455975151.github.io/tags/OpenLDAP/"/>
<category term="YAPI" scheme="https://mds1455975151.github.io/tags/YAPI/"/>
<category term="API管理" scheme="https://mds1455975151.github.io/tags/API%E7%AE%A1%E7%90%86/"/>
<category term="Opay" scheme="https://mds1455975151.github.io/tags/Opay/"/>
</entry>
<entry>
<title>Hello World</title>
<link href="https://mds1455975151.github.io/archives/4a17b156.html"/>
<id>https://mds1455975151.github.io/archives/4a17b156.html</id>
<published>2020-04-03T07:09:13.991Z</published>
<updated>2020-04-03T07:09:13.991Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><p>Welcome to <a href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/" target="_blank" rel="noopener">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a href="https://hexo.io/docs/troubleshooting.html" target="_blank" rel="noopener">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues" target="_blank" rel="noopener">GitHub</a>.</p><h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new <span class="string">"My New Post"</span></span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/writing.html" target="_blank" rel="noopener">Writing</a></p><h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/server.html" target="_blank" rel="noopener">Server</a></p><h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate</span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/generating.html" target="_blank" rel="noopener">Generating</a></p><h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo deploy</span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/deployment.html" target="_blank" rel="noopener">Deployment</a></p><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a> <img src="/archives/f7ea3e07/zhifubao.jpg" width="50%"></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/4a17b156.html">https://mds1455975151.github.io/archives/4a17b156.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" cla
</summary>
</entry>
<entry>
<title>运维监控体系总结</title>
<link href="https://mds1455975151.github.io/archives/a5e4dbc5.html"/>
<id>https://mds1455975151.github.io/archives/a5e4dbc5.html</id>
<published>2020-04-02T07:00:10.000Z</published>
<updated>2020-04-08T00:16:54.954Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><blockquote><p>运维监控体系总结</p></blockquote><p>总结归纳运维工作中的监控内容。</p><a id="more"></a><h1 id="监控目标"><a href="#监控目标" class="headerlink" title="监控目标"></a>监控目标</h1><p>明白监控的重要性以及使用监控要实现的业务目标<br>通常包括以下三点:</p><ul><li>对目标系统进行实时监控</li><li>监控可以实时反馈目标系统的当前状态<br>目标系统硬件、软件、业务是否正常、目前处于何种状态</li><li>保证目标系统可靠性,业务可以持续稳定运行<br>有问题第一时间反馈出来,便于运维人员处理</li></ul><h1 id="监控方法"><a href="#监控方法" class="headerlink" title="监控方法"></a>监控方法</h1><ul><li>了解监控对象<br>例如:CPU如何工作?</li><li>性能基准指标<br>例如: CPU使用率、负载、用户态、内核态、上下文切换</li><li>报警阈值定义<br>例如: CPU负载高的定义,内核态、用户态多少算高</li><li>故障处理流程<br>如何更高效处理故障的流程</li></ul><h1 id="监控核心"><a href="#监控核心" class="headerlink" title="监控核心"></a>监控核心</h1><ul><li>发现问题</li><li>定位问题</li><li>解决问题</li><li>总结问题,对故障原因及问题防范进行归纳总结,避免以后重复出现</li></ul><h1 id="监控工具"><a href="#监控工具" class="headerlink" title="监控工具"></a>监控工具</h1><ul><li>老牌监控<ul><li>Cacti</li><li>Nagios</li><li>smokeping</li><li>等等产品</li></ul></li><li>流行监控<ul><li>Zabbix</li><li>OpenFalcon</li><li>Prometheus+Grafana</li><li>滴滴开源夜莺Nightingale</li><li>smartping(专用于网络监控)</li><li>LEPUS天兔(专用于监控数据库)</li></ul></li><li>自研</li><li>第三方监控<ul><li>监控宝</li><li>听云</li></ul></li></ul><h1 id="监控流程"><a href="#监控流程" class="headerlink" title="监控流程"></a>监控流程</h1><ul><li>采集<br>通过SNMP、Agent、ICMP、SSH、IPMI等对系统进行数据采集</li><li>存储<br>各类数据库服务,MySQL、PostgreSQL</li><li>分析<br>提供图形及时间线情况信息,方便我们定位故障所在</li><li>展示<br>指标信息、指标趋势展示</li><li>报警<br>电话、邮件、微信、短信、报警升级机制</li><li>处理<br>故障级别判定,找响应人员进行快速处理</li></ul><h1 id="监控指标"><a href="#监控指标" class="headerlink" title="监控指标"></a>监控指标</h1><ul><li>硬件监控<ul><li>机器硬件:CPU温度、物理磁盘、虚拟磁盘、主板温度、磁盘阵列</li><li>IPMI工具无法获取到硬件的状态,可以借助MegaCli工具探测Raid磁盘队列状态</li><li><a href="https://www.ibm.com/developerworks/cn/linux/l-ipmi/" target="_blank" rel="noopener">https://www.ibm.com/developerworks/cn/linux/l-ipmi/</a></li></ul></li><li>系统监控<ul><li>主机存活</li><li>CPU、内存、硬盘、使用率</li><li>inode</li><li>负载</li><li>网卡出入带宽</li><li>TCP连接数</li><li>磁盘读写、只读</li></ul></li><li>应用监控<ul><li>MySQL<ul><li>服务可用性</li><li>内存使用率</li><li>磁盘使用</li><li>主从不同步及延迟</li><li>备份情况</li><li>连接数</li></ul></li><li>Redis、Redis Cluster<ul><li>负载</li><li>内存使用率</li><li>连接数量</li><li>qps</li></ul></li><li>Nginx<ul><li>状态码</li><li>连接状态信息</li></ul></li><li>RabbitMQ</li><li>PHP-FPM</li><li>OpenLDAP<ul><li>接入IP</li><li>调用次数</li></ul></li><li>Zimbra</li><li>OpenVPN<ul><li>版本信息、当前在线</li><li>用户、分配IP、客户端连接IP、通过IP获取地址位置、接收发送流量 连接时间 时长 连接ID</li></ul></li><li>ELK</li><li>Graylog</li><li>GitLab</li><li>Jenkins</li><li>MongoDB</li><li>HAproxy</li></ul></li><li>网络监控<ul><li>网络质量</li><li>公网出口</li><li>专线带宽</li><li>网络设备</li></ul></li><li>流量分析</li><li>日志监控</li><li>安全监控</li><li>URL、API监控<ul><li><a href="https://github.com/brotandgames/ciao" target="_blank" rel="noopener">https://github.com/brotandgames/ciao</a> 简单易用</li><li><a href="https://github.com/710leo/urlooker" target="_blank" rel="noopener">https://github.com/710leo/urlooker</a></li><li>自研</li><li>阿里云方案</li></ul></li><li>性能监控(APM)java|php|go|nodejs|分布式链路追踪<ul><li>PinPoint</li><li>Zipkin</li><li>SkyWalking</li><li>CAT、Jaeger</li></ul></li><li>业务监控<ul><li>电商业务为例<ul><li>每分钟产生多少订单</li><li>每分钟注册多少用户</li><li>每分钟多少活跃用户</li><li>每天有多少推广活动</li><li>推广活动引入多少用户</li><li>推广活动引入多少流量</li><li>推广活动引入多少利润</li></ul></li></ul></li><li>其他<ul><li>SSL证书监控</li><li>存活性 进程是否还在,端口监听、Log滚动</li><li>健康指标 MQ消息堆积量</li><li>接口监控 API成功率,延迟情况,QPS等等</li></ul></li></ul><h1 id="监控报警"><a href="#监控报警" class="headerlink" title="监控报警"></a>监控报警</h1><ul><li>邮件</li><li>短信</li><li>钉钉、微信、企业微信等其他即时通信软件</li><li>电话</li></ul><h1 id="报警处理"><a href="#报警处理" class="headerlink" title="报警处理"></a>报警处理</h1><ul><li>故障自愈: 服务器宕机自动启动。利用软件机制supervisor,systemd或者自定义脚本实现</li></ul><h1 id="面试监控"><a href="#面试监控" class="headerlink" title="面试监控"></a>面试监控</h1><ul><li>硬件监控<br>通过SNMP来进行路由器交换机的监控、其他内容使用IPMI实现。如果都是公有云,可以忽略这部分内容。案例:<a href="https://www.mdslq.cn/archives/186e54d8.html" target="_blank" rel="noopener">Open-Falcon监控H3C-ER3260G2路由器</a></li><li>系统监控</li><li>服务监控<ul><li>服务自带<ul><li>Nginx自带status模块</li><li>PHP相应status模块</li><li>MySQL利用percona官方工具进行监控</li></ul></li><li>通过自定义方法获取数据<ul><li>MySQL show global status xxx;</li><li>Redis info指令信息</li></ul></li></ul></li><li>网络监控(混合云架构)<ul><li>smokeping</li><li>smartping</li></ul></li><li>安全监控<ul><li>云服务直接用云安全组即可,或者补充本机iptables</li><li>硬件防火墙</li><li>Web服务使用Nginx+Lua实现Web层面的防火墙,或者Openresty</li></ul></li><li>日志监控<br>ELK、Graylog实现异常日志,错误日志关键字的监控</li><li>业务监控<br>确定监控指标,监控起来,业务不同各不相同</li><li>流量分析<br>建议使用百度统计,google统计,商业,研发嵌入代码实现。或者使用<a href="http://www.piwik.cn/" target="_blank" rel="noopener">piwik</a></li><li>可视化<br>dashboard</li><li>自动化监控<br>通过API,批量操作</li></ul><h1 id="监控总结"><a href="#监控总结" class="headerlink" title="监控总结"></a>监控总结</h1><p>完整的监控系统,需要对业务有详尽的了解,软件只是手段。</p><h1 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h1><ul><li><a href="https://blog.csdn.net/Z_GodGirl/article/details/81562455" target="_blank" rel="noopener">https://blog.csdn.net/Z_GodGirl/article/details/81562455</a></li></ul><p>======================================================<br>希望各位朋友支持一下</p><ul><li>领取我的<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=xpdsz87p&utm_source=xpdsz87p" target="_blank" rel="noopener">阿里云幸运券</a>,谢谢.</li><li>使用<a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=5a162632de40024cd01aabff4d3f1370" target="_blank" rel="noopener">腾讯云资源</a></li><li><a href="https://www.linode.com/?r=82f5a02930ac529c4176aff09c1513cf9e7b4418" target="_blank" rel="noopener">Linode VPS</a></li><li><a href="https://bandwagonhost.com/aff.php?aff=38634" target="_blank" rel="noopener">搬瓦工VPS</a></li><li>阿里云1888元云产品通用代金券<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=xpdsz87p" target="_blank" rel="noopener">点我</a></li><li>阿里云最新活动<a href="https://promotion.aliyun.com/ntms/act/vmpt/aliyun-group/home.html?userCode=xpdsz87p" target="_blank" rel="noopener">全民云计算升级-拼团上云更优惠</a></li><li><a href="https://www.toutiao.com/c/user/3916271538/#mid=1560038863835138" target="_blank" rel="noopener">今日头条</a></li></ul><p><strong>本文作者</strong>:dongsheng<br><strong>本文地址</strong>: <a href="https://mds1455975151.github.io/archives/a5e4dbc5.html">https://mds1455975151.github.io/archives/a5e4dbc5.html</a><br><strong>版权声明</strong>:转载请注明出处!</p>]]></content>
<summary type="html">
运维监控体系总结
</summary>
<category term="监控" scheme="https://mds1455975151.github.io/tags/%E7%9B%91%E6%8E%A7/"/>
<category term="Zabbix" scheme="https://mds1455975151.github.io/tags/Zabbix/"/>
</entry>
</feed>