1、基本下载安装



#按照ELK系列一博客安装启动即可,没有大坑,注意一下权限即可
chmod -R 777 ./elasticsearch
#此外没有java的,注意安装下JDK,我这次部署的环境是CentOS-7.x,使用yum安装
sudo yum -y list java*
sudo yum install java-1.8.0-openjdk.x86_64

2、集群配置:



2.1、配置过程


编辑好elasticseach-1的配置之后,复制出elasticsearch-2,然后修改结点名称、http端口和tcp端口,启动两个进程实例
大坑:
要记得删除复制出来的elasticsearch-2中的data目录下的所有文件
rm -rf ./elasticsearch-2/data/*

2.2、配置文件详解


# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: XXXXXX #集群名称
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: ES02 #结点名称
node.master: true #主结点标识
#node.data: false #数据结点标识 #
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /xxxxx/elasticsearch-x/data
#
# Path to log files:
#
path.logs: /xxxxx/elasticsearch-x/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#bootstrap.system_call_filter: false
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
#network.host: 192.168.0.1
#
# Set a custom port for HTTP:
#
http.port: 9201 #web服务的端口
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.zen.ping.unicast.hosts: ["127.0.0.1:9300", "127.0.0.1:9301"] #结点发现功能
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
#
discovery.zen.minimum_master_nodes: 1 #最小master节点数,配置后不按照上方的算法计算最小节点数,按照配置的节点数选举合适数量的master节点
#
# For more information, consult the zen discovery module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
transport.tcp.port: 9301 #集群的心跳打点端口

2.3、验证与状态监控:


curl -XGET 'http://127.0.0.1:9200/_cat/nodes?pretty'



ELK系列七:Elasticsearch的集群配置和监控以及在部署ELK中踩的坑的更多相关文章

  1. ES系列十六、集群配置和维护管理

    一.修改配置文件 1.节点配置 1.vim elasticsearch.yml # ======================== Elasticsearch Configuration ===== ...

  2. Elasticsearch静态集群配置

    这两天需要将ELK中的单节点运行的ES扩展为双节点,查询了下集群配置,百度搜索结果还是一如既往的坑,基本都是各种转帖,以下记录配置静态集群的步骤: * * * <pre><code& ...

  3. 搭建ELK日志分析平台(上)—— ELK介绍及搭建 Elasticsearch 分布式集群

    笔记内容:搭建ELK日志分析平台(上)-- ELK介绍及搭建 Elasticsearch 分布式集群笔记日期:2018-03-02 27.1 ELK介绍 27.2 ELK安装准备工作 27.3 安装e ...

  4. CentOS6安装各种大数据软件 第四章:Hadoop分布式集群配置

    相关文章链接 CentOS6安装各种大数据软件 第一章:各个软件版本介绍 CentOS6安装各种大数据软件 第二章:Linux各个软件启动命令 CentOS6安装各种大数据软件 第三章:Linux基础 ...

  5. Centos6 安装 Redis 和集群配置

    Redis安装 先确认gcc和tcl已经安装 sudo yum install gcc-c++ sudo yum install tcl 解压, 编译和安装 .tar.gz /usr/src/ cd ...

  6. ES2:ElasticSearch 集群配置

    ElasticSearch共有两个配置文件,都位于config目录下,分别是elasticsearch.yml和logging.yml,其中,elasticsearch.yml 用来配置Elastic ...

  7. ElasticSearch入门 第二篇:集群配置

    这是ElasticSearch 2.4 版本系列的第二篇: ElasticSearch入门 第一篇:Windows下安装ElasticSearch ElasticSearch入门 第二篇:集群配置 E ...

  8. ELK——Elasticsearch 搭建集群经验

    本文内容 背景 ES集群中第一个master节点 ES slave节点 本文总结 Elasticsearch(以下简称ES)搭建集群的经验.以 Elasticsearch-rtf-2.2.1 版本为例 ...

  9. elasticsearch系列八:ES 集群管理(集群规划、集群搭建、集群管理)

    一.集群规划 搭建一个集群我们需要考虑如下几个问题: 1. 我们需要多大规模的集群? 2. 集群中的节点角色如何分配? 3. 如何避免脑裂问题? 4. 索引应该设置多少个分片? 5. 分片应该设置几个 ...

随机推荐

  1. Android使用genymotion模拟器

    做android开发这么久了,最头痛的就是默认的模拟器慢的像蜗牛一样,实在是受够了.以前知道有genymotion存在,但是一直没有去用,今天下来用了下,哇,速度超快啊,还在用默认模拟器的小伙伴快来吧 ...

  2. 关于Struts2的多文件上传

    之前写过一篇文章,关于Struts2文件上传:http://www.cnblogs.com/lichenwei/p/3927964.html 现在来说下多文件上传,其实就把上传文件当成是一个数组去处理 ...

  3. Hibernate的七种映射关系之七种关联映射(一)

    关联映射就是将关联关系映射到数据库里,在对象模型中就是一个或多个引用. 一.Hibernate多对一关联映射:就是在“多”的一端加外键,指向“一”的一端. 比如多个学生对应一个班级,多个用户对应一个级 ...

  4. JavaScript 使用穷举方式实现内容简繁转换

    场景: 在Web开发中,有时存在对内容进行简体和繁体互相转换的需求,这时我们可以参考以下做法. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 ...

  5. unity, WaterProDaytime注意事项。

    一,多个WaterProDaytime不要公用material. 原因是:水面material的shader(FXWaterPro.shader)引用了reflectionTexture,而水面1的r ...

  6. C#删除文件直接到回收站,而不是直接删除

    记录下: FileSystem.DeleteDirectory(physicalPath, UIOption.OnlyErrorDialogs, RecycleOption.SendToRecycle ...

  7. 源码分析八(org.springframework.util包之StringUtils类))

    一:spring框架util包中的StringUtils类主要是处理关于字符串 的功能方法,下面直接结合代码分析: //判断字符串是否为空,如果为nul或者""则返回true,否则 ...

  8. 安装 运行yum报错:No module named yum

    报错情况: There was a problem importing one of the Python modulesrequired to run yum. The error leading ...

  9. nagios安装check_linux_stats.pl插件报错Can't locate Sys/Statistics/Linux.pm in @INC的处理?

    问题描述: 今天想有没有监控主机内存的插件可以供nagios来使用,然后找到一个插件check_linux_stats.pl 但是在将脚本上传之后,执行的时候报错 [root@testvm02 lib ...

  10. 将文件导入到SQL server数据库表中的字段中

    一.在要执行的sql server数据库a中执行如下脚本,创建存储过程sp_textcopy /* 将二进制文件导入.导出到数据库相应字段列中 */ CREATE PROCEDURE sp_textc ...