elasticsearch 集群搭建

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了elasticsearch 集群搭建相关的知识,希望对你有一定的参考价值。

需要编辑的文件是config/elasticsearch.yml文件

需要配置的项目有:

# Use a descriptive name for your cluster:
#
 cluster.name: Hadoop
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
#node.name: nn2
 node.name: ${HOSTNAME}
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
 network.host: 192.168.56.122
#
# Set a custom port for HTTP:
#
# http.port: 9200
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
# gateway.recover_after_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html>
#
# --------------------------------- Discovery ----------------------------------
#
# Elasticsearch nodes will find each other via unicast, by default.
#
# 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: ["nn1","nn2","dn1"]

在同一个网络中,如果启用多播,就会自动发现,生产环境中建议使用单播,有更好的稳定性。

遇到这个问题,一直以为是自己的网络问题,想偏了。

应该细细阅读配置文件,或者是去官方文档上细细阅读,如果想把ELK应用于生产环境,真得需要对文档熟悉,提高工作的效率。

https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html

以上是关于elasticsearch 集群搭建的主要内容,如果未能解决你的问题,请参考以下文章

Elasticsearch集群环境搭建

Elasticsearch集群环境搭建

Elasticsearch集群环境搭建

ElasticSearch集群的搭建

elasticsearch 集群搭建

elasticsearch集群搭建