实现极限网关(INFINI Gateway)配置动态加载

还在停机更新 Gateway 配置,OUT 了。

今天和大家分享一个 Gateway 的功能:动态加载配置(也称热更新或热加载)。

这个功能可以在 Gateway 不停机的情况下更新配置并使之生效。

配置样例如下:

yaml 复制代码
path.data: data
path.logs: log

configs:
  auto_reload: true # set true to auto reload gateway configurations

entry:
  - name: my_es_entry
    enabled: true
    router: my_router
    max_concurrency: 200000
    network:
      binding: 0.0.0.0:8000

flow:
  - name: simple_flow
    filter:
      - http:
          schema: https
          host: 192.168.0.102:9200

router:
  - name: my_router
    default_flow: simple_flow

启动 Gateway,配置自动加载开启。

修改配置,如下:

yaml 复制代码
path.data: data
path.logs: log

configs:
  auto_reload: true # set true to auto reload gateway configurations

entry:
  - name: my_es_entry
    enabled: true
    router: my_router
    max_concurrency: 200000
    network:
      binding: 0.0.0.0:8000

flow:
  - name: simple_flow
    filter:
      - elasticsearch:
          elasticsearch: dev

router:
  - name: my_router
    default_flow: simple_flow

elasticsearch:
  - name: dev
    enabled: true
    endpoint: http://localhost:9200
    basic_auth:
      username: test
      password: testtest

从日志中可以看出修改后的配置文件已经加载。

关于极限网关(INFINI Gateway)

INFINI Gateway 是一个开源的面向搜索场景的高性能数据网关,所有请求都经过网关处理后再转发到后端的搜索业务集群。基于 INFINI Gateway,可以实现索引级别的限速限流、常见查询的缓存加速、查询请求的审计、查询结果的动态修改等等。

官网文档:https://docs.infinilabs.com/gateway/main/

开源地址:https://github.com/infinilabs/gateway

相关推荐
A叶子叶1 天前
Kong网关部署研究
python·spring cloud·微服务·gateway·kong
甜可儿3 天前
Gateway实战入门(四)、断言-请求头以及请求权重分流等
java·spring cloud·gateway
brhhh_sehe8 天前
【Java面试系列】初识GateWay网关
java·面试·gateway
程序媛学姐8 天前
SpringCloud网关:Gateway路由配置与过滤器链
java·spring cloud·gateway
时雨h10 天前
微服务架构-网关学习 以Spring Cloud Gateway为例 详细功能模块解读
微服务·架构·gateway
ronshi13 天前
Spring Cloud Gateway 使用ribbon以及nacos实现灰度发布
ribbon·nacos·gateway·灰度
carfied-feifei14 天前
云安全相关博客阅读(四)
云原生·gateway·云安全
你啊我啊你好18 天前
Spring cloud Gateway中的GlobalFilter接口及其方法
java·开发语言·缓存·gateway·软件工程
qw94920 天前
SpringCloud——Gateway新一代网关
spring boot·spring cloud·gateway