-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.xml
More file actions
204 lines (171 loc) · 14.4 KB
/
index.xml
File metadata and controls
204 lines (171 loc) · 14.4 KB
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
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>HGFKEEP</title>
<link>https://hgfkeep.github.io/</link>
<description>Recent content on HGFKEEP</description>
<generator>Hugo -- gohugo.io</generator>
<language>zh-cn</language>
<lastBuildDate>Sat, 25 Jan 2020 16:33:26 +0800</lastBuildDate>
<atom:link href="https://hgfkeep.github.io/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>更新kubernetes 过期证书</title>
<link>https://hgfkeep.github.io/posts/%E6%9B%B4%E6%96%B0kubernetes%E8%AF%81%E4%B9%A6/</link>
<pubDate>Sat, 25 Jan 2020 16:33:26 +0800</pubDate>
<guid>https://hgfkeep.github.io/posts/%E6%9B%B4%E6%96%B0kubernetes%E8%AF%81%E4%B9%A6/</guid>
<description>更新kubernetes 过期证书 kubeadm 版本在kubernetes 1.15 版本 提供了强大的证书管理功能,本文章适用于kubernetes1.15以下版本(文章中kubernetes版本是1.13.2)。
1.15 版本的证书管理相关文档:
官方文档-使用 kubeadm 进行证书管理 [官方文档-kubeadm alpha 使用说明]9https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-alpha/) 查看证书有效期方法:
openssl x509 -in /etc/kubernetes/pki/apiserver.crt -noout -text |grep &#39; Not &#39; ⚠️ kubeadm 默认生成的ca证书有效期是10年,其他证书(如etcd证书,apiserver证书)有效期均为1年。
更新证书和配置 整体思路:
备份:在进行证书更新前,建议备份/etc/kubernetes,防止操作失误。 更新证书:使用kubeadm alpha certs renew重新生成证书。仅更新***.key文件,需要原始的crt文件才能生成对应的key文件。 更新配置:使用kubeadm init phase kubeconfig all --config ${kubeadm.yaml配置文件}或者kubeadm alpha kubeconfig user 命令。 ⚠️ 不同版本的kubeadm对于证书renew的命令有细微的差异,具体情况需要依据已经安装的kubeadm来判断。通过命令行kubeadm alpha certs renew --help输出类似如下信息: 证书更新策略:
单主节点:可以直接运行kubeadm alpha certs renew all --config kubeadm.yaml完成证书更新。然后替换kubelet配置 多主节点:建议使用原ca证书(有效期10年),每个组件(etcd、apiserver 等)单独更新。 多master节点证书更新 备份原始配置和证书 所有master节点运行命令:cp -r /etc/kubernetes /home/heguangfu/kubernetes</description>
</item>
<item>
<title>Mybatis工作原理分析</title>
<link>https://hgfkeep.github.io/posts/mybatis%E5%B7%A5%E4%BD%9C%E5%8E%9F%E7%90%86%E5%88%86%E6%9E%90/</link>
<pubDate>Mon, 08 Jul 2019 16:11:33 +0800</pubDate>
<guid>https://hgfkeep.github.io/posts/mybatis%E5%B7%A5%E4%BD%9C%E5%8E%9F%E7%90%86%E5%88%86%E6%9E%90/</guid>
<description>解析配置 mybatis的配置类为 org.apache.ibatis.session.Configuration ,包括了构造 SqlSessionFactory 所需的所有参数。
所以为了顺利的构造出 SqlSessionFactory,必须先构造 org.apache.ibatis.session.Configuration 。该配置可以通过xml解析器(mybatis内建 XMLConfigBuilder 解析处理xml配置)构造。
MapperFactoryBean获取mapper接口代理类 `MapperFactoryBean`提供了对mapper配置文件的校验和mapper对象的生成,是mapper的工厂对象。
1 public class MapperFactoryBean&lt;T&gt; extends SqlSessionDaoSupport implements FactoryBean&lt;T&gt; 继承了`SqlSessionDaoSupport`,该类又实现了`InitializingBean`,可知类的逻辑初始化在`afterPropertiesSet()`:
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 //模版初始化方法 public final void afterPropertiesSet() throws IllegalArgumentException, BeanInitializationException { // 抽象父类定义检查配置 checkDaoConfig(); // 具体实现类的模版初始化方法 try { initDao(); } catch (Exception ex) { throw new BeanInitializationException("</description>
</item>
<item>
<title>Java stack信息</title>
<link>https://hgfkeep.github.io/posts/java_stack%E4%BF%A1%E6%81%AF/</link>
<pubDate>Mon, 01 Jul 2019 20:58:41 +0800</pubDate>
<guid>https://hgfkeep.github.io/posts/java_stack%E4%BF%A1%E6%81%AF/</guid>
<description>线程状态 NEW: 新建线程
RUNNABLE: 在虚拟机内运行
BLOCKED: 受阻塞并等待监视器锁,
WAITING: 无限期等待,wait()
TIMED_WAITING: 有限时间的等待,wait(timeout)
TERMINATED: 已退出
Monitor 在多线程的 JAVA程序中,实现线程之间的同步,就要说说 Monitor。
Monitor是 Java中用以实现线程之间的互斥与协作的主要手段,它可以看成是对象或者 Class的锁。每一个对象都有,也仅有一个 monitor。下图,描述了线程和 Monitor之间关系,以 及线程的状态转换图:
进入区(Entrt Set):表示线程通过synchronized要求获取对象的锁。如果对象未被锁住,则进入入拥有者;否则则在进入区等待。一旦对象锁被其他线程释放,立即参与竞争。
拥有者(The Owner):表示某一线程成功竞争到对象锁。
等待区(Wait Set):表示线程通过对象的wait方法,释放对象的锁,并在等待区等待被唤醒。
一个 Monitor在某个时刻,只能被一个线程拥有,该线程就是 “Active Thread”,而其它线程都是 “Waiting Thread”,分别在两个队列 “ Entry Set”和 “Wait Set”里面等候。在 “Entry Set”中等待的线程状态是 “Waiting for monitor entry”,而在 “Wait Set”中等待的线程状态是 “in Object.</description>
</item>
<item>
<title>Java性能分析工具</title>
<link>https://hgfkeep.github.io/posts/java%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96%E5%B7%A5%E5%85%B7/</link>
<pubDate>Sun, 30 Jun 2019 17:53:59 +0800</pubDate>
<guid>https://hgfkeep.github.io/posts/java%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96%E5%B7%A5%E5%85%B7/</guid>
<description>性能分析的前提是将程序的运行状况以及应用的运行环境状况以一种可视化的方式直接的展示出来,那如何实现可视化的展示呢?
本文主要从操作系统提供的工具、java内置的工具和java mission control介绍java性能分析工具。
操作系统工具 操作系统中的工具并非是只针对java的,适合所有程序。
在操作系统中,利用工具收集系统中的各类资源的监控数据,包括:
CPU 内存 磁盘 网络 只有收集的数据更充分,新能测试的结果才会更准确。
CPU使用率 CPU使用时间分为:
用户时间(User Time):CPU执行用户应用程序的时间 系统时间(System Time):CPU执行操作系统内核代码的时间。一般与硬件资源打交道,都需要执行内核代码,例如从磁盘读取数据、发送网络请求等。 CPU的调优目标是单位时间内最大限度的提高CPU利用率。
分析思路 在linux操作系统中,执行 vmstat 5, 结果如下:
procs -----------memory--------------- ----swap---- ---io--- -----system------ ----------CPU------- r b swpd free buff cache si so bi bo in cs us sy id wa st 2 0 236456 2259632 200052 730348 0 0 1 6 1 1 37 8 55 0 0 2 0 236456 2259624 200052 730348 0 0 0 10 179 332 40 7 53 0 0 2 0 236456 2259624 200052 730348 0 0 0 20 180 356 56 7 37 0 0 从输出结果可知,第一次输出的5s内,CPU一共执行 $ (37\% + 8\%) * 5s=2.</description>
</item>
<item>
<title>asciidoctor格式</title>
<link>https://hgfkeep.github.io/posts/asciidoctor%E6%A0%BC%E5%BC%8F/</link>
<pubDate>Wed, 26 Jun 2019 12:21:02 +0800</pubDate>
<guid>https://hgfkeep.github.io/posts/asciidoctor%E6%A0%BC%E5%BC%8F/</guid>
<description>格式化文本 加粗斜体等宽 加粗斜体等宽可组合叠加
例如:
_italic phrase_ __i__talic le__tt__ers *bold phrase* **b**old le**tt**ers *_bold italic phrase_* **__b__**old italic le**__tt__**ers `monospace phrase` and le``tt``ers `_monospace italic phrase_` and le``__tt__``ers `*monospace bold phrase*` and le``**tt**``ers `*_monospace bold italic phrase_*` and le``**__tt__**``ers italic phrase
italic letters
bold phrase
bold letters
bold italic phrase
bold italic letters
monospace phrase and letters
monospace italic phrase and letters</description>
</item>
<item>
<title>使用hugo创建博客</title>
<link>https://hgfkeep.github.io/posts/%E4%BD%BF%E7%94%A8hugo%E5%88%9B%E5%BB%BA%E5%8D%9A%E5%AE%A2/</link>
<pubDate>Tue, 25 Jun 2019 16:33:26 +0800</pubDate>
<guid>https://hgfkeep.github.io/posts/%E4%BD%BF%E7%94%A8hugo%E5%88%9B%E5%BB%BA%E5%8D%9A%E5%AE%A2/</guid>
<description>使用hugo创建博客 使用 hugo + asciidoc(tor)实现静态博客、代码高亮、图标等。 hugo site构建使用镜像完成。 github部署静态博客。 travis-ci 持续集成和部署。 有用的链接 hugo github docker hub asciidoctor travis 博客配置 主要配置hugo和asciidoctor的触发协同构建。
思路 hugo external helpers 提供外部格式化支持。通过官网给出的文档和hugo的源代码,知道hugo是根据文件后缀使用external helpers取格式化文件。
文件起始的头部描述信息和markdnwon一样。
使用external helpers时,必须安装对应的工具,比如hugo+asciidoc(tor)就需要安装asciidoc(tor)。
所以需要使用hugo + asciidoc(tor)编译文档时,只需要将文件后缀改成asciidoc,adoc或者ad,hugo在构建site的时候,会自动的调用外部工具编译文件。
external helpers支持情况 各类型文件后缀主持如下:
markdown的文件: md markdown markdown asciidoc文件: asciidoc adoc ad mmark文件: mmark rst文件: rdt html文件: htm html 配置样式 编辑hugo 根目录下面的config.</description>
</item>
<item>
<title>如何使用typora编写Hugo draft</title>
<link>https://hgfkeep.github.io/posts/how-to-write-draft-in-hugo/</link>
<pubDate>Tue, 25 Jun 2019 16:33:26 +0800</pubDate>
<guid>https://hgfkeep.github.io/posts/how-to-write-draft-in-hugo/</guid>
<description><p>本文主要讲解如何使用typora编写hugo 文章,达到本地编辑实时预览,和真正部署的结果一致。</p></description>
</item>
<item>
<title></title>
<link>https://hgfkeep.github.io/posts/%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F%E5%9B%9E%E6%BA%AF%E9%97%AE%E9%A2%98/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://hgfkeep.github.io/posts/%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F%E5%9B%9E%E6%BA%AF%E9%97%AE%E9%A2%98/</guid>
<description>draft: true title: &ldquo;正则表达式回溯问题&rdquo; date: 2019-07-09T19:12:59+08:00 slug: &ldquo;&rdquo; lastmod: 2019-07-09T19:12:59+08:00 keywords: [] description: &ldquo;&rdquo; tags: [] categories: [] series: [] author: &ldquo;heguangfu&rdquo; katex: true
comment: true toc: true autoCollapseToc: true postMetaInFooter: true hiddenFromHomePage: false contentCopyright: &ldquo;感谢阅读,如果有问题请您留言,我会及时改正 本博客所有原创文章版权归hgf所有,转载请注明出处hgfkeep.github.io&rdquo; reward: false mathjax: true mathjaxEnableSingleDollar: true mathjaxEnableAutoNumber: true
flowchartDiagrams: enable: false options: &ldquo;&rdquo;
sequenceDiagrams: enable: false options: &ldquo;&rdquo;
typora-root-url: ../../static
发现问题 监控预警CPU占用100%。
查看java进程中那个线程造成CPU100%: top -p&lt;pid&gt; -H, 依据线程id,生成jstack信息中的nid(n表示native,线程id,十六进制表示): python -c&quot;print hex(9757)” dump JVM堆栈,查看造成CPU 100%问题的线程堆栈。 仅排查,发现:</description>
</item>
<item>
<title>Contact</title>
<link>https://hgfkeep.github.io/contact/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://hgfkeep.github.io/contact/</guid>
<description>👏Follow me:
@github @docker hub email:hgfkeep@gmail.com </description>
</item>
<item>
<title>Contact</title>
<link>https://hgfkeep.github.io/contact/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://hgfkeep.github.io/contact/</guid>
<description>👏欢迎关注:
@github @docker hub email:hgfkeep@gmail.com </description>
</item>
<item>
<title>Projects</title>
<link>https://hgfkeep.github.io/projects/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://hgfkeep.github.io/projects/</guid>
<description>Nothing to see here&hellip; Move along!</description>
</item>
<item>
<title>Projetos</title>
<link>https://hgfkeep.github.io/projects/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://hgfkeep.github.io/projects/</guid>
<description>Em construção&hellip; Aguarde!</description>
</item>
<item>
<title>关于</title>
<link>https://hgfkeep.github.io/about/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://hgfkeep.github.io/about/</guid>
<description>👏欢迎您!
我是heguangfu。
Thanks for reading!🙏</description>
</item>
<item>
<title>🚩Flag 2020</title>
<link>https://hgfkeep.github.io/flag/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://hgfkeep.github.io/flag/</guid>
<description> Flag learn rust深入浅出 rust track ES-极客时间 设计模式-极客时间 des &amp; dev rust markdown rust KV cache source code kafka es arrangement Weekly 2 rust track Monthly 2 design pattern </description>
</item>
<item>
<title>🚩Flag 2020</title>
<link>https://hgfkeep.github.io/flag/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://hgfkeep.github.io/flag/</guid>
<description> Flag 学习 rust深入浅出 rust track ES-极客时间 设计模式-极客时间 开发 rust markdown rust KV cache 源代码 kafka 阅读 es 阅读 周期安排 每周 2个rust track 每月 2个设计模式 </description>
</item>
</channel>
</rss>