一份Centos7.6 搭建elasticsearch 6.4.3 docker脚本:
1、docker脚本
docker run -itd --name bigdataES \
--restart=always \
--net=host \
-e "discovery.type=single-node" \
-p 9202:9200 \
-p 9300:9300 \
--ulimit nofile=65536:131072 \
-e "ES_JAVA_OPTS=-Xms3g -Xmx3g" \
-v "/data/services/es/config/elasticsearch.yml":/usr/share/elasticsearch/config/elasticsearch.yml --privileged=true \
-v "/data/services/es/plugins":/usr/share/elasticsearch/plugins \
-v "/data/services/es/data":/usr/share/elasticsearch/data \
-v "/data/services/es/logs":/usr/share/elasticsearch/logs \
elasticsearch:6.4.3
2、es单机配置:
cluster.name: bigdata-es
node.name: node-1
network.host: server Ip
http.port: 9202
discovery.zen.minimum_master_nodes: 1
#head plugin
http.cors.enabled: true
http.cors.allow-origin: "*"
3、文件夹权限
将文件夹 conf/ logs/ data/ plugin/ 设置为1000权限用户组:
chown -R 1000:1000 config/ data/ logs/ plugins/
4、启动docker脚本
./scripts/run.sh