elasticsearch 跨网段组集群
elasticsearch 是非常流行的全文搜索引擎,但网上的教程多是初次使用,并没有一些高级用法demo。这次遇到需要跨网段组网问题,自己摸索了文档很久,发现确实可行,于是着手做了个实验,最终实验成功。在跨网段下实现了自动发现和组网。
总共运行了三个节点,一个节点IP是192.168.45.67,另外两个节点IP都是172.20.5.161三个文件的配置文件都改为如下配置文件,先后启动三个节点,记录日志在后面。
192.168.45.67节点启动后,自动用9300作为通信端口,将自身作为master节点存在。
172.20.5.161节点启动后,自动用9300作为通信端口,发现hosts列表中有master存在,master将其加入集群中。
172.20.5.161节点启动后,发现9300被占用,自动用9301作为通信端口,发现hosts列表中有master存在,master将其加入集群中。
192.168.45.67:9300添加日志
172.20.5.161:9300添加日志
172.20.5.161:9301添加
elasticsearch-1.5.2/config/elasticsearch.yml需要修改部分为
discovery.zen.ping.multicast.enabled和discovery.zen.ping.unicast.hosts,修改如下:
################################## Discovery ################################## # Discovery infrastructure ensures nodes can be found within a cluster
# and master node is elected. Multicast discovery is the default. # Set to ensure a node sees N other master eligible nodes to be considered
# operational within the cluster. This should be set to a quorum/majority of
# the master-eligible nodes in the cluster.
#
#discovery.zen.minimum_master_nodes: 1 # Set the time to wait for ping responses from other nodes when discovering.
# Set this option to a higher value on a slow or congested network
# to minimize discovery failures:
#
#discovery.zen.ping.timeout: 3s # For more information, see
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-zen.html> # Unicast discovery allows to explicitly control which nodes will be used
# to discover the cluster. It can be used when multicast is not present,
# or to restrict the cluster communication-wise.
#
# 1. Disable multicast discovery (enabled by default):
#
discovery.zen.ping.multicast.enabled: false
#
# 2. Configure an initial list of master nodes in the cluster
# to perform discovery when new nodes (master or data) are started:
#
discovery.zen.ping.unicast.hosts: ["192.168.45.67", "172.20.5.161:9300"] # EC2 discovery allows to use AWS EC2 API in order to perform discovery.
#
# You have to install the cloud-aws plugin for enabling the EC2 discovery.
#
# For more information, see
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-ec2.html>
#
# See <http://elasticsearch.org/tutorials/elasticsearch-on-ec2/>
# for a step-by-step tutorial. # GCE discovery allows to use Google Compute Engine API in order to perform discovery.
#
# You have to install the cloud-gce plugin for enabling the GCE discovery.
#
# For more information, see <https://github.com/elasticsearch/elasticsearch-cloud-gce>. # Azure discovery allows to use Azure API in order to perform discovery.
#
# You have to install the cloud-azure plugin for enabling the Azure discovery.
#
# For more information, see <https://github.com/elasticsearch/elasticsearch-cloud-azure>.
配置的中文注释请看:
http://www.tuicool.com/articles/Nryu2i
elasticsearch 跨网段组集群的更多相关文章
- Elasticsearch(二)--集群原理及优化
一.ES原理 1.索引结构ES是面向文档的 各种文本内容以文档的形式存储到ES中,文档可以是一封邮件.一条日志,或者一个网页的内容.一般使用 JSON 作为文档的序列化格式,文档可以有很多字段,在创建 ...
- elasticsearch(四) 之 elasticsearch常用的一些集群命令
目录 elasticsearch常用的一些集群命令 查看集群健康状态 查看集群的节点列表 查看所有的索引 删除索引 查询索引的某个文档内容 更新文档 删除文档 自动创建索引 定时删除索引 elasti ...
- Elasticsearch(ES)集群的搭建
1. 概述 Elasticsearch(ES)集群支持分片和副本,能够很容易的实现负载均衡.扩容.容灾.高可用. 今天我们就来聊一下,Elasticsearch(ES)集群是如何搭建的. 2. 场景介 ...
- ElasticSearch 5.0.0 集群安装部署文档
1. 搭建环境 3台物理机 操作系统 centos7 es1 192.168.31.141 4g内存 2核 es2 192.168.31.142 4g内存 2核 es3 ...
- 【拆分版】Docker-compose构建Elasticsearch 7.1.0集群
写在前边 搞了两三天了,一直有个问题困扰着我,ES集群中配置怎么能正确映射到主机上,这边经常报ClusterFormationFailureHelper master not discovered o ...
- ElasticSearch 7.1.1 集群环境搭建
1. 集群简介 三台机器,均用于保存数据且可被选为master节点 服务版本 服务 版本 elasticsearch 7.1.1 jdk 1.8 1. 创建elsearch用户 不建议直接使用root ...
- Elasticsearch(ELK)集群搭建
一.前言 Elasticsearch是一个开源的高扩展的分布式全文检索引擎,它可以近乎实时的存储.检索数据:本身扩展性很好,可以扩展到上百台服务器,处理PB级别的数据.Elasticsearch也使用 ...
- elasticsearch + kibana + x-pack + logstash_集群部署安装
elasticsearch 部分总体描述: 1.elasticsearch 的概念及特点.概念:elasticsearch 是一个基于 lucene 的搜索服务器.lucene 是全文搜索的一个框架. ...
- elasticSearch数据库、skywalking集群部署
Centos6上面安装elasticsearc数据库的集群 安装的是6.3.2版本,安装之前首先要先安装jdk1.8版本 安装之前首先需要关闭防火墙 Centos6 sudo service ipta ...
随机推荐
- Array操作方法和String操作方法比较
Array 的操作方法和 String 的操作方法老是弄混>_<,下面就对于这两个对象的常用操作方法进行比较~~ Array ☞ 操作方法 concat():returns a new a ...
- USB协议-检测设备连接与速度
在USB设备连接时,USB系统能自动检测到这个连接,并识别出其采用的数据传输速率.USB采用在D+或D-线上增加上拉电阻的方法来识别低速和全速设备. USB支持3种类型的传输速率:1.5Mb/s的低速 ...
- 【转】Java中如何遍历Map对
在Java中如何遍历Map对象 How to Iterate Over a Map in Java 在java中遍历Map有不少的方法.我们看一下最常用的方法及其优缺点. 既然java中的所有map都 ...
- WeCenter程序安装
WeCenter程序安装时需要GD库和freetype的支持,以下是安装方法 GD库的安装:我们可以直接使用yum命令来安装,自动解决依赖关系及安装GD库相关的包. [root@localhost ~ ...
- 274. H-Index
Given an array of citations (each citation is a non-negative integer) of a researcher, write a funct ...
- spring+websocket整合
java-websocket的搭建非常之容易,没用框架的童鞋可以在这里下载撸主亲自调教好的java-websocket程序: Apach Tomcat 8.0.3+MyEclipse+maven+JD ...
- 关于linux软连接
以前一直搞不懂linux软连接用什么 只知道是类似于linux的快捷方式 sudo ln -s /home/hadoop/bigdata/jdk1.7.0_79/ /usr/local/jdk(创建软 ...
- phpmyadmin的安装和使用
首先在phpmyadmin的官方网站的下载页面根据自己的PHP以及MYSQL的版本下载对应的phpmyadmin版本. 图中红框部分标识此版本支持度额PHP版本以及MYADL版本. 比如此版本就是支持 ...
- tomcat的配置详解:[1]tomcat绑定域名
转自:http://jingyan.baidu.com/article/7e440953dc096e2fc0e2ef1a.html tomcat的配置详解:[1]tomcat绑定域名分步阅读 在jav ...
- 复利计算- 结对2.0--复利计算WEB升级版
客户在大家的引导下,有了更多的想法: 这个数据我经常会填.....帮我预先填上呗?...... 把界面做得简单漂亮好操作一点呗? 能不能帮我转成个APP,我装到手机上就更方便了? 我觉得这个很有用,很 ...