Elasticsearch 三节点集群环境搭建
软件需求
centos7
jdk-8u121-linux-x64.tar.gz
elasticsearch-5.5.0.tar.gz
#####
cd /usr/local/
tar -zxvf /root/jdk-8u121-linux-x64.tar.gz
tar -zxvf /root/elasticsearch-5.5.0.tar.gz
ln -s jdk1.8.0_121/ java
ln -s elasticsearch-5.5.0/ elasticsearch
##### 修改环境变量,增加以下
vim /etc/profile
export JAVA_HOME=/usr/local/java
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$PATH
source /etc/etc/profile
##### 创建elasticsearch用户和数据目录
useradd elk
mkdir -p /data/elasticsearch/logdata
mkdir -p /data/elasticsearch/logs
##### 修改LINUX内核参数
ulimit -n 65536
ulimit -u 65536
echo 262144 > /proc/sys/vm/max_map_count
##### 修改elasticsearch配置文件
vim /usr/local/elasticsearch/config/elasticsearch.yml
cluster.name: es-cluster ##### 所有节点必须相同
node.name: node-3
node.master: true
node.data: false
path.data: /data/elasticsearch/logdata
path.logs: /data/elasticsearch/logs
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: ["10.0.0.180:9300", "10.0.0.181:9300", "10.0.0.182:9300"] ##### 发现主机
discovery.zen.minimum_master_nodes: 3
gateway.recover_after_nodes: 3
##### 启动集群
su - elk
/usr/local/elasticsearch/bin/elasticsearch -d
##### 检测集群正常 https://www.datadoghq.com/blog/collect-elasticsearch-metrics/