标签:art grep http协议 $1 tran 数据 dt.jar system ESS
1、复制5份es,版本要相同,且各个节点上jdk版本也要相同,否则会报数据同步格式不一致 invalid internal transport message format。
2、配置elasticsearch.yml,主要修改以下方面:
cluster.name: my-application #集群名,各个节点要一致
node.name: node-01 #节点名
path.data: /data1/elk/elasticsearch/data #数据存储位置
path.logs: /data1/elk/elasticsearch/logs #日志
bootstrap.system_call_filter: false #关闭锁内存
network.host: 192.168.0.1 #各个节点IP,每个节点写自己的ip
http.port: 9200 #端口
discovery.zen.ping.unicast.hosts: ["192.168.0.1", "192.168.0.2","192.168.0.3","192.168.0.4","192.168.0.5"] #集群ip列表
discovery.zen.minimum_master_nodes: 3 #集群master节点数,建议为(集群节点总数/2)+1
3、配置好直接启动即可,随意先启动哪一台,先启动即为master。9300是tcp通讯端口,集群间和TCPClient都走的它,所以各个主机间9300一定要能互通。
4、验证集群 ,es 9200是http协议的RESTful接口,可用此端口查看集群状态
curl -XGET ‘http://192.168.0.1:9200/_cat/nodes?pretty‘
其中
结果如下表示集群已搭建成功:
5、es启动脚本
vim /etc/init.d/es
#!/bin/sh
#chkconfig: 2345 80 05
#description: elasticsearch
export JAVA_HOME=/usr/local/jdk1.8.0_92
export JAVA_BIN=/usr/local/jdk1.8.0_92/bin
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
case "$1" in
start)
su dev<<!
cd /data1/elk/elasticsearch
./bin/elasticsearch -d
!
echo "elasticsearch startup"
;;
stop)
es_pid=`ps aux|grep elasticsearch | grep -v ‘grep elasticsearch‘ | awk ‘{print $2}‘`
kill -9 $es_pid
echo "elasticsearch stopped"
;;
restart)
es_pid=`ps aux|grep elasticsearch | grep -v ‘grep elasticsearch‘ | awk ‘{print $2}‘`
kill -9 $es_pid
echo "elasticsearch stopped"
su dev<<!
cd /data1/elk/elasticsearch
./bin/elasticsearch -d
!
echo "elasticsearch startup"
;;
*)
echo "start|stop|restart"
;;
esac
exit $?
标签:art grep http协议 $1 tran 数据 dt.jar system ESS
原文地址:https://www.cnblogs.com/abkn/p/9591198.html