- Elasticsearch 7.0 Cookbook(Fourth Edition)
- Alberto Paro
- 246字
- 2021-06-24 14:51:50
How it works…
The following are the main important configuration keys for networking management:
- cluster.name: This sets up the name of the cluster. Only nodes with the same name can join together.
- node.name: If not defined, this is automatically assigned by Elasticsearch.
node.name allows defining a name for the node. If you have a lot of nodes on different machines, it is useful to set their names to something meaningful in order to easily locate them. Using a valid name is easier to remember than a generated name such as fyBySLMcR3uqKiYC32P5Sg.
network.host defines the IP of your machine to be used to bind the node. If your server is on different LANs, or you want to limit the bind on only one LAN, you must set this value with your server IP.
discovery.zen.ping.unicast.hosts allows you to define a list of hosts (with ports or a port range) to be used to discover other nodes to join the cluster. The preferred port is the transport one, usually 9300.
The addresses of the hosts list can be a mix of the following:
- Hostname, that is, myhost1
- IP address, that is, 192.168.1.12
- IP address or hostname with the port, that is, myhost1:9300, 192.168.168.1.2:9300
- IP address or hostname with a range of ports, that is, myhost1:[9300-9400], 192.168.168.1.2:[9300-9400]