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

相关推荐
利刃大大1 天前
【SpringCloud】Gateway Filter Factories && 过滤器执行顺序 && 自定义过滤器
java·后端·网关·spring cloud·gateway
2401_834120872 天前
spring-cloud-kubernetes与SpringCloud Gateway
spring cloud·kubernetes·gateway
猫头虎2 天前
web开发常见问题解决方案大全:502/503 Bad Gateway/Connection reset/504 timed out/400 Bad Request/401 Unauthorized
运维·前端·nginx·http·https·gateway·openresty
Jinkxs2 天前
Gateway - 内置 Filter 使用指南:AddRequestHeader、RewritePath 等实战
gateway
利刃大大3 天前
【SpringCloud】网关GateWay && Spring Cloud Gateway && Route Predicate Factories
网关·spring·spring cloud·gateway
一个向上的运维者5 天前
基于k8s的KServe 控制平面生产级部署最佳实践:基于 Gateway API 的标准化流量管理方案
llm·gateway·istio·kserve
努力也学不会java5 天前
【Spring Cloud】统一服务入口-Gateway
后端·算法·spring·spring cloud·gateway·服务发现
dinga198510267 天前
当遇到 502 错误(Bad Gateway)怎么办
gateway
岳来7 天前
网络小白对容器参数endpoint 和gateway 对比
网络·docker·容器·gateway·endpoint
invicinble7 天前
分布式组件的全域认识和操作--gateway
分布式·gateway