Got it

Elasticsearch Configuration File - elasticsearch.yml

Latest reply: Nov 21, 2021 15:43:06 770 2 1 0 0

Hello, everyone!

The following configuration description is for elasticsearch.yml.

//Specifies the name of the Elasticsearch cluster. The default value is elasticsearch. Elasticsearch automatically discovers Elasticsearch nodes in the same network segment. If there are multiple clusters in the same network segment, you can use this attribute to distinguish different clusters.

cluster.name: elasticsearch

//Node name. By default, a name in the name list is randomly specified and must be unique.

node.name: "node1"

//Specifies whether the node is eligible to be elected as a node. The default value is true. The ES is the first host in the default cluster as the master. If the host fails, the master is elected again.

node.master: true

//Specifies whether the node stores index data. The default value is true.

node.data: true

//Specifies the default number of index shards. The default value is 5.

index.number_of_shards: 5

//Specifies the default number of index copies. The default value is 1.

index.number_of_replicas: 1

//Set the path for storing the configuration file. The default path is the config folder in the es root directory.

path.conf: /path/to/conf

//Specifies the path for storing index data. The default path is the data folder in the es root directory.

path.data: /path/to/data

//You can set multiple storage paths and separate them with commas (,). The configuration method is as follows:

path.data: /path/to/data1,/path/to/data2

//You can set the path for storing temporary files. The default path is the work folder in the es root directory.

path.work: /path/to/work

//Set the path for storing log files. The default path is the logs folder in the root directory of the es.

path.logs: /path/to/logs

//Set the path for storing the plug-in. The default path is the plugins folder in the root directory of the es.

path.plugins: /path/to/plugins

//Set to true to lock memory. The efficiency of the ES decreases when the JVM starts swapping. To ensure that the ES does not swap, you can set the ES_MIN_MEM and ES_MAX_MEM environment variables to the same value and ensure that the machine has sufficient memory for the ES. In addition, you can run the ulimit -l unlimited command in Linux to allow the Elasticsearch process to lock the memory.

bootstrap.mlockall: true

//Specifies the bound IP address. The value can be an IPv4 or IPv6 address. The default value is 0.0.0.0.

network.bind_host: 192.168.0.1

//This parameter specifies the IP address used by other nodes to interact with the node. If this parameter is not set, the node automatically determines the IP address. The value must be a real IP address.

network.publish_host: 192.168.0.1

//This parameter is used to set the bind_host and publish_host parameters at the same time.

network.host: 192.168.0.1

//Set the TCP port for communication between nodes. The default value is 9300. (In a cluster, pay attention to the port differentiation.)

transport.tcp.port: 9300

//Specifies whether to compress the data during TCP transmission. The default value is false, indicating that the data is not compressed.

transport.tcp.compress: true

//Set the HTTP port number for external services. The default value is 9200. (When a cluster is deployed on the same server, pay attention to port differences.)

http.port: 9200

//Set the maximum content capacity. The default value is 100 MB.

http.max_content_length: 100mb

//Indicates whether to use HTTP to provide services externally. The default value is true.

http.enabled: false

//Gateway type. The default value is local, which indicates the local file system. The value can be local file system, distributed file system, Hadoop HDFS, or Amazon S3 server.

gateway.type: local

//Specifies whether to restore data when N nodes in the cluster are started. The default value is 1.

gateway.recover_after_nodes: 1

//Timeout interval for initializing the data recovery process. The default value is 5 minutes.

gateway.recover_after_time: 5m

//Set the number of nodes in the cluster. The default value is 2. Once the N nodes are started, data is restored immediately.

gateway.expected_nodes: 2

//Number of concurrent restoration threads during initial data restoration. The default value is 4.

cluster.routing.allocation.node_initial_primaries_recoveries: 4

//Number of concurrent restoration threads during node addition or deletion or load balancing. The default value is 4.

cluster.routing.allocation.node_concurrent_recoveries: 2

//Specifies the bandwidth limit for data restoration. For example, if the input bandwidth is 100 Mbit/s, the default value is 0, indicating that the bandwidth is not limited.

indices.recovery.max_size_per_sec: 0

//Set this parameter to limit the maximum number of concurrent streams that can be opened when data is restored from other shards. The default value is 5.

indices.recovery.concurrent_streams: 5

//Set this parameter to ensure that nodes in the cluster can know the other N master nodes. The default value is 1. For a large cluster, you can set a larger value (2 to 4).

discovery.zen.minimum_master_nodes: 1

//Specifies the ping connection timeout interval for automatically discovering other nodes in the cluster. The default value is 3 seconds. If the network environment is poor, you can set the ping connection timeout interval to a larger value to prevent errors during automatic discovery.

discovery.zen.ping.timeout: 3s

//Indicates whether to enable the multicast discovery node. The default value is true.

discovery.zen.ping.multicast.enabled: false

//Specifies the initial list of master nodes in the cluster. You can use these nodes to automatically discover new nodes in the cluster.

discovery.zen.ping.unicast.hosts: ["host1", "host2:port", "host3[portX-portY]"]

That's all, thanks!

  • x
  • convention:

olive.zhao
Admin Created Nov 15, 2021 02:26:19

Thanks for your sharing!
View more
  • x
  • convention:

user_4358465
Created Nov 21, 2021 15:43:06

Interesting. Thank you for sharing
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.
Information Protection Guide
Thanks for using Huawei Enterprise Support Community! We will help you learn how we collect, use, store and share your personal information and the rights you have in accordance with Privacy Policy and User Agreement.