前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Centos7.4部署配置Elasticsearch5.6集群

Centos7.4部署配置Elasticsearch5.6集群

作者头像
三杯水Plus
发布2018-11-14 17:17:52
6350
发布2018-11-14 17:17:52
举报
文章被收录于专栏:运维

参考文档

https://www.elastic.co/guide/en/elasticsearch/reference/5.6/index.html https://www.elastic.co/guide/cn/elasticsearch/guide/current/important-configuration-changes.html https://www.elastic.co/guide/en/elasticsearch/reference/master/setting-system-settings.html

一、环境

1、系统环境

cat /etc/security/limits.conf  elasticsearch soft memlock unlimited elasticsearch hard memlock unlimited elasticsearch soft nofile 131072 elasticsearch hard nofile 131072 elasticsearch soft nproc 4096 elasticsearch hard nproc 4096

2、JAVA环境

java -version openjdk version "1.8.0_161" OpenJDK Runtime Environment (build 1.8.0_161-b14) OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)

二、安装配置

1、安装 rpm -qa |grep elas elasticsearch-5.6.8-1.noarch

注意Centos7.4服务里面需要配置内存锁定,需要修改文件/etc/systemd/system/elasticsearch.service.d/override.conf 参考https://www.elastic.co/guide/en/elasticsearch/reference/master/setting-system-settings.html EDITOR=vim systemctl edit elasticsearch

[Service] LimitMEMLOCK=infinity

#systemctl daemon-reload

2、配置

注意配置使用默认的就行,大部分参数都是按照默认即可,官方已经调优过了,特别是Centos7里面,不需要在配置文件里面添加,只有那些必须要根据实际情况修改的配置需要填写。

1)、master节点配置

cat /etc/elasticsearch/elasticsearch.yml cluster.name: roobo-escluster node.name: master-01 node.master: true node.ingest: true node.data: false path.data: /data/es-data01,/data/es-data02 path.logs: /data/es-data01/eslogs bootstrap.memory_lock: true network.host: 172.20.3.17 http.port: 9200 discovery.zen.ping.unicast.hosts: ["172.20.3.17:9300","172.20.3.18:9300","172.20.3.19:9300"] discovery.zen.minimum_master_nodes: 2 gateway.recover_after_nodes: 6 gateway.expected_nodes: 8 gateway.recover_after_time: 5m http.cors.enabled: true http.cors.allow-origin: "*"

2)、data节点配置

cat /etc/elasticsearch/elasticsearch.yml cluster.name: roobo-escluster node.name: data-01 node.master: false node.ingest: false node.data: true path.data: /data/es-data01,/data/es-data02 path.logs: /data/es-data01/eslogs bootstrap.memory_lock: true network.host: 172.20.3.20 http.port: 9200 discovery.zen.ping.unicast.hosts: ["172.20.3.17:9300","172.20.3.18:9300","172.20.3.19:9300"] discovery.zen.minimum_master_nodes: 2 gateway.recover_after_nodes: 6 gateway.expected_nodes: 8 gateway.recover_after_time: 5m http.cors.enabled: true http.cors.allow-origin: "*"

3)、jvm调优

默认只需要调整HEAP大小,最好不超过内存的50%,大内存服务器不超过31G

cat /etc/elasticsearch/jvm.options |egrep 'Xms|Xmx' -Xms14g -Xmx14g

3、开机启动

systemctl enable elasticsearch

三、Elasticsearch常见操作

查看nodes

curl http://172.20.3.20:9200/_cat/nodes?v ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name 172.20.3.20 4 57 0 0.04 0.03 0.05 d - data-01 172.20.3.18 4 60 0 0.05 0.03 0.05 mi - master-02 172.20.3.24 5 57 0 0.00 0.01 0.05 d - data-05 172.20.3.19 9 38 0 0.02 0.02 0.05 mi - master-03 172.20.3.21 4 57 0 0.00 0.02 0.05 d - data-02 172.20.3.23 5 57 0 0.00 0.01 0.05 d - data-04 172.20.3.22 3 57 0 0.00 0.01 0.05 d - data-03 172.20.3.17 4 68 0 0.00 0.01 0.05 mi * master-01 查看nodes状态 curl http://172.20.3.20:9200/_nodes/stats?pretty 查看集群健康状态 curl http://172.20.3.20:9200/_cluster/health?pretty curl http://172.20.3.20:9200/_cluster/health?level=indices curl http://172.20.3.20:9200/_cluster/health?level=shards 查找索引 curl http://172.20.3.20:9200/_cat/indices?bytes=b | sort -rnk8 |grep -V marvel 查看设置 curl http://172.20.3.20:9200/_cluster/settings?pretty

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2018/07/09 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 参考文档
  • 一、环境
  • 二、安装配置
  • 三、Elasticsearch常见操作
相关产品与服务
Elasticsearch Service
腾讯云 Elasticsearch Service(ES)是云端全托管海量数据检索分析服务,拥有高性能自研内核,集成X-Pack。ES 支持通过自治索引、存算分离、集群巡检等特性轻松管理集群,也支持免运维、自动弹性、按需使用的 Serverless 模式。使用 ES 您可以高效构建信息检索、日志分析、运维监控等服务,它独特的向量检索还可助您构建基于语义、图像的AI深度应用。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档