The file you need to edit is a config/elasticsearch.yml file
The items that need to be configured are:
# 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 a Ddress to a specific IP (IPV4 or IPV6): # network.host:192.168.56.122## Set a custom port for http:## http.port:9200## Fo R 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 is started:## gateway.recover_after_nodes:3## For more information, see the Documenta tion at:#<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html># #---------------------------------Discovery----------------------------------# # Elasticsearch nodes'll find Each other via unicast, by default.## Pass A initial list of hosts to perform discovery when new node is started:# the de Fault list of hosts is ["127.0.0.1", "[:: 1]"]# discovery.zen.ping.unicast.hosts: ["nn1", "Nn2", "DN1"]
In the same network, if multicast is enabled, it is automatically discovered that unicast is recommended in the production environment for better stability.
Encounter this problem, always thought is their own network problem, want to biased.
Should read the configuration file carefully, or go to the official documents to read carefully, if you want to apply elk to the production environment, you really need to be familiar with the document, improve the efficiency of the work.
Https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html
Elasticsearch Cluster Construction