配置java环境 启动服务
1:查看当前的Java JDK版本,是否符合要求,下载的为2.4
[root@7 ~]# java -version
openjdk version "1.8.0_65"
2:指定JAVA_HOST的环境变量所在路径
编辑/etc/profile.d/java.sh文件,添加
export JAVA_HOME=/usr
. /etc/profile.d/java.sh
3:安装java-1.8
yum install -y java-1.8
4:下载ElasticSearch
wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution
或
https://www.elastic.co/downloads/elasticsearch/elasticesarch-6.5.0.tar.gz
/rpm/elasticsearch/2.4
5:安装ElasticSearch
yum install -y elasticsearch-2.4
6:编辑配置文件/etc/elasticsearch/elasticsearch.yml
cluster.name: yhy-es (修改集群名称)
node.name: yhy-node-1 (修改节点的名称)
transport.tcp.port 9300 (默认集群内部通信端口)
http.port: 9200 (默认介绍数据查询端口)
network.host: 0.0
discovery.zen.ping.unicast.hosts: ["192.168.23.10"]
discovery.zen.ping.multicast.enabled: true
7:启动elasticsearch
systemctl daemon-reload (重新载入 systemd,扫描新的或有变动的单元)
systemctl start elasticsearch.service
8:再启动两个虚拟机作为node2 和 node3
9:拷贝环境配置文件
scp /etc/profile.d/java.sh 192.168
scp /etc/profile.d/java.sh 192.168
10:在对应的主机上执行
. /etc/profile.d/java.sh
11:把elasticsearch-2.4
scp /root/elasticsearch-2.4
scp /root/elasticsearch-2.4
12:分别安装
yum install -y elasticsearch-2.4
13:将node1上的配置文件复制到node2和node3
scp /etc/elasticsearch/elasticsearch.yml 192.168
scp /etc/elasticsearch/elasticsearch.yml 192.168
14:修改下节点名,集群名称不变
node.name: yhy-node-2 (修改节点的名称)
node.name: yhy-node-3 (修改节点的名称)
15:启动node2和node3的elasticsearch
systemctl daemon-reload
systemctl start elasticsearch.service
16:必须保证节点直接可以相互通信,抓包看看报文信息
tcpdump -i enp0s3 -nn tcp port 9300