elastic search 7.1.0 集群搭建
step1
环境要求
- 服务器版本:centos 7.x
- jdk版本:jdk1.8+
- 关闭防火墙
- 三台服务器
· node1 123.56.191.126
· node2 47.93.14.174
· node3 47.94.136.68
step2
下载安装包
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.1.0-linux-x86_64.tar.gz
step3
修改配置文件 (每个实例都需要修改)
node.name: node2 //节点名称(每个节点的name)
node.master: true //是否可以成为主节点
node.data: true //是否存储node数据
discovery.seed_hosts: ["123.56.191.126","47.93.14.174","47.94.136.68"] // 配置集群机器
cluster.initial_master_nodes: [node1,node2,node3]
http.cors.enabled: true //跨域访问
http.cors.allow-origin: "*"
network.host: 0.0.0.0 //监听网段
path.logs: /home/admin/es/elasticsearch-7.1.1/logs //日志文件存放路径
path.data: /home/admin/es/elasticsearch-7.1.1/data //数据文件存放路径
http.port: 9200 //http 暴露端口
http.max_content_length: 100mb
node.attr.data: cold //节点生命周期
step4
系统配置
vim /etc/security/limits.conf
* soft nofile 65536
* hard nofile 131072
admin soft memlock unlimited
admin hard memlock unlimited
vim /etc/sysctl.conf
新增vm.max_map_count = 655360
执行sysctl –p
step5
后台启动
./elasticsearch –d
http://123.56.191.126:9200/_cat/nodeattrs?s=attr