本文适用于centos7,快速入手练习es语法
前置:安装docker教程docker、docker-component安装-CSDN博客
1.安装es
9200为启动端口,9300为集群端口
bash
docker pull elasticsearch:7.8.0
mkdir -p /mydata/elasticsearch/plugins
mkdir -p /mydata/elasticsearch/data
chmod 777 /mydata/elasticsearch/data
docker run -p 9200:9200 -p 9300:9300 --name es --restart=always \
-e "discovery.type=single-node" \
-e ES_JAVA_OPTS="-Xms512m -Xmx512m" \
-v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
-v /mydata/elasticsearch/data:/usr/share/elasticsearch/data \
-v /mydata/elasticsearch/conf:/usr/share/elasticsearch/conf \
-d elasticsearch:7.8.0
表示安装成功
2.安装kibana
bash
docker pull kibana:7.8.0
#此处ip为虚拟机连接es的ip
docker run --name kibana --restart=always -e ELASTICSEARCH_URL=http://192.168.10.100:9200 -p 5601:5601 -d kibana:7.8.0
docker exec -it kibana /bin/bash
cd config
vi kibana.yml
#修改对应ip
elasticsearch.hosts: [ "http://192.168.10.100:9200" ]
#退出容器
ctrl q p
#访问地址
http://ip:5601
启动成功