欢迎投稿

今日深度:

ElasticSearch 集群搭建和坑点,elasticsearch

ElasticSearch 集群搭建和坑点,elasticsearch


单节点版的部署参考 安装和使用 elasticSearch、LogStash、IK(一),分别在三台ip安装独立的 ES之后,进行集群配置

集群配置

系统参数设置

# 1 解决:切换到root用户,编辑limits.conf 添加类似如下内容

vi /etc/security/limits.conf 

添加如下内容:

* soft nofile 65536

* hard nofile 131072

* soft nproc 2048

* hard nproc 4096
* 
# 2 解决:切换到root用户,进入limits.d目录下修改配置文件。

vi /etc/security/limits.d/90-nproc.conf 

修改如下内容:

* soft nproc 1024

#修改为

* soft nproc 2048

vim /etc/sysctl.conf  -> vm.max_map_count=262144

# 3 如果你是centos6 :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.2.1默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面: 

bootstrap.memory_lock: false 

bootstrap.system_call_filter: false

ES集群yml参数设置

# vim elasticsearch.yml

#centos6 需要设置
bootstrap.memory_lock: false 
bootstrap.system_call_filter: false
network.host: 0.0.0.0

discovery.zen.minimun_master_nodes: 2
discovery.zen.ping.unicast.hosts: ["其他node的ip","其他node的ip"]


http.cors.enabled: true
http.cors.allow-origin: "*"
cluster.name: leon
node.name: node1
# node.master: true 
# 如果在某个节点设置了这个参数,那么这个节点就一直是 Master节点

IK分词集群配置

ik 集群配置 : 直接下载 https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.5.1/elasticsearch-analysis-ik-5.5.1.zip

放到集群节点上的 plugins 目录下,我的三个节点的目录分别是:

/elasticsearch/el_slave/es_slave1/plugins
/elasticsearch/el_slave/es_slave2/plugins
/elasticsearch/elasticsearch-5.5.1/plugins

在这三个目录下 mkdir ik ,再配置 config 文件 ,配置参考 安装和使用 elasticSearch、LogStash、IK(二)

查看集群

通过安装 head 插件 或者 Kibana 图形化查看集群状态,节点,分片等信息

这里我的集群是3个节点,所以 discovery.zen.minimun_master_nodes: 2设置的 最小集群启动数目是2个节点,2N-1 。当3个节点有一个发生故障,剩下的两个节点还可以自行运转,重新选举 。

设置 info 索引 3个分片,1个复制,可以在图上看到,索引分布在3个分片,又分布在三个节点上,另外每个分片都有一个复制分片。

www.htsjk.Com true http://www.htsjk.com/Elasticsearch/35529.html NewsArticle ElasticSearch 集群搭建和坑点,elasticsearch 单节点版的部署参考 安装和使用 elasticSearch、LogStash、IK(一),分别在三台ip安装独立的 ES之后,进行集群配置 集群配置 系统参数设置 # 1 解决...
相关文章
    暂无相关文章
评论暂时关闭