es configuration file (elasticsearch.yml)

There are two configuration files in the config directory: es configuration file ( elasticsearch.yml ) and log configuration file ( logging.yml  )

cluster.name:
The cluster name of elasticsearch configuration es, the default is elasticsearch, es will automatically discover es under the same network segment, if there are multiple clusters under the same network segment, you can use this attribute to distinguish different clusters.

 

node.name: "Franz Kafka"
node name. By default, a name in the name list is randomly assigned. The list is in the name.txt file in the config folder of the es jar package. There are many interesting names added by the author.

node.master: true
specifies whether the node is eligible to be elected as a node, the default is true, es is the first machine in the default cluster as the master, if the machine hangs up, the master will be re-elected.

node.data: true
specifies whether the node stores index data, the default is true.

index.number_of_shards: 5
Sets the default number of index shards, the default is 5 shards.

index.number_of_replicas: 1
sets the default number of index replicas, the default is 1 replica.

path.conf: /path/to/conf
sets the storage path of the configuration file. The default is the config folder in the es root directory.

path.data: /path/to/data
sets the storage path of the index data. The default is the data folder in the es root directory. Multiple storage paths can be set, separated by commas, for example:
path.data: /path/to /data1,/path/to/data2

path.work: /path/to/work
Sets the storage path for temporary files. The default is the work folder in the es root directory.

path.logs: /path/to/logs
sets the storage path of log files, the default is the logs folder in the es root directory

path.plugins: /path/to/plugins
Set the storage path of the plugin, the default is the plugins folder in the es root directory

bootstrap.mlockall: true
Set to true to lock memory. Because the efficiency of es will be reduced when the jvm starts swapping, to ensure that it does not swap, you can set the two environment variables ES_MIN_MEM and ES_MAX_MEM to the same value, and ensure that the machine has enough memory allocated to es. At the same time, it is necessary to allow the elasticsearch process to lock the memory. Under Linux, you can use the `ulimit -l unlimited` command.

network.bind_host: 192.168.0.1
Set the bound ip address, which can be ipv4 or ipv6, the default is 0.0.0.0.


network.publish_host: 192.168.0.1
Set the ip address of other nodes interacting with this node. If it is not set, it will be automatically judged. The value must be a real ip address.

network.host: 192.168.0.1
这个参数是用来同时设置bind_host和publish_host上面两个参数。

transport.tcp.port: 9300
设置节点间交互的tcp端口,默认是9300。

transport.tcp.compress: true
设置是否压缩tcp传输时的数据,默认为false,不压缩。

http.port: 9200
设置对外服务的http端口,默认为9200。

http.max_content_length: 100mb
设置内容的最大容量,默认100mb

http.enabled: false
是否使用http协议对外提供服务,默认为true,开启。

gateway.type: local
gateway的类型,默认为local即为本地文件系统,可以设置为本地文件系统,分布式文件系统,hadoop的HDFS,和amazon的s3服务器,其它文件系统的设置方法下次再详细说。

gateway.recover_after_nodes: 1
设置集群中N个节点启动时进行数据恢复,默认为1。

gateway.recover_after_time: 5m
设置初始化数据恢复进程的超时时间,默认是5分钟。

gateway.expected_nodes: 2
设置这个集群中节点的数量,默认为2,一旦这N个节点启动,就会立即进行数据恢复。

cluster.routing.allocation.node_initial_primaries_recoveries: 4
初始化数据恢复时,并发恢复线程的个数,默认为4。

cluster.routing.allocation.node_concurrent_recoveries: 2
添加删除节点或负载均衡时并发恢复线程的个数,默认为4。

indices.recovery.max_size_per_sec: 0
设置数据恢复时限制的带宽,如入100mb,默认为0,即无限制。

indices.recovery.concurrent_streams: 5
设置这个参数来限制从其它分片恢复数据时最大同时打开并发流的个数,默认为5。

discovery.zen.minimum_master_nodes: 1
设置这个参数来保证集群中的节点可以知道其它N个有master资格的节点。默认为1,对于大的集群来说,可以设置大一点的值(2-4)

discovery.zen.ping.timeout: 3s
设置集群中自动发现其它节点时ping连接超时时间,默认为3秒,对于比较差的网络环境可以高点的值来防止自动发现时出错。

discovery.zen.ping.multicast.enabled: false
设置是否打开多播发现节点,默认是true。

discovery.zen.ping.unicast.hosts: ["host1", "host2:port", "host3[portX-portY]"]
设置集群中master节点的初始列表,可以通过这些节点来自动发现新加入集群的节点。

下面是一些查询时的慢日志参数设置
index.search.slowlog.level: TRACE
index.search.slowlog.threshold.query.warn: 10s
index.search.slowlog.threshold.query.info: 5s
index.search.slowlog.threshold.query.debug: 2s
index.search.slowlog.threshold.query.trace: 500ms

index.search.slowlog.threshold.fetch.warn: 1s
index.search.slowlog.threshold.fetch.info: 800ms
index.search.slowlog.threshold.fetch.debug:500ms
index.search.slowlog.threshold.fetch.trace: 200ms

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326289651&siteId=291194637