ELK系列七:Elasticsearch的集群配置和监控以及在部署ELK中踩的坑
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中踩的坑的更多相关文章
- ES系列十六、集群配置和维护管理
一.修改配置文件 1.节点配置 1.vim elasticsearch.yml # ======================== Elasticsearch Configuration ===== ...
- Elasticsearch静态集群配置
这两天需要将ELK中的单节点运行的ES扩展为双节点,查询了下集群配置,百度搜索结果还是一如既往的坑,基本都是各种转帖,以下记录配置静态集群的步骤: * * * <pre><code& ...
- 搭建ELK日志分析平台(上)—— ELK介绍及搭建 Elasticsearch 分布式集群
笔记内容:搭建ELK日志分析平台(上)-- ELK介绍及搭建 Elasticsearch 分布式集群笔记日期:2018-03-02 27.1 ELK介绍 27.2 ELK安装准备工作 27.3 安装e ...
- CentOS6安装各种大数据软件 第四章:Hadoop分布式集群配置
相关文章链接 CentOS6安装各种大数据软件 第一章:各个软件版本介绍 CentOS6安装各种大数据软件 第二章:Linux各个软件启动命令 CentOS6安装各种大数据软件 第三章:Linux基础 ...
- Centos6 安装 Redis 和集群配置
Redis安装 先确认gcc和tcl已经安装 sudo yum install gcc-c++ sudo yum install tcl 解压, 编译和安装 .tar.gz /usr/src/ cd ...
- ES2:ElasticSearch 集群配置
ElasticSearch共有两个配置文件,都位于config目录下,分别是elasticsearch.yml和logging.yml,其中,elasticsearch.yml 用来配置Elastic ...
- ElasticSearch入门 第二篇:集群配置
这是ElasticSearch 2.4 版本系列的第二篇: ElasticSearch入门 第一篇:Windows下安装ElasticSearch ElasticSearch入门 第二篇:集群配置 E ...
- ELK——Elasticsearch 搭建集群经验
本文内容 背景 ES集群中第一个master节点 ES slave节点 本文总结 Elasticsearch(以下简称ES)搭建集群的经验.以 Elasticsearch-rtf-2.2.1 版本为例 ...
- elasticsearch系列八:ES 集群管理(集群规划、集群搭建、集群管理)
一.集群规划 搭建一个集群我们需要考虑如下几个问题: 1. 我们需要多大规模的集群? 2. 集群中的节点角色如何分配? 3. 如何避免脑裂问题? 4. 索引应该设置多少个分片? 5. 分片应该设置几个 ...
随机推荐
- 使用 resizableImageWithCapInsets 方法实现可伸缩图片
之前介绍过通过 stretchableImageWithLeftCapWidth:topCapHeight: 方法来实现可伸缩图片: 可看这篇随笔:使用 stretchableImageWithLef ...
- input框取消光标颜色手机端不生效
<style> input{ color:transparent; } </style> <input value="我要隐藏光标"> //文字 ...
- Webkit内核探究【1】——Webkit简介
出处:http://www.cnblogs.com/jyli/archive/2010/01/31/1660355.html作者:李嘉昱 研究Webkit内核已经有一段时间了,在这期间我花了很多时间去 ...
- 详解BarTender选项大小调整模式
BarTender大小调整模式是DotCode码制独有的符号体系特殊选项.DotCode 符号可能在形状上有所不同,包括从接近正方形的点阵到细长的色带,而“大小调整模式”选项通过指定点阵的配置来确定 ...
- VC++6.0远程调试(亲试成功)
0 前言 VS2008及以上远程调试上篇已经讲过,这里再讲下VC++6.0开发环境下的远程调试能力,仅需下面4步即可,更方便的就接着后面的5-6步. 因为目标程序需要在有采集卡等相关硬件支持下的工控机 ...
- 【转】细谈Redis和Memcached的区别
Redis的作者Salvatore Sanfilippo曾经对这两种基于内存的数据存储系统进行过比较: Redis支持服务器端的数据操作:Redis相比Memcached来说,拥有更多的数据结构和并支 ...
- linux如何通过脚本来修改用户的密码?脚本自动化修改用户密码?
需求描述: linux环境中在创建用户的时候,涉及到修改用户的密码,一般是通过passwd命令进行修改,需要多次的确认,这里考虑通过一条命令直接对密码进行修改 不需要进行交互的方式.在此记录. 操作过 ...
- Python_selenium二次封装selenium的几个方法
Python_selenium二次封装selenium的几个方法 将常用的几个webdriver方法封装到自己写的一个类中去,此实例中是将"浏览器后退.浏览器前进.打开站点和关闭浏览器&qu ...
- jsoup Cookbook(中文版)-Jsoup解析HTML
jsoup Cookbook(中文版) 入门 1. 解析和遍历一个html文档 如何解析一个HTML文档: String html = "<html><head& ...
- R语言概述
R是一个有着统计分析功能及强大作图功能的软件系统,是由Ross Ihaka和Robert Gentleman共同创立.它是属于GNU系统的一个自由.免费.源码开放的软件,同一时候也是一个用于统计计算和 ...