From 15d04fc0f46a6c8b0b06757bb0b8c60ec3b9f4c1 Mon Sep 17 00:00:00 2001 From: cmgzn Date: Wed, 23 Oct 2024 17:22:24 +0800 Subject: [PATCH] vault backup: 2024-10-23 17:22:24 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Affected files: .obsidian/workspace.json _posts/engineering/2024-10-15-Elasticsearch远程docker部署 1.md _posts/engineering/2024-10-15-docker-ubuntu安装教程.md --- .obsidian/workspace.json | 12 +++---- ...50\213docker\351\203\250\347\275\262 1.md" | 36 +++++++++++++++++++ ...11\350\243\205\346\225\231\347\250\213.md" | 32 ++--------------- 3 files changed, 44 insertions(+), 36 deletions(-) create mode 100644 "_posts/engineering/2024-10-15-Elasticsearch\350\277\234\347\250\213docker\351\203\250\347\275\262 1.md" rename "_posts/engineering/2024-10-15-Elasticsearch\350\277\234\347\250\213docker\351\203\250\347\275\262.md" => "_posts/engineering/2024-10-15-docker-ubuntu\345\256\211\350\243\205\346\225\231\347\250\213.md" (75%) diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 9c62143..1510c87 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -13,12 +13,12 @@ "state": { "type": "markdown", "state": { - "file": "_posts/engineering/2024-09-11-git版本管理常见技巧.md", + "file": "_posts/engineering/2024-10-15-docker-ubuntu安装教程.md", "mode": "source", "source": false }, "icon": "lucide-file", - "title": "2024-09-11-git版本管理常见技巧" + "title": "2024-10-15-docker-ubuntu安装教程" } } ] @@ -197,8 +197,11 @@ }, "active": "1e2086f0928a3cb6", "lastOpenFiles": [ - "_posts/pool/2024-10-23.md", + "_posts/engineering/2024-10-15-Elasticsearch远程docker部署 1.md", + "_posts/engineering/2024-10-15-docker-ubuntu安装教程.md", + "_posts/engineering/2024-10-16-Elasticsearch之一百种你不得不记的RESTful api.md", "_posts/engineering/2024-09-11-git版本管理常见技巧.md", + "_posts/pool/2024-10-23.md", "_posts/pool/2024-10-21.md", "_posts/pool/2024-10-18-日记.md", "_template/time_note.md", @@ -218,11 +221,8 @@ "_posts/engineering/2024-08-13-conda环境库信息导出与复原.md", "_posts/engineering/2024-08-13-linux软链接相关.md", "_posts/engineering/2024-08-13-linux删除相关.md", - "_posts/engineering/2024-10-15-Elasticsearch远程docker部署.md", "_posts/debug/2024-09-12-记一次离奇的linux-ssh登录bug.md", "_posts/pool/2024-09-23.md", - "_posts/pool/2024-09-21.md", - "_posts/pool/2024-09-25.md", "assets/img/mrj9tyfxgpwc4ohkdhkq3uu3azxww8g.png", "assets/img/Dingtalk_20240906094335.jpg", "assets/img/Dingtalk_20240906103403.jpg", diff --git "a/_posts/engineering/2024-10-15-Elasticsearch\350\277\234\347\250\213docker\351\203\250\347\275\262 1.md" "b/_posts/engineering/2024-10-15-Elasticsearch\350\277\234\347\250\213docker\351\203\250\347\275\262 1.md" new file mode 100644 index 0000000..4c7954d --- /dev/null +++ "b/_posts/engineering/2024-10-15-Elasticsearch\350\277\234\347\250\213docker\351\203\250\347\275\262 1.md" @@ -0,0 +1,36 @@ +--- +title: Elasticsearch远程docker部署 +author: X +date: 2024-10-15 14:27:40 +0800 +categories: + - engineering + - 数据库 +tags: + - Elasticsearch + - docker + - linux +--- +# 从Docker安装Elasticsearch + +[官方教程](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html) + +按步骤走就可以。需要注意,创建容器时需要调整一下自己需要的设置,示例提供的设置需要https验证,以及开启了试用,只想用基础版的可以取消。最后多方调试,苯人用的设置如下: + +```bash +sudo docker run -p 9200:9200 -p 9300:9300 -d --name es01 --network elastic \ + -e ELASTIC_PASSWORD=$ELASTIC_PASSWORD \ + -e "discovery.type=single-node" \ + -e "xpack.security.http.ssl.enabled=false" \ + -e "xpack.license.self_generated.type=basic" \ + docker.elastic.co/elasticsearch/elasticsearch:8.15.2 +``` + +这种方法下密码可以通过环境变量自己指定,并且关掉了https验证以及试用版。REST API测试: + +```bash +curl -u elastic:$ELASTIC_PASSWORD http://localhost:9200 +``` + +利用vscode转发端口到本地,本地也可以顺畅联通。 + +表面看起来很简单,实际为了找到合适的设置,笔者遭老罪了^v^... \ No newline at end of file diff --git "a/_posts/engineering/2024-10-15-Elasticsearch\350\277\234\347\250\213docker\351\203\250\347\275\262.md" "b/_posts/engineering/2024-10-15-docker-ubuntu\345\256\211\350\243\205\346\225\231\347\250\213.md" similarity index 75% rename from "_posts/engineering/2024-10-15-Elasticsearch\350\277\234\347\250\213docker\351\203\250\347\275\262.md" rename to "_posts/engineering/2024-10-15-docker-ubuntu\345\256\211\350\243\205\346\225\231\347\250\213.md" index 1bc8209..52da17a 100644 --- "a/_posts/engineering/2024-10-15-Elasticsearch\350\277\234\347\250\213docker\351\203\250\347\275\262.md" +++ "b/_posts/engineering/2024-10-15-docker-ubuntu\345\256\211\350\243\205\346\225\231\347\250\213.md" @@ -1,12 +1,10 @@ --- -title: Elasticsearch远程docker部署 +title: docker-ubuntu安装教程 author: X date: 2024-10-15 14:27:40 +0800 categories: - engineering - - 数据库 tags: - - Elasticsearch - docker - linux --- @@ -140,30 +138,4 @@ docker info http://hub-mirror.c.163.com/ https://mirror.ccs.tencentyun.com/ https://registry.docker-cn.com/ -``` - - -# 从Docker安装Elasticsearch - -[官方教程](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html) - -按步骤走就可以。需要注意,创建容器时需要调整一下自己需要的设置,示例提供的设置需要https验证,以及开启了试用,只想用基础版的可以取消。最后多方调试,苯人用的设置如下: - -```bash -sudo docker run -p 9200:9200 -p 9300:9300 -d --name es01 --network elastic \ - -e ELASTIC_PASSWORD=$ELASTIC_PASSWORD \ - -e "discovery.type=single-node" \ - -e "xpack.security.http.ssl.enabled=false" \ - -e "xpack.license.self_generated.type=basic" \ - docker.elastic.co/elasticsearch/elasticsearch:8.15.2 -``` - -这种方法下密码可以通过环境变量自己指定,并且关掉了https验证以及试用版。REST API测试: - -```bash -curl -u elastic:$ELASTIC_PASSWORD http://localhost:9200 -``` - -利用vscode转发端口到本地,本地也可以顺畅联通。 - -表面看起来很简单,实际为了找到合适的设置,笔者遭老罪了^v^... \ No newline at end of file +``` \ No newline at end of file