博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ElasticSearch5.4.3 环境搭建 2017 (2-集群搭建)
阅读量:2113 次
发布时间:2019-04-29

本文共 3370 字,大约阅读时间需要 11 分钟。

软件环境:

ElasticSearch5.4.3

Centos 6.8 两台

JavaJDK 1.8.0_131

集群名称:

cluster.name: test_es

node.name:

节点1: node-115

节点2: node-114

搭建开始:

前面单节点搭建完成之后,下面搭建集群,比较简单因为问题都上面遇到的解决了,剩下的问题就不多了。

安装完成之后,按照前两篇的步骤,下面修改配置文件/etc/elasticsearch/elasticsearch.yml如下:

# ======================== 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: test_es #集群名称必须一样## ------------------------------------ Node ------------------------------------## Use a descriptive name for the node:#node.name: node-115 #两台服务器节点名字不能相同## 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: /mnt/elasticsearch-5.4.3/data## Path to log files:#path.logs: /mnt/elasticsearch-5.4.3/logs## ----------------------------------- Memory -----------------------------------## Lock the memory on startup:#bootstrap.memory_lock: true## 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: 10.144.255.45 #本机的域内ip## Set a custom port for HTTP:##http.port: 9200## 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: ["10.163.189.82"] #另一台服务器的域内ip## Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):#discovery.zen.minimum_master_nodes: 2## 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: truebootstrap.system_call_filter: false

两台机器的配置基本相同,

elasticsearch.yml两台不同的地方

 1. 上面标注域内ip的地方,network.host每台服务器上都填写自己的域内也就是内网ip。   

 2. node.name各自取一个名称,不能相同。

 3. discovery.zen.ping.unicast.hosts填写另外几台,这里只有一台,多个用,隔开即可,然后分别启动两台服务器的节点。如下:

第一台服务器:下面是tail看日志信息有点多

第二台服务器的启动:启动方式一样,启动完成查看启动情况

这样就集群了两个节点。

配置文件:

你可能感兴趣的文章
简述 XLNet 的原理和应用
查看>>
实战:为图片生成文本摘要
查看>>
论文复现:用 CNN 进行文本分类
查看>>
多复杂的 CNN 都离不开的这几个基本结构
查看>>
实践:动手搭建神经机器翻译模型
查看>>
透彻理解神经机器翻译的原理
查看>>
实践:动手搭建聊天机器人
查看>>
情感分析 Kaggle 实战
查看>>
动手实现 Bahdanau 注意力模型
查看>>
用一个小例子理解 seq2seq 的本质
查看>>
双向 LSTM-CRF 实现命名实体识别
查看>>
序列模型实现词性标注
查看>>
双向 RNN 识别手写数字
查看>>
Peephole LSTM、GRU 实战
查看>>
LSTM 的几种改进方案
查看>>
用 word2vec 进行文档聚类
查看>>
详解 GloVe 的原理和应用
查看>>
word2vec:基于层级 softmax 和负采样的 Skip-Gram
查看>>
word2vec:基于层级 softmax 和负采样的 CBOW
查看>>
用 RNN 建立语言模型
查看>>