elasticsearch.yml

discovery.zen.minimum_master_nodes: 2
这个参数决定了要选举一个Master需要多少个主节点(最少候选主节点数)。默认值是1。官方给出的建议是 N/2 + 1,N是集群中主节点的数量,例如一个有3个主节点的集群,minimum_master_nodes 应该被设置成 3/2 + 1 = 2(向下取整)。

discovery.zen.ping_timeout: 30s
这个参数指定从节点访问主节点后如果N秒之内没有回复则默认主节点挂了,默认为3s

discovery.zen.join_timeout:5s
加入超时时间,默认为discovery.zen.ping_timeout的3倍

discovery.zen.ping.multicast.enabled: false
默认使用单播发现模式,防止节点无意中加入集群

discovery.zen.ping.unicast.hosts: ["192.168.0.1:9300","192.168.0.2:9300"]
设置集群中master节点的初始列表,可以通过这些节点来自动发现新加入集群的节点。

cluster.name: elasticsearch
配置es的集群名称,默认是elasticsearch,es会自动发现在同一网段下的es,如果在同一网段下有多个集群,就可以用这个属性来区分不同的集群。

node.name: "Franz Kafka"
节点名,默认随机指定一个name列表中名字,该列表在es的jar包中config文件夹里name.txt文件中,其中有很多作者添加的有趣名字。

node.master: true
指定该节点是否有资格被选举成为node,默认是true,es是默认集群中的第一台机器为master,如果这台机挂了就会重新选举master。

node.data: true
指定该节点是否存储索引数据,默认为true。

index.number_of_shards: 5
设置默认索引分片个数,默认为5片。

index.number_of_replicas: 1
设置默认索引副本个数,默认为1个副本。

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

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

network.bind_host: 192.168.0.1
设置绑定的ip地址,可以是ipv4或ipv6的,默认为0.0.0.0。

network.publish_host: 192.168.0.1
设置其它节点和该节点交互的ip地址,如果不设置它会自动获取,值必须是个真实的ip地址。

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

gateway.recover_after_nodes: 8
Elasticsearch 在存在至少 8 个节点(数据节点或者 master 节点)后进行数据恢复。

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

gateway.recover_after_time: 5m
设置初始化数据恢复进程的超时时间,默认是5分钟。和gateway.expected_nodes先达到一个即可

gateway.recover_after_nodes,gateway.expected_nodes,gateway.recover_after_time这三个设置可以在集群重启的时候避免过多的分片交换。这可能会让数据恢复从数个小时缩短为几秒钟。

bootstrap.mlockall: true
允许 JVM 锁住内存,禁止内存被交换至交换区,使用交换分区,影响elasticsearch性能

action.destructive_requires_name: true
删除只限于特定名称指向的数据, 而不允许通过指定 _all 或通配符来删除指定索引库

action.auto_create_index: false
禁止自动创建索引

 

posted @ 2019-07-17 12:15  努力挣扎的小兵  阅读(378)  评论(0编辑  收藏  举报