ES简单集群配置

环境简介

linux version: CentOS release 6.5 (Final)

elasticsearch: 5.2.2

三台服务器

  • 192.168.59.10 slave7
  • 192.168.59.11 slave8
  • 192.168.59.12 slave9

部署

安装es很简单,直接官网上下载压缩包,解压就行,当然,服务器上得有对应的JDK

安装解压就绪后,对于ES,我们只需要修改es的配置文件$ES_ROOT/config/elasticsearch.yml
其他没有任何改动, 下面是三台服务器的简单配置。

# slave7
cluster.name: es-qa-system
node.name: node-7
node.master: true
node.data: true
network.host: 192.168.59.10
http.host: 192.168.59.10
http.port: 9200
discovery.zen.ping.unicast.hosts: ["192.168.59.10:9300", "192.168.59.11:9300", "192.168.59.12:9300"]
discovery.zen.minimum_master_nodes: 1

bootstrap.memory_lock: false
bootstrap.system_call_filter: false
# slave8
cluster.name: es-qa-system
node.name: node-8
node.master: true
node.data: true
network.host: 192.168.59.11
http.host: 192.168.59.11
http.port: 9200
discovery.zen.ping.unicast.hosts: ["192.168.59.10:9300", "192.168.59.11:9300", "192.168.59.12:9300"]
discovery.zen.minimum_master_nodes: 1

bootstrap.memory_lock: false
bootstrap.system_call_filter: false
# slave9
cluster.name: es-qa-system
node.name: node-9
node.master: true
node.data: true
network.host: 192.168.59.12
http.host: 192.168.59.12
http.port: 9200
discovery.zen.ping.unicast.hosts: ["192.168.59.10:9300", "192.168.59.11:9300", "192.168.59.12:9300"]
discovery.zen.minimum_master_nodes: 1

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

在我部署过程中,配置文件后集群是启动不了的,需要先解决下面的所有问题。

  • 问题一
问题:Java.lang.UnsupportedOperationException: seccomp unavailable: requires kernel 3.5+ with
原因:Linux版本过低引
# 解决方案:
# 1 重新安装高版本linux
# 2 忽略警告,不影响正常使用
  • 问题二
问题:max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
原因:无法创建本地文件问题,用户最大可创建文件数太小
# 解决方案:
# root账户下执行以下命令:
echo "* soft nofile 65536" >> /etc/security/limits.conf
echo "* hard nofile 131072" >> /etc/security/limits.conf
echo "* soft nproc 2048" >> /etc/security/limits.conf
echo "* hard nproc 4096" >> /etc/security/limits.conf
# 然后需要重新登录linux账户
  • 问题三
问题:max number of threads [1024] for user [es] likely too low, increase to at least [2048]
原因:无法创建本地线程问题,用户最大可创建线程数太小
解决方案:
# root账户下进行以下操作
vim /etc/security/limits.d/90-nproc.conf
# 修改内容:soft nproc 1024 --> soft nproc 2048
# 然后需要重新登录linux账户
  • 问题四
问题:max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144] 
原因:最大虚拟内存太小
# root账户下进行以下操作
echo "vm.max_map_count=655360" >> /etc/sysctl.conf
sysctl -p
# 然后需要重新登录linux账户

到此,简单的es集群配置完毕,分别启动es就可以了。

参考文档

Elasticsearch分析器原理

  • https://www.biaodianfu.com/elasticsearch-install-chinese-segmenter-plugin.html

Elasticsearch单机双节点配置

  • http://www.tuicool.com/articles/VBVFzyi

ElasticSearch5.2.2 基本概念和集群配置详解

  • http://blog.csdn.net/wulex/article/details/71194653

  • http://doc.okbase.net/wanglong1615/archive/258603.html

  • http://blog.csdn.net/wangxilong1991/article/details/70211910?locationNum=2&fps=1

你可能感兴趣的:(ES简单集群配置)