Kong API网关
Kong API网关 API网关特点 集合多个API,统一API入口 避免内部信息泄露 提供安全认证 支持混合通讯协议 降低微服务复杂度 常用的API网关有:NGINX,Zuul,Kong Kong 介绍 kong是微服务中的一个网关组件,具有高可用和可扩展性,能提供易于使用的restful api来操作和配置API管理系统,同时它也可以通过负载均衡的功能把请求均匀的分发到各个服务器上,应对大量的请求。基于Nginx和OpenResty,是一个具有分布式、高性能、高并发、可伸缩…亚毫秒级延迟等特性和功能的微服务抽象层。 konga 是kong的UI界面 多用户管理 管理多个kong节点 使用快照备份,还原和迁移Kong节点 使用运行状态检查监控节点和API状态 数据库集成postgresSQL Kong 流程图 Kong 安装 Kong下载安装 Konga下载安装 API操作 文档地址 示例: 负载均衡 # 添加负载均衡 curl -i -X POST \ -H "Content-Type:application/x-www-form-urlencoded" \ -d "name=demo-upstream" \ 'http://127.0.0.1:8001/upstreams' #设置权重 curl -i -X POST \ -H "Content-Type:application/x-www-form-urlencoded" \ -d "target=127.0.0.1:8000" \ -d "weight=100" \ 'http://127.0.0.1:8001/upstreams/demo-upstream/targets' curl -i -X POST \ -H "Content-Type:application/x-www-form-urlencoded" \ -d "target=127.0.0.1:8080" \ -d "weight=500" \ 'http://127....