Skip to content

Commit adf64ef

Browse files
committed
优化seo
1 parent e637160 commit adf64ef

File tree

4 files changed

+135
-6
lines changed

4 files changed

+135
-6
lines changed

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"license": "MIT",
1515
"devDependencies": {
1616
"markdown-it-disable-url-encode": "^1.0.1",
17-
"vuepress": "^1.9.10"
17+
"vuepress": "^1.9.10",
18+
"vuepress-plugin-autometa": "^0.1.13",
19+
"vuepress-plugin-sitemap": "^2.3.1"
1820
}
1921
}

text/.vuepress/config.js

+16
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
const toc = require('./toc')
22
const base = process.env.CI ? '/nodebook/' : '/'
3+
const baseUrl = 'https://blog.whyun.com/nodebook'
34
module.exports = {
45
 title: 'nodebook',
56
 description: 'Node 基础教程',
67
base,
78
dest: 'output',
89
markdown: {
910
lineNumbers: true,
11+
externalLinks: { target: '_blank', rel: 'nofollow noopener noreferrer' },
1012
extendMarkdown: md => {
1113
md.use(require('markdown-it-disable-url-encode'));
1214
}
@@ -28,6 +30,20 @@ module.exports = {
2830
    { text: 'github', link: 'https://github.com/yunnysunny/nodebook' },
2931
    { text: '博客', link: 'https://blog.whyun.com' },
3032
  ]
33+
},
34+
plugins:{
35+
autometa: {
36+
site: {
37+
name: 'nodebook',
38+
twitter: 'yunnysunny',
39+
},
40+
canonical_base: baseUrl,
41+
},
42+
// 'sitemap': {
43+
// hostname: baseUrl,
44+
// // 排除无实际内容的页面
45+
// exclude: ["/404.html"]
46+
// }
3147
}
3248

3349
}

