环境:centos6.5,三个节点,master,slaver1,slaver2
安装包下载:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.1.tar.gz
jdk版本要求:1.8.0_131
</br>
<h3>配置文件修改</h3>
$ES_HOME/conf/elasticsearch.yml
<li>cluster.name: wpchao_first :集群名称,相同名称的节点会组成一个集群
<li>node.name: wpchao_first_node1:节点名称,每个节点名称都不相同
<li>path.data: /data/es/wpchao_first : es数据目录
<li>path.logs: /data/es/wpchao_first/logs :es日志目录
<li>network.host: 192.168.2.3 :服务绑定和与其他节点通信的ip
<li>discovery.zen.ping.unicast.hosts: ["master", "slaver1", "slaver2"],能够发现集群中新加入节点的节点
<li>discovery.zen.minimum_master_nodes:3 集群中有资格成为master节点个数
默认情况下修改这些配置就够了,其他的参数修改参考:http://blog.csdn.net/an74520/article/details/8219814
</br>
</br>
<h3>集群启动及问题处理</h3>
将es安装文件scp到其他的节点,并修改对应的配置文件,分别启动每个节点,此时es会自动选举某个节点为master节点,注意es不允许root用户启动
启动脚本:$ES_HOME/bin/elasticsearch
<li>启动时异常及处理方法
[2017-06-04T14:57:52,826][ERROR][o.e.b.Bootstrap ] [wpchao_first_node] node validation exception
[4] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: max number of threads [1024] for user [biligeci] is too low, increase to at least [2048]
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[4]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
问题一:
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
原因:无法创建本地文件问题,用户最大可创建文件数太小
解决方法:切换到root用户,编辑limits.conf配置文件, 添加类似如下内容:
vi /etc/security/limits.conf
添加如下内容:
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
重新登录才可生效
问题二:
max number of threads [1024] for user [biligeci] is too low, increase to at least [2048]
原因:无法创建本地线程问题,用户最大可创建线程数太小
解决方法:切换到root用户,进入limits.d目录下,修改90-nproc.conf 配置文件。
vi /etc/security/limits.d/90-nproc.conf
找到如下内容:
* soft nproc 1024
修改为
* soft nproc 2048
问题三:
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
原因:最大虚拟内存太小
解决方法:切换到root用户下,修改配置文件sysctl.conf
vi /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
并执行命令:
sysctl -p
问题四:
system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
原因:因为Centos6不支持SecComp,而ES5.4.1默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动
解决办法:在es的配置文件elasticsearch.yml将bootstrap.system_call_filter 设置为false
到此,分别启动各个节点,集群进入可以用状态
<li>查看集群状态
单节点检测,可以分别检测每个节点是否启动成功
集群检测
一般的集群检测中就可以看出整体集群的状态,不必要去检测单节点的状态,当然看下总是好的
</br>
</br>
<h3>kibana</h3>
Kibana是一个基于浏览器页面的Elasticsearch前端展示工具,使用kibana可以比较方便的在图形界面的执行es的curd操作
安装:https://artifacts.elastic.co/downloads/kibana/kibana-5.4.1-linux-x86_64.tar.gz,下载完后解压安装即可
默认是解压即用,默认会监听本机的9200端口,也就是默认的elasticsearch绑定的端口,如果elasticsearch绑定的端口不是9200,那么kibanan中也要对应的额更改,在集群中任何一个节点启动kibana都可以
[root@master config]# kibana
log [14:16:01.000] [info][status][plugin:kibana@5.4.1] Status changed from uninitialized to green - Ready
log [14:16:01.141] [info][status][plugin:elasticsearch@5.4.1] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [14:16:01.190] [info][status][plugin:console@5.4.1] Status changed from uninitialized to green - Ready
log [14:16:01.241] [info][status][plugin:metrics@5.4.1] Status changed from uninitialized to green - Ready
log [14:16:01.254] [info][status][plugin:elasticsearch@5.4.1] Status changed from yellow to green - Kibana index ready
log [14:16:01.457] [info][status][plugin:timelion@5.4.1] Status changed from uninitialized to green - Ready
log [14:16:01.462] [info][listening] Server running at http://master:5601
log [14:16:01.464] [info][status][ui settings] Status changed from uninitialized to green - Ready
出现上的log表示kibanna启动并连接elasticsearch成功,可以通过http://master:5601来访问kibanan
网友评论