一、修改centos7 环境:
临时设置:
sysctl -w vm.max_map_count=262144
查看结果:
sysctl-a|grep vm.max_map_count
永久设置,重启后生效:
/etc/sysctl.conf文件最后添加一行
vm.max_map_count=262144
二、新建文件和文件夹
/usr/local/elasticsearch下创建config,data,logs,plugins四个文件夹
在/usr/local/elasticsearch/config 下创建elasticsearch.yml,log4j2.properties两个文件,scripts文件夹
三、elasticsearch.yml配置
cluster.name: mk
node.name: mk-node-1
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
node.master: true
node.data: true
discovery.zen.minimum_master_nodes: 1
bootstrap.memory_lock: false
node.max_local_storage_nodes: 1
#path.data: /usr/local/elasticsearch/data
http.cors.enabled: true
http.cors.allow-origin: /.*/
四、docker启动命令
docker run -it -d --name es -p 9200:9200 -p9300:9300 --privileged=true --network host -v /usr/local/elasticsearch:/usr/share/elasticsearch registry.cn-shanghai.aliyuncs.com/stcsmstis/elasticsearch:6.5.3
网友评论