共计 3988 个字符,预计需要花费 10 分钟才能阅读完成。
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”]
所有节点安装 ElasticSearch 插件
head 插件:
./plugin install mobz/elasticsearch-head
所有节点启动 elasticsearch
su elk -c “/opt/elk/elasticsearch-2.1.1/bin/elasticsearch& “
所有节点访问启动是否正常
http://192.168.1.160:9200
http://192.168.1.161:9200
http://192.168.1.162:9200
访问集群节点是否正常, 使用 head 插件
http://192.168.1.160:9200/_plugin/head/
使用 Elasticsearch + Logstash + Kibana 搭建日志集中分析平台实践 http://www.linuxidc.com/Linux/2015-12/126587.htm
Linux 上安装部署 ElasticSearch 全程记录 http://www.linuxidc.com/Linux/2015-09/123241.htm
Elasticsearch 安装使用教程 http://www.linuxidc.com/Linux/2015-02/113615.htm
ElasticSearch 配置文件译文解析 http://www.linuxidc.com/Linux/2015-02/114244.htm
ElasticSearch 集群搭建实例 http://www.linuxidc.com/Linux/2015-02/114243.htm
分布式搜索 ElasticSearch 单机与服务器环境搭建 http://www.linuxidc.com/Linux/2012-05/60787.htm
ElasticSearch 的工作机制 http://www.linuxidc.com/Linux/2014-11/109922.htm
ElasticSearch 的详细介绍:请点这里
ElasticSearch 的下载地址:请点这里
更多 CentOS 相关信息见CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14
本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-03/129045.htm