一、安装elasticsearch7.6.2
一、docker安装
1.1 下载镜像
docker pull elasticsearch:7.6.2
docker pull kibana:7.6.2
1.2 配置
mkdir -p /mydata/elasticsearch/config
mkdir -p /mydata/elasticsearch/data
echo "http.host: 0.0.0.0" >/mydata/elasticsearch/config/elasticsearch.yml
chmod -R 777 /mydata/elasticsearch/
1.3 启动elasticsearch
docker run --name elasticsearch -p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" \
-e ES_JAVA_OPTS="-Xms64m -Xmx512m" \
-v /mydata/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v /mydata/elasticsearch/data:/usr/share/elasticsearch/data \
-v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
-d elasticsearch:7.6.2
1.4 设置开机启动elasticsearch
docker update elasticsearch --restart=always
1.5 启动kibana
docker run --name kibana -e ELASTICSEARCH_HOSTS=http://es-ip:9200 -p 5601:5601 -d kibana:7.6.2
1.6 设置开机启动kibana
docker update kibana --restart=always
二、测试是否安装成功
2.1 访问es
http://ip:9200/,获取elasticsearch数据信息:
出现该页面,可成功安装!