Skip to content

Commit

Permalink
vault backup: 2024-10-23 17:22:24
Browse files Browse the repository at this point in the history
Affected files:
.obsidian/workspace.json
_posts/engineering/2024-10-15-Elasticsearch远程docker部署 1.md
_posts/engineering/2024-10-15-docker-ubuntu安装教程.md
  • Loading branch information
cmgzn committed Oct 23, 2024
1 parent 715e682 commit 15d04fc
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 36 deletions.
12 changes: 6 additions & 6 deletions .obsidian/workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -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安装教程"
}
}
]
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
36 changes: 36 additions & 0 deletions _posts/engineering/2024-10-15-Elasticsearch远程docker部署 1.md
Original file line number Diff line number Diff line change
@@ -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^...
Original file line number Diff line number Diff line change
@@ -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
---
Expand Down Expand Up @@ -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^...
```

0 comments on commit 15d04fc

Please sign in to comment.