centos7安装ES原创
# 安装elasticserch:8.11.0
# docker拉取镜像
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.11.0
# 新建环境
mkdir -p /user/es/config
mkdir -p /user/es/data
mkdir -p /user/es/logs
mkdir -p /user/es/plugins
chmod 777 /user/es/config
chmod 777 /user/es/data
chmod 777 /user/es/logs
chmod 777 /user/es/plugins
# 启动一个实例,把配置文件复制到外部主机 并且删除该docker实例
docker run --name=elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -d elasticsearch:7.6.2
docker cp elasticsearch:/usr/share/elasticsearch/config /user/es
docker cp elasticsearch:/usr/share/elasticsearch/data /user/es
docker cp elasticsearch:/usr/share/elasticsearch/logs /user/es
docker cp elasticsearch:/usr/share/elasticsearch/plugins /user/es
docker stop elasticsearch
docker rm elasticsearch
docker start es
# 按照宿主机实例的配置,重新启动elacticsearch
docker run --name=es -p 9200:9200 \
-p 9300:9300 \
-e "discovery.type=single-node" \
-e ES_JAVA_OPTS="-Xms128m -Xmx256m" \
-v /user/es/config:/usr/share/elasticsearch/config \
-v /user/es/data:/usr/share/elasticsearch/data \
-v /user/es/logs:/usr/share/elasticsearch/logs \
-v /user/es/plugins:/usr/share/elasticsearch/plugins \
-d elasticsearch:8.11.0
# 8.X默认有ssl认证,获取密码:
# 进入docker
docker exec -it 775c7c9ee1e1 /bin/bash
# 重置密码
elasticsearch-reset-password -u elastic
# 新建用户
elasticsearch-reset-password --batch --user kibana_system
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
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
地址 | 账号 | 密码 |
---|---|---|
http://117.72.35.125:9200/ (opens new window) | elastic | jvGqw03O-OZU_2CfSv7P |
kibana_system | IVSExx*wkp6V7ybsRrBT | |
http://117.72.35.125:5601/ (opens new window) | elastic | jvGqw03O-OZU_2CfSv7P |
# 安装kibana
# 拉取镜像
docker pull docker.elastic.co/kibana/kibana:8.11.0
mkdir -p /user/kibana/config
chmod 777 /user/kibana/config
# 启动一个实例,把配置文件复制到外部主机 并且删除该docker实例
docker run --name kibana --link es:es -p 5601:5601 -d docker.elastic.co/kibana/kibana:8.11.0
docker cp kibana:/usr/share/kibana/config /user/kibana
docker stop kibana
docker rm kibana
# 根据配置文件启动kibana
docker run --name kibana --privileged=true --link es:es \
-p 5601:5601 \
-v /user/kibana/config:/usr/share/kibana/config \
-d docker.elastic.co/kibana/kibana:8.11.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
控制台开放端口
# 安装完成:http://117.72.35.125:9200/ (opens new window)
上次更新: 2024/07/30, 22:53:10