其他分享
首页 > 其他分享> > Elasticsearch安装

Elasticsearch安装

作者:互联网

一、docker安装

1、拉取镜像

docker pull elasticsearch:7.14.1

2、创建外部目录,用来挂载数据卷,并对文件夹授权

mkdir -p /usr/local/mydata/elasticsearch/config

mkdir -p /usr/local/mydata/elasticsearch/data

mkdir -p /usr/local/mydata/elasticsearch/plugins


chmod -R 777 /usr/local/mydata/elasticsearch/config
chmod -R 777 /usr/local/mydata/elasticsearch/data
chmod -R 777 /usr/local/mydata/elasticsearch/plugins

3、在config目录下创建elasticsearch.yml文件,并配置 network.host: 0.0.0.0  表示所有外部网络都可以访问该es

touch /usr/local/mydata/elasticsearch/config/elasticsearch.yml

echo "network.host: 0.0.0.0" >> /usr/local/mydata/elasticsearch/config/elasticsearch.yml

4、运行镜像,并挂载数据卷

docker run --name elasticsearch -p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms64m -Xmx128m" \
-v /usr/local/mydata/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v /usr/local/mydata/elasticsearch/data/:/usr/share/elasticsearch/data \
-v /usr/local/mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
-d elasticsearch:7.14.1

 

标签:mydata,local,Elasticsearch,usr,0.0,elasticsearch,config,安装
来源: https://www.cnblogs.com/misterwu/p/16300035.html