还在停机更新 Gateway 配置,OUT 了。
今天和大家分享一个 Gateway 的功能:动态加载配置(也称热更新或热加载)。
这个功能可以在 Gateway 不停机的情况下更新配置并使之生效。
配置样例如下:
path.data: data
path.logs: logconfigs:auto_reload: true # set true to auto reload gateway configurationsentry:- name: my_es_entryenabled: truerouter: my_routermax_concurrency: 200000network:binding: 0.0.0.0:8000flow:- name: simple_flowfilter:- http:schema: httpshost: 192.168.0.102:9200router:- name: my_routerdefault_flow: simple_flow
启动 Gateway,配置自动加载开启。
修改配置,如下:
path.data: data
path.logs: logconfigs:auto_reload: true # set true to auto reload gateway configurationsentry:- name: my_es_entryenabled: truerouter: my_routermax_concurrency: 200000network:binding: 0.0.0.0:8000flow:- name: simple_flowfilter:- elasticsearch:elasticsearch: devrouter:- name: my_routerdefault_flow: simple_flowelasticsearch:- name: devenabled: trueendpoint: http://localhost:9200basic_auth:username: testpassword: testtest
从日志中可以看出修改后的配置文件已经加载。
关于极限网关(INFINI Gateway)
INFINI Gateway 是一个开源的面向搜索场景的高性能数据网关,所有请求都经过网关处理后再转发到后端的搜索业务集群。基于 INFINI Gateway,可以实现索引级别的限速限流、常见查询的缓存加速、查询请求的审计、查询结果的动态修改等等。
官网文档:https://docs.infinilabs.com/gateway/main/
开源地址:https://github.com/infinilabs/gateway