From 5ccb0a460ff611045c0854ea92ffe88db5f1daff Mon Sep 17 00:00:00 2001 From: pengshiyu <1940607002@qq.com> Date: Fri, 10 Jun 2022 23:07:58 +0800 Subject: [PATCH] fix --- _sidebar.md | 1 + blog/elasticsearch/install.md | 94 ++++++++++++++++++++++++++++++++++- doc/chrome.md | 3 ++ index.html | 1 + static/js/prism-yaml.min.js | 1 + 5 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 doc/chrome.md create mode 100644 static/js/prism-yaml.min.js diff --git a/_sidebar.md b/_sidebar.md index 31446f5..53f3083 100644 --- a/_sidebar.md +++ b/_sidebar.md @@ -34,3 +34,4 @@ - 其他 - [其他](doc/index.md) + - [chrome](doc/chrome.md) \ No newline at end of file diff --git a/blog/elasticsearch/install.md b/blog/elasticsearch/install.md index 50a7fea..54bda61 100644 --- a/blog/elasticsearch/install.md +++ b/blog/elasticsearch/install.md @@ -222,6 +222,97 @@ Kibana server is not ready yet ## 4、安装ElasticSearch-Head插件 +### 4.1、安装Node.js + +下载地址:[https://nodejs.org/zh-cn/download/](https://nodejs.org/zh-cn/download/) + +推荐使用: [nvm](https://github.com/nvm-sh/nvm) 来管理node.js版本 + +```bash +# 查看版本 +node -v +v16.14.0 +``` + +### 4.2、下载 elasticsearch-head + +- [http://mobz.github.io/elasticsearch-head/](http://mobz.github.io/elasticsearch-head/) + +- [https://github.com/mobz/elasticsearch-head](https://github.com/mobz/elasticsearch-head) + + + +clone 代码 +```bash +git clone git://github.com/mobz/elasticsearch-head.git + +cd elasticsearch-head +``` + +或者下载elasticsearch-head-master.zip 压缩包 + +```bash +wget https://github.com/mobz/elasticsearch-head/archive/refs/heads/master.zip -O elasticsearch-head-master.zip + +# 解压 +unzip elasticsearch-head-master.zip + +cd elasticsearch-head-master +``` + + +修改配置(可以略过) + +```js +// Gruntfile.js +module.exports = function(grunt) { + grunt.initConfig({ + connect: { + server: { + options: { + // 添加配置项,可以外网访问 + hostname: '*', + + port: 9100, + base: '.', + keepalive: true + } + } + } + }); +}; + +``` + +```bash +# 安装依赖 +pnpm i + +# 启动服务, 需要提前启动 elasticsearch +npm run start +``` + +查看地址:http://localhost:9100/ + +### 4.3、问题: + +如果无法发现ES节点,尝试修改ES配置文件,允许跨域 + +```yaml +# config/elasticsearch.yml +# 允许跨域 +http.cors.enabled: true +http.cors.allow-origin: "*" +``` + +### 4.4、从Chrome应用商店安装 + +- ElasticSearch Head 0.1.4: [elasticsearch-head-chrome](https://github.com/TravisTX/elasticsearch-head-chrome) + +- ElasticSearch Head v0.1.5: [https://crxdl.com/](https://crxdl.com/) 搜索:ffmkiejjmecolpfloofpjologoblkegm + +备用地址:[https://github.com/mouday/ElasticSearch-Head.crx](https://github.com/mouday/ElasticSearch-Head.crx) + ## 5、不同编程语言的客户端 https://www.elastic.co/guide/en/elasticsearch/client/index.html @@ -274,5 +365,4 @@ server { } ``` -https://www.bilibili.com/video/BV1LY4y167n5?p=3&spm_id_from=pageDriver - +https://www.bilibili.com/video/BV1LY4y167n5?p=5&spm_id_from=pageDriver&vd_source=efbb4dc944fa761b6e016ce2ca5933da \ No newline at end of file diff --git a/doc/chrome.md b/doc/chrome.md new file mode 100644 index 0000000..2f39bed --- /dev/null +++ b/doc/chrome.md @@ -0,0 +1,3 @@ +# Chrome + +插件下载:[https://crxdl.com/](https://crxdl.com/) \ No newline at end of file diff --git a/index.html b/index.html index b753dd2..074564f 100644 --- a/index.html +++ b/index.html @@ -119,6 +119,7 @@ + diff --git a/static/js/prism-yaml.min.js b/static/js/prism-yaml.min.js new file mode 100644 index 0000000..5cd16d3 --- /dev/null +++ b/static/js/prism-yaml.min.js @@ -0,0 +1 @@ +!function(e){var n=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,t="(?:"+r.source+"(?:[ \t]+"+n.source+")?|"+n.source+"(?:[ \t]+"+r.source+")?)",a="(?:[^\\s\\x00-\\x08\\x0e-\\x1f!\"#%&'*,\\-:>?@[\\]`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*".replace(//g,(function(){return"[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]"})),d="\"(?:[^\"\\\\\r\n]|\\\\.)*\"|'(?:[^'\\\\\r\n]|\\\\.)*'";function o(e,n){n=(n||"").replace(/m/g,"")+"m";var r="([:\\-,[{]\\s*(?:\\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\\]|\\}|(?:[\r\n]\\s*)?#))".replace(/<>/g,(function(){return t})).replace(/<>/g,(function(){return e}));return RegExp(r,n)}e.languages.yaml={scalar:{pattern:RegExp("([\\-:]\\s*(?:\\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\\S[^\r\n]*(?:\\2[^\r\n]+)*)".replace(/<>/g,(function(){return t}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp("((?:^|[:\\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\\s*:\\s)".replace(/<>/g,(function(){return t})).replace(/<>/g,(function(){return"(?:"+a+"|"+d+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o("\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?"),lookbehind:!0,alias:"number"},boolean:{pattern:o("false|true","i"),lookbehind:!0,alias:"important"},null:{pattern:o("null|~","i"),lookbehind:!0,alias:"important"},string:{pattern:o(d),lookbehind:!0,greedy:!0},number:{pattern:o("[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)","i"),lookbehind:!0},tag:r,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(Prism); \ No newline at end of file -- GitLab