cluster.name: mzlog
node.name: n1
network.host: 10.1.195.3
这三个即可
1.安装jdk
yum -y install java-1.8.0-openjdk*
2.下载es并安装
wget -c https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.0.rpm
rpm -ivh elasticsearch-6.3.0.rpm
3.设置开机启动
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
###您可以通过执行来启动ElasticSearch服务
sudo systemctl start elasticsearch.service
4.修改配置,改为集群式
[root@centos elasticsearch]# egrep -v "#|^$" elasticsearch.yml
cluster.name: mzlog
node.name: node2
path.data: /data1/elastic/data #修改存储路径
path.logs: /data1/elastic/logs #修改日志路径
bootstrap.memory_lock: true #启用内存锁,防止内存被交换出去
network.host: 10.1.196.15
discovery.zen.ping.unicast.hosts: ["10.1.195.3", "10.1.196.15"]
会把写在第一个的当做主节点,另外一个为工作节点
注意:修改path.data和path.logs里面后的权限,属主要改为elasticsearch用户
5.修改jvm.options里内存大小
-Xms32g
-Xmx32g
6.划分角色
node.master: true
node.data: true