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. Logback中文文档(三):配置

    在第一部分,我们将介绍配置 logback 的各种方法,给出了很多配置脚本例子.在第二部分,我们将介绍 Joran,它是一个通用配置框架,你可以在自己的项目里使用 Joran. Logback里的配置 ...

  2. 使用w查看系统负载 vmstat命令 top命令 sar命令 nload命令

    w/uptime 查看系统负载 w查看系统负载,uptime跟w一样. [root@centos7 ~]# w 22:34:10 up 6 days, 23:10,  4 users,  load a ...

  3. 如何解析本地和线上XML文件获取相应的内容

    一.使用Dom解析本地XML 1.本地XML文件为:test.xml <?xml version="1.0" encoding="UTF-8"?> ...

  4. web_submit_data详解

    定义:处理无状态或者上下文无关的表单提交.它用来生成表单的GET或POST请求,这些请求与Form自动生成的请求是一样的,发送这些请求时不需要表单上下文. 函数形式:web_submit_data( ...

  5. [转]java线程安全、jstack\线程dump、内存查看分析总结

    http://jameswxx.iteye.com/blog/808546 java线程安全总结二 http://jameswxx.iteye.com/blog/1041173 jstack和线程du ...

  6. SpringBoot实战(四)之使用JDBC和Spring访问数据库

    这里演示的是h2databse示例,所以简单的介绍普及下h2database相关知识 H2数据库是一个开源的关系型数据库. H2是一个嵌入式数据库引擎,采用java语言编写,不受平台的限制,同时H2提 ...

  7. 11gR2 RAC:更换OCR、votedisk

    要点: ocrconfig 备份-恢复 ocrconfig 导出-导入 crsctl querry css votedisk crsctl replace votedisk {+dsikgroup|s ...

  8. python--面向对象--14

    原创博文,转载请标明出处--周学伟http://www.cnblogs.com/zxouxuewei/ Python 面向对象 Python从设计之初就已经是一门面向对象的语言,正因为如此,在Pyth ...

  9. ios7注意事项随笔

    1,修改状态栏的样式和隐藏. 首先,需要在Info.plist配置文件中,增加键:UIViewControllerBasedStatusBarAppearance,并设置为YES: 然后,在UIVie ...

  10. Linux+Redis实战教程_day03_4、通用redis命令【重点】

    4.通用redis命令[重点] Redis五种数据类型,String,hash,list,set,有序set l keys pattern:获取所有与pattern匹配的key,返回所有与该key匹配 ...