text/a7_easy_monitor_setup.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ grant all privileges on xprofiler_console.* to 'easy'@'%';
3838
grant all privileges on xprofiler_logs.* to 'easy'@'%';
3939
flush privileges;
4040
```
41-
#### 7.3.2 启动服务器端
42-
##### 7.3.2.1 启动容器
41+
#### A 7.3.2 启动服务器端
42+
##### A 7.3.2.1 启动容器
4343
为了简化部署,笔者做了一个集成 xtransit-server xprofiler-console xtransit-mannager 三个服务的 docker 容器,是基于官方的 [all-in-one](https://github.com/X-Profiler/all-in-one) 项目优化而来。之所以重新做一个镜像出来,是由于官方镜像将配置信息采用磁盘文件映射的方式来提供,不是很贴合传统运维使用习惯,所以这里提供了一版全部通过环境变量来设置的镜像。
4444
> 镜像项目地址为 [whyun-docker/node (github.com)](https://github.com/whyun-docker/node)
4545
@@ -58,7 +58,7 @@ REDIS_PASSWORD=redis 密码
5858
CONSOLE_BASE_URL=console 服务的访问地址,例如 http://xxx-console.domian.com
5959
```
6060
然后我们可以通过 `sudo docker run --env-file ./.env -p 8443:8443 -p 8543:8543 -p 9190:9190 --name=easy-monitor -d yunnysunny/easy-monitor` 来启动服务。
61-
##### 7.3.2.2 配置nginx
61+
##### A 7.3.2.2 配置nginx
6262
如果当前网络拓扑结构中不需要配置 nginx,可以跳过此小节。如果需要配置 nginx 的话,则需要添加反向代理配置。其中对于 xprofiler-console 来说给出如下配置示例:
6363
```nginx
6464
server
@@ -112,7 +112,7 @@ server
112112
}
113113
```
114114
首先反向代理的的 HTTP 协议版本要选择 1.1,其次要设置 Upgrade 和 Connection 两个头信息来请求 Node 服务,否则无法正常完成 WebSocket 的握手过程。
115-
### 7.4 配置客户端
115+
### A 7.4 配置客户端
116116
为了方便读者使用,这里我将继承 xtransit 继承的 node 镜像也制作出来了。可以先通过一个 dockerfile 文件了解一下使用步骤:
117117
```dockerfile
118118
ARG IMAGE_VERSION
@@ -151,9 +151,14 @@ require('xprofiler').start();
151151
```
152152
> xprofiler 安装时要下载原生代码的预编译库,默认从 github 下载,考虑到众所周知原因,下载比较慢。`yunnysunny/node-xtransit` 镜像基于 `yunnysunny/node` 构建,里面配置 npm config 选项,将其下载地址指向阿里云,有效的解决了这个问题。
153153
154+
### A 7.5 疑难解答
155+
#### A 7.5.1 找不到应用实例
156+
154157
如果构建完镜像后,容器运行完之后,xprofile-console 后台中迟迟看不到启动容器的监控实例。则需要查看容器的 ~/.xtransit.log 文件,比如说在启用 nginx 的情况下,反向代理配置错误,忘记添加 Upgrade 头信息了,就会报如下错误:
155158
```
156159
[2024-01-19 01:31:10] [2.4.1] [info] [36] websocket client connecting to ws://ezm-ws.your-domain.com...
157160
[2024-01-19 01:31:10] [2.4.1] [warn] [36] websocket client error: Error: Unexpected server response: 404.
158161
```
159-
通过日志我们就可以更快的定位问题所在。
162+
通过日志我们就可以更快的定位问题所在。
163+
### A 7.6 未尽事宜
164+
由于本篇教程仅仅涉及部署内容,关于 easy-monitor 的操作指南,还请参照[官方文档](https://www.yuque.com/hyj1991/easy-monitor)

yarn.lock

+106
Original file line numberDiff line numberDiff line change
@@ -5393,6 +5393,11 @@ lodash._reinterpolate@^3.0.0:
53935393
resolved "https://registry.npmmirror.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
53945394
integrity sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA==
53955395

5396+
lodash.chunk@^4.2.0:
5397+
version "4.2.0"
5398+
resolved "https://registry.npmmirror.com/lodash.chunk/-/lodash.chunk-4.2.0.tgz#66e5ce1f76ed27b4303d8c6512e8d1216e8106bc"
5399+
integrity sha512-ZzydJKfUHJwHa+hF5X66zLFCBrWn5GeF28OHEr4WVWtNDXlQ/IjWKPBiikqKo2ne0+v6JgCgJ0GzJp8k8bHC7w==
5400+
53965401
lodash.clonedeep@^4.5.0:
53975402
version "4.5.0"
53985403
resolved "https://registry.npmmirror.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef"
@@ -5403,6 +5408,21 @@ lodash.debounce@^4.0.8:
54035408
resolved "https://registry.npmmirror.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
54045409
integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==
54055410

5411+
5412+
version "4.6.1"
5413+
resolved "https://registry.npmmirror.com/lodash.defaultsdeep/-/lodash.defaultsdeep-4.6.1.tgz#512e9bd721d272d94e3d3a63653fa17516741ca6"
5414+
integrity sha512-3j8wdDzYuWO3lM3Reg03MuQR957t287Rpcxp1njpEa8oDrikb+FwGdW3n+FELh/A6qib6yPit0j/pv9G/yeAqA==
5415+
5416+
5417+
version "4.6.0"
5418+
resolved "https://registry.npmmirror.com/lodash.findindex/-/lodash.findindex-4.6.0.tgz#a3245dee61fb9b6e0624b535125624bb69c11106"
5419+
integrity sha512-9er6Ccz6sEST3bHFtUrCFWk14nE8cdL/RoW1RRDV1BxqN3qsmsT56L14jhfctAqhVPVcdJw4MRxEaVoAK+JVvw==
5420+
5421+
5422+
version "4.4.0"
5423+
resolved "https://registry.npmmirror.com/lodash.isempty/-/lodash.isempty-4.4.0.tgz#6f86cbedd8be4ec987be9aaf33c9684db1b31e7e"
5424+
integrity sha512-oKMuF3xEeqDltrGMfDxAPGIVMSSRv8tbRSODbrs4KGsRRLEhrW8N8Rd4DRgB2+621hY8A8XwwrTVhXWpxFvMzg==
5425+
54065426
lodash.kebabcase@^4.1.1:
54075427
version "4.1.1"
54085428
resolved "https://registry.npmmirror.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36"
@@ -5413,6 +5433,16 @@ lodash.memoize@^4.1.2:
54135433
resolved "https://registry.npmmirror.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"
54145434
integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==
54155435

5436+
lodash.padstart@^4.6.1:
5437+
version "4.6.1"
5438+
resolved "https://registry.npmmirror.com/lodash.padstart/-/lodash.padstart-4.6.1.tgz#d2e3eebff0d9d39ad50f5cbd1b52a7bce6bb611b"
5439+
integrity sha512-sW73O6S8+Tg66eY56DBk85aQzzUJDtpoXFBgELMd5P/SotAguo+1kYO6RuYgXxA4HJH3LFTFPASX6ET6bjfriw==
5440+
5441+
lodash.sortby@^4.7.0:
5442+
version "4.7.0"
5443+
resolved "https://registry.npmmirror.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
5444+
integrity sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==
5445+
54165446
lodash.template@^4.5.0:
54175447
version "4.5.0"
54185448
resolved "https://registry.npmmirror.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab"
@@ -5428,6 +5458,16 @@ lodash.templatesettings@^4.0.0:
54285458
dependencies:
54295459
lodash._reinterpolate "^3.0.0"
54305460

5461+
lodash.trimend@^4.5.1:
5462+
version "4.5.1"
5463+
resolved "https://registry.npmmirror.com/lodash.trimend/-/lodash.trimend-4.5.1.tgz#12804437286b98cad8996b79414e11300114082f"
5464+
integrity sha512-lsD+k73XztDsMBKPKvzHXRKFNMohTjoTKIIo4ADLn5dA65LZ1BqlAvSXhR2rPEC3BgAUQnzMnorqDtqn2z4IHA==
5465+
5466+
lodash.trimstart@^4.5.1:
5467+
version "4.5.1"
5468+
resolved "https://registry.npmmirror.com/lodash.trimstart/-/lodash.trimstart-4.5.1.tgz#8ff4dec532d82486af59573c39445914e944a7f1"
5469+
integrity sha512-b/+D6La8tU76L/61/aN0jULWHkT0EeJCmVstPBn/K9MtD2qBW83AsBNrr63dKuWYwVMO7ucv13QNO/Ek/2RKaQ==
5470+
54315471
lodash.uniq@^4.5.0:
54325472
version "4.5.0"
54335473
resolved "https://registry.npmmirror.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
@@ -7004,6 +7044,11 @@ [email protected]:
70047044
resolved "https://registry.npmmirror.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9"
70057045
integrity sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==
70067046

7047+
7048+
version "0.3.0"
7049+
resolved "https://registry.npmmirror.com/remove-markdown/-/remove-markdown-0.3.0.tgz#5e4b667493a93579728f3d52ecc1db9ca505dc98"
7050+
integrity sha512-5392eIuy1mhjM74739VunOlsOYKjsH82rQcTBlJ1bkICVC3dQ3ksQzTHh4jGHQFnM+1xzLzcFOMH+BofqXhroQ==
7051+
70077052
remove-trailing-separator@^1.0.1:
70087053
version "1.1.0"
70097054
resolved "https://registry.npmmirror.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef"
@@ -7394,6 +7439,16 @@ simple-swizzle@^0.2.2:
73947439
dependencies:
73957440
is-arrayish "^0.3.1"
73967441

7442+
sitemap@^3.0.0:
7443+
version "3.2.2"
7444+
resolved "https://registry.npmmirror.com/sitemap/-/sitemap-3.2.2.tgz#3f77c358fa97b555c879e457098e39910095c62b"
7445+
integrity sha512-TModL/WU4m2q/mQcrDgNANn0P4LwprM9MMvG4hu5zP4c6IIKs2YLTu6nXXnNr8ODW/WFtxKggiJ1EGn2W0GNmg==
7446+
dependencies:
7447+
lodash.chunk "^4.2.0"
7448+
lodash.padstart "^4.6.1"
7449+
whatwg-url "^7.0.0"
7450+
xmlbuilder "^13.0.0"
7451+
73977452
slash@^1.0.0:
73987453
version "1.0.0"
73997454
resolved "https://registry.npmmirror.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"
@@ -7746,6 +7801,11 @@ strip-json-comments@~2.0.1:
77467801
resolved "https://registry.npmmirror.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
77477802
integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==
77487803

7804+
7805+
version "3.1.1"
7806+
resolved "https://registry.npmmirror.com/striptags/-/striptags-3.1.1.tgz#c8c3e7fdd6fb4bb3a32a3b752e5b5e3e38093ebd"
7807+
integrity sha512-3HVl+cOkJOlNUDAYdoCAfGx/fzUzG53YvJAl3RYlTvAcBdPqSp1Uv4wrmHymm7oEypTijSQqcqplW8cz0/r/YA==
7808+
77497809
stylehacks@^4.0.0:
77507810
version "4.0.3"
77517811
resolved "https://registry.npmmirror.com/stylehacks/-/stylehacks-4.0.3.tgz#6718fcaf4d1e07d8a1318690881e8d96726a71d5"
@@ -7972,6 +8032,13 @@ tough-cookie@~2.5.0:
79728032
psl "^1.1.28"
79738033
punycode "^2.1.1"
79748034

8035+
tr46@^1.0.1:
8036+
version "1.0.1"
8037+
resolved "https://registry.npmmirror.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09"
8038+
integrity sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==
8039+
dependencies:
8040+
punycode "^2.1.0"
8041+
79758042
79768043
version "0.0.0"
79778044
resolved "https://registry.npmmirror.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
@@ -8417,6 +8484,19 @@ vuepress-html-webpack-plugin@^3.2.0:
84178484
toposort "^1.0.0"
84188485
util.promisify "1.0.0"
84198486

8487+
vuepress-plugin-autometa@^0.1.13:
8488+
version "0.1.13"
8489+
resolved "https://registry.npmmirror.com/vuepress-plugin-autometa/-/vuepress-plugin-autometa-0.1.13.tgz#44a63e9fefb4feff88c00678d4d2b3d8e413209d"
8490+
integrity sha512-yhd8smLhbCO0+gc3FRNjOyffdGl12gUkv60UqdtEUCojEy4s7APDJ2pt85cSLASMdnWaY7EcMibMRkqeUOVAKg==
8491+
dependencies:
8492+
lodash.defaultsdeep "4.6.1"
8493+
lodash.findindex "4.6.0"
8494+
lodash.isempty "4.4.0"
8495+
lodash.trimend "^4.5.1"
8496+
lodash.trimstart "^4.5.1"
8497+
remove-markdown "0.3.0"
8498+
striptags "3.1.1"
8499+
84208500
vuepress-plugin-container@^2.0.2:
84218501
version "2.1.5"
84228502
resolved "https://registry.npmmirror.com/vuepress-plugin-container/-/vuepress-plugin-container-2.1.5.tgz#37fff05662fedbd63ffd3a5463b2592c7a7f3133"
@@ -8425,6 +8505,13 @@ vuepress-plugin-container@^2.0.2:
84258505
"@vuepress/shared-utils" "^1.2.0"
84268506
markdown-it-container "^2.0.0"
84278507

8508+
vuepress-plugin-sitemap@^2.3.1:
8509+
version "2.3.1"
8510+
resolved "https://registry.npmmirror.com/vuepress-plugin-sitemap/-/vuepress-plugin-sitemap-2.3.1.tgz#51298aca77a5de96396fdbd1103e1637dd61ae6a"
8511+
integrity sha512-n+8lbukhrKrsI9H/EX0EBgkE1pn85LAQFvQ5dIvrZP4Kz6JxPOPPNTQmZMhahQV1tXbLZQCEN7A1WZH4x+arJQ==
8512+
dependencies:
8513+
sitemap "^3.0.0"
8514+
84288515
vuepress-plugin-smooth-scroll@^0.0.3:
84298516
version "0.0.3"
84308517
resolved "https://registry.npmmirror.com/vuepress-plugin-smooth-scroll/-/vuepress-plugin-smooth-scroll-0.0.3.tgz#6eff2d4c186cca917cc9f7df2b0af7de7c8c6438"
@@ -8470,6 +8557,11 @@ wbuf@^1.1.0, wbuf@^1.7.3:
84708557
dependencies:
84718558
minimalistic-assert "^1.0.0"
84728559

8560+
webidl-conversions@^4.0.2:
8561+
version "4.0.2"
8562+
resolved "https://registry.npmmirror.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"
8563+
integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==
8564+
84738565
webpack-chain@^4.9.0:
84748566
version "4.12.1"
84758567
resolved "https://registry.npmmirror.com/webpack-chain/-/webpack-chain-4.12.1.tgz#6c8439bbb2ab550952d60e1ea9319141906c02a6"
@@ -8616,6 +8708,15 @@ websocket-extensions@>=0.1.1:
86168708
resolved "https://registry.npmmirror.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42"
86178709
integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==
86188710

8711+
whatwg-url@^7.0.0:
8712+
version "7.1.0"
8713+
resolved "https://registry.npmmirror.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06"
8714+
integrity sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==
8715+
dependencies:
8716+
lodash.sortby "^4.7.0"
8717+
tr46 "^1.0.1"
8718+
webidl-conversions "^4.0.2"
8719+
86198720
when@~3.6.x:
86208721
version "3.6.4"
86218722
resolved "https://registry.npmmirror.com/when/-/when-3.6.4.tgz#473b517ec159e2b85005497a13983f095412e34e"
@@ -8705,6 +8806,11 @@ xdg-basedir@^4.0.0:
87058806
resolved "https://registry.npmmirror.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13"
87068807
integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==
87078808

8809+
xmlbuilder@^13.0.0:
8810+
version "13.0.2"
8811+
resolved "https://registry.npmmirror.com/xmlbuilder/-/xmlbuilder-13.0.2.tgz#02ae33614b6a047d1c32b5389c1fdacb2bce47a7"
8812+
integrity sha512-Eux0i2QdDYKbdbA6AM6xE4m6ZTZr4G4xF9kahI2ukSEMCzwce2eX9WlTI5J3s+NU7hpasFsr8hWIONae7LluAQ==
8813+
87088814
xtend@^4.0.0, xtend@~4.0.1:
87098815
version "4.0.2"
87108816
resolved "https://registry.npmmirror.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"

0 commit comments

Comments
 (0)