CentOS7部署ElasticSearch-2.1.1集群系统规划
主机名
IP地址
系统版本
软件版本
node160
192.168.1.160
centos7
ElasticSearch-2.1.1
node161
192.168.1.161
centos7
ElasticSearch-2.1.1
node162
192.168.1.162
centos7
ElasticSearch-2.1.1
所有节点检查java版本
[root@node160~]# java -version
javaversion "1.8.0_40"
Java(TM)SE Runtime Environment (build 1.8.0_40-b26)
JavaHotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
所有节点配置hosts文件
192.168.1.160 node160
192.168.1.161 node161
192.168.1.162 node162
所有节点安装ElasticSearch
[root@node160 ~]# mkdir /opt/elk
[root@node160~]# cd /opt/elk
[root@node160~]# wget https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.1.1/elasticsearch-2.1.1.tar.gz
[root@node160elk]# tar xf elasticsearch-2.1.1.tar.gz
创建启动elasticsearch用户
[root@node160bin]# groupadd elk
[root@node160bin]# useradd elk -g elk -p elasticsearch
[root@node162elk]# chown -R elk.elk elasticsearch-2.1.1
[root@node160elk]# passwd elk
更改用户 elk 的密码 。
新的 密码:
无效的密码: 密码少于 8 个字符
重新输入新的 密码:
passwd:所有的身份验证令牌已经成功更新。
[root@node160elk]#
启动elasticsearch
[root@node162elasticsearch-2.1.1]# su elk
[elk@node162elasticsearch-2.1.1]$ bin/elasticsearch
[2016-03-0714:53:09,636][INFO ][node ] [Sea Urchin] version[2.1.1], pid[1367],build[40e2c53/2015-12-15T13:05:55Z]
[2016-03-0714:53:09,636][INFO ][node ] [Sea Urchin] initializing ...
[2016-03-0714:53:09,796][INFO ][plugins ] [Sea Urchin] loaded [], sites []
[2016-03-0714:53:09,867][INFO ][env ] [Sea Urchin] using [1] data paths, mounts [[/ (rootfs)]], netusable_space [48.5gb], net total_space [49.9gb], spins? [unknown], types[rootfs]
[2016-03-0714:53:11,972][INFO ][node ] [Sea Urchin] initialized
[2016-03-0714:53:11,972][INFO ][node ] [Sea Urchin] starting ...
[2016-03-0714:53:12,289][INFO ][transport ] [Sea Urchin] publish_address {127.0.0.1:9300}, bound_addresses{127.0.0.1:9300}, {[::1]:9300}
[2016-03-0714:53:12,308][INFO ][discovery ] [Sea Urchin]elasticsearch/dJDdF4-sSdOsVsnzrEBk7g
[2016-03-0714:53:15,485][INFO ][cluster.service ] [Sea Urchin] new_master {SeaUrchin}{dJDdF4-sSdOsVsnzrEBk7g}{127.0.0.1}{127.0.0.1:9300}, reason:zen-disco-join(elected_as_master, [0] joins received)
[2016-03-0714:53:15,557][INFO ][http ] [Sea Urchin] publish_address {127.0.0.1:9200}, bound_addresses{127.0.0.1:9200}, {[::1]:9200}
[2016-03-0714:53:15,558][INFO ][node ] [Sea Urchin] started
[2016-03-0714:53:15,579][INFO ][gateway ] [Sea Urchin] recovered [0] indices into cluster_state
所有节点配置elk启动内存
[root@node160bin]# vi elasticsearch.in.sh
ES_MIN_MEM=2g
ES_MAX_MEM=2g
所有节点配置elk集群模式
[root@node160config]# vi elasticsearch.yml
cluster.name: elasticsearch
node.name: node160
node.cluster: true //指定master服务器
network.host: 192.168.1.160
discovery.zen.ping.unicast.hosts:["node160", "node161","node162"]
[root@node161 config]# vi elasticsearch.yml
cluster.name: elasticsearch
node.name: node161
network.host: 192.168.1.161
discovery.zen.ping.unicast.hosts:["node160", "node161","node162"]
[root@node162 config]# vi elasticsearch.yml
cluster.name: elasticsearch
node.name: node162
network.host: 192.168.1.162
discovery.zen.ping.unicast.hosts:["node160", "node161","node162"]