1. Select Elasticsearch image file
Use docker commands to view Elasticsearch Image files
docker search elasticsearch
[root@172-10-20-165 zlb]# docker search elasticsearch
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
elasticsearch Elasticsearch is a powerful open source sear… 5304 [OK]
nshou/elasticsearch-kibana Elasticsearch-7.15.1 Kibana-7.15.1 132 [OK]
mobz/elasticsearch-head elasticsearch-head front-end and standalone … 82
elastichq/elasticsearch-hq Official Docker image for ElasticHQ: Elastic… 77 [OK]
itzg/elasticsearch Provides an easily configurable Elasticsearc… 71 [OK]
elastic/elasticsearch The Elasticsearch Docker image maintained by… 56
taskrabbit/elasticsearch-dump Import and export tools for elasticsearch 27 [OK]
lmenezes/elasticsearch-kopf elasticsearch kopf 18 [OK]
barnybug/elasticsearch Latest Elasticsearch 1.7.2 and previous rele… 17 [OK]
justwatch/elasticsearch_exporter Elasticsearch stats exporter for Prometheus 17
blacktop/elasticsearch Alpine Linux based Elasticsearch Docker Image 16 [OK]
esystemstech/elasticsearch Debian based Elasticsearch packing for Lifer… 15
monsantoco/elasticsearch ElasticSearch Docker image 11 [OK]
mesoscloud/elasticsearch [UNMAINTAINED] Elasticsearch 9 [OK]
dtagdevsec/elasticsearch elasticsearch 4 [OK]
centerforopenscience/elasticsearch Elasticsearch 4 [OK]
barchart/elasticsearch-aws Elasticsearch AWS node 3
jetstack/elasticsearch-pet An elasticsearch image for kubernetes PetSets 1 [OK]
kuzzleio/elasticsearch Elasticsearch container based on Alpine Linu… 1 [OK]
axway/elasticsearch-docker-beat "Beat" extension to read logs of containers … 1 [OK]
dsteinkopf/elasticsearch-ingest-attachment elasticsearch + ingest-attachment to be used… 1 [OK]
phenompeople/elasticsearch Elasticsearch is a powerful open source sear… 1 [OK]
thingswise/elasticsearch Elasticsearch + etcd2 peer discovery 1 [OK]
wreulicke/elasticsearch elasticsearch 0 [OK]
travix/elasticsearch-kubernetes To run ElasticSearch in kubernetes and expor… 0 [OK]
2. Download the elasticsearch image file
According to the above operations, we generally select the first one, and add the version number you need when selecting. Here I choose version 7.4.0
docker pull elasticsearch:7.4.0
3. Select the kibana visualization tool image file.
Run the docker command to view the kibana image file.
docker search kibana
[root@172-10-20-165 zlb]# docker search kibana
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
kibana Kibana gives shape to any kind of data — str… 2287 [OK]
elastic/kibana The Kibana docker images maintained by Elast… 33
marcbachmann/kibana4 Kibana 4 Dashboard, Stable release, Environm… 27 [OK]
devdb/kibana Elasticsearch 1.5.2 + Kibana 4.0.2 15 [OK]
blacktop/kibana Alpine Linux based Kibana Docker Image 12 [OK]
clusterhq/kibana Kibana 3.1.x image for ClusterHQ's flocker t… 6 [OK]
jimmidyson/kibana4 3 [OK]
monsantoco/kibana Kibana web UI based on Alpine Linux (~65 MB). 3 [OK]
million12/kibana4 Kibana 4 For Elasticsearch (works like kiban… 2 [OK]
dtagdevsec/kibana kibana 2 [OK]
khezen/kibana Kibana Docker image including search-guard 2 [OK]
sxmichael/kibana Kibana with Marvel and Sense 2 [OK]
ansibleplaybookbundle/kibana-apb Kibana APB 1 [OK]
mesoscloud/kibana [UNMAINTAINED] Kibana 1 [OK]
komljen/kibana Kibana kube image 1 [OK]
maxird/kibana Kibana dashboard 0
rlister/kibana4 Kibana4 configured with env variables. 0
barchart/kibana Kibana console for Logstash 0
appcelerator/kibana Kibana image builder using only environment … 0 [OK]
plaguedr/kibana pelk - Kibana 0
phenompeople/kibana Kibana gives shape to any kind of data — str… 0 [OK]
neemuchaordic/kibana-without-xpack kibana without x-pack 0 [OK]
brendangibat/kibana-aws-container Kibana v4.1.4 with AWS ElasticSearch signing… 0 [OK]
petekaik/kibana-healthcheck Adaptation of the popular Kibana image with … 0 [OK]
amd64/kibana Kibana gives shape to any kind of data — str… 0
4. Download the kibana image file
According to the above operations, we generally select the first one, and add the version number you need when selecting. Here I choose version 7.4.0
docker pull kibana:7.4.0
5.Download Chinese word segmentation
To support Chinese word segmentation, we need to download the Chinese analysis tool. We select elasticsearch-analysis-ik-7.4.0.zip
Download URL:https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.4.0/elasticsearch-analysis-ik-7.4.0.zip
wget https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.4.0/elasticsearch-analysis-ik-7.4.0.zip
6. Create required folders
6.1 docker installation of elasticsearch requires several folders to be hosted for external Association
mkdir config data plugins
- config to store the elasticsearch configuration file
- Data Store data
- Plugins Store Word Segmentation
6.2 create elasticsearch.yml in the config file
To allow Internet access, follow these steps:
echo "http.host: 0.0.0.0">>/zlb/docker-es/elasticsearch/config/elasticsearch.yml
Note: http.host: must be followed by a space.
6.3 decompress the elasticsearch-analysis-ik-7.4.0.zip to the plugins folder
The procedure is as follows:
#解压
unzip elasticsearch-analysis-ik-7.4.2.zip -d analysis-ik
# 删除原有文件
rm -rf elasticsearch-analysis-ik-7.4.2.zip
As shown in figure:/zlb/docker-es/plugins/analysis-ik
7. Modify read/write permissions
chmod -R 777 /zlb/docker-es/
8.Enable related services
8.1 Enable elasticsearch
docker run --name elasticsearch -p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" \
-v /zlb/docker-es/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v /zlb/docker-es/data:/usr/share/elasticsearch/data \
-v /zlb/docker-es/plugins:/usr/share/elasticsearch/plugins \
-d elasticsearch:7.4.0
-name: 在docker容器中显示的名称
-p:9200:操作es的http请求端口
-p:9300:es在分布式集群下的节点之间的通讯端口
-e:指定单节点运行
-e:训你机内存配置,初始64m,最大占用128m(x线上至少32g)
-v:挂载配置
-d:指定安装镜像文件
8.2 Install kibana
docker run --name kibana -e ELASTICSEARCH_HOSTS=http://172.10.20.165:9200 -p 5601:5601 -d kibana:7.4.0
ELASTICSEARCH_HOSTS=:This address is your es address
8.3 Tokenization test
The tokenizer path must correspond to the path in the elasticsearch Service.
So now we just need to check whether the two directories are unified (if they are unified, you can go to the docker container to see them)
Check the mapping
9. Note
# 如果启动报错 可以执行查看logs的命令
docker logs 容器ID
#开机启动
docker update elasticsearch --restart-always
1.echo写入配置时候少了个空格
2.es所有配置添加读写权限