ElasticSearch配置优化,优化人员配置


运行中可优化的配置

  • 禁止通配符删除
    PUT  http://192.168.112.101:9200/_cluster/settings
    {
    	"transient":{
    		"action.destructive_requires_name":true
    	}
    }
    
  • 准实时
    elastic2.x: 在配置文件中增加index.refresh_interval: 30s,重启
    elastic5.x:
    PUT  http://192.168.112.101:9200/_all/_settings?	preserve_existing=true
    {
    	"index.refresh_interval":"30s"	
    }
    

ES配置文件中的配置优化

有的elasticsearch配置必须在配置文件中配置,重启之后才能生效,就像如下配置:

# 节点间的存活监测
discovery.zen.fd.ping_interval:10s
	
# 节点间的存活超时时间
discovery.zen.fd.ping_timeout:10s

# 节点间的超时重连次数
discovery.zen.fd.ping_retries:10

# 指挥节点配置
node.master: true
mode.data: false

# 数据节点配置
node.master: false
mode.data: true

# 负载均衡节点配置(数据汇总),一般不使用ES自身做
node.master: false
mode.data: false

# 针对数据节点http功能关闭
http.enable: false

nginx负载均衡

使用stream实现,在nginx的配置文件nginx.conf中增加配置:

   stream {
   	upstream backend{
   		server 127.0.0.1:9300;
   	}
   
   	server{
   		listen 9999;
   		proxy_timeout 20s;
   		proxy_pass backend;
   	}
   }

参考文章:
Elasticsearch集群节点配置详解

文章最后发布于: 2019-10-24 16:48:13

相关内容

    暂无相关文章