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

相关推荐
没有bug.的程序员15 小时前
S 级 SaaS 平台的物理雪崩:Spring Cloud Gateway 多租户动态路由与 UserID 极限分片
java·gateway·springboot·saas·springcloud·多租户、·userid
code_pgf19 小时前
Jetson Orin NX 16G设备上配置AI服务自动启动的方案,包括Ollama、llama-server和OpenClaw Gateway三个组件
数据库·人工智能·安全·gateway·边缘计算·llama
tumeng071120 小时前
当遇到 502 错误(Bad Gateway)怎么办
gateway
团子和二花1 天前
openclaw平替之nanobot源码解析(八):Gateway进阶——定时任务与心跳机制
人工智能·gateway
团子和二花2 天前
openclaw平替之nanobot源码解析(七):Gateway与多渠道集成
python·gateway·agent·智能体·openclaw·nanobot
Xpower 173 天前
OpenClaw实战:从零开发电商小程序(2)
人工智能·语言模型·小程序·gateway
脱脱克克4 天前
云端 OpenClaw 远程执行本地进程原理机制详解:Gateway、approvals 与 system.run 到底谁在判定、谁在执行?
linux·gateway·openclaw
七夜zippoe5 天前
OpenClaw Gateway 服务:启动、停止、监控
微服务·架构·gateway·监控·openclaw
arvin_xiaoting5 天前
OpenClaw学习总结_I_核心架构系列_Gateway架构详解
学习·架构·llm·gateway·ai-agent·飞书机器人·openclaw
柯儿的天空5 天前
【OpenClaw 全面解析:从零到精通】第007篇:流量枢纽——OpenClaw Gateway 网关深度解析
人工智能·gpt·ai作画·gateway·aigc·ai编程·ai写作