实现极限网关(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

相关推荐
xrkhy16 分钟前
微服务之Gateway网关(1)
微服务·架构·gateway
无名客05 天前
SpringCloud中的网关(Gateway)的作用是什么?
spring·spring cloud·gateway
smilecold6 天前
SpringCloud 入门 - Gateway 网关与 OpenFeign 服务调用
spring cloud·gateway
INFINI Labs9 天前
Elasticsearch 备份:方案篇
大数据·elasticsearch·搜索引擎·gateway·snapshot·backup·ccr
纤瘦的鲸鱼9 天前
Spring Gateway 全面解析:从入门到进阶实践
java·spring·gateway
INFINI Labs11 天前
如何使用 INFINI Gateway 对比 ES 索引数据
大数据·elasticsearch·gateway·easysearch
m0_6515939113 天前
位置透明性、Spring Cloud Gateway与reactor响应式编程的关系
java·spring cloud·系统架构·gateway
nvd1114 天前
使用gateway api来实现GKE 的pods 从外部访问
gateway·googlecloud
罗不俷14 天前
【Kubernetes】(二十)Gateway
容器·kubernetes·gateway
月夕·花晨15 天前
Gateway-过滤器
java·分布式·spring·spring cloud·微服务·gateway·sentinel