kong命令(四)upstream
介绍
upstream 就是一个虚拟的服务。可用于配置多个target目标服务时实现负载均衡的效果。
注意:service的host指的就是upstream的name。
同时upstream提供了一个health check方法,用于检查target目标服务是否健康。以此控制启用或禁用target目标服务
和upstream关联的kong模块:service ,target
主要参数:algorithm 负载算法:round-robin(默认), consistent-hashing
, or least-connections
healthchecks.active.http_path 健康检查路径:默认/,该地址是指在目标服务器上,适用于目标服务器的所有请求
命令
1、add upstream
方法 post
api:/upstreams
2,list upstream ,retrieve upstream
方法:get
api:/upstreams
/upstreams/upstream id or name
/targets/{target host:port or id}/upstream 关联指定target目标服务的upstream
3,update upstream
方法:patch
api:/upstreams/{upstream name or id}
/targets/{target host:port or id}/upstream
4,create or update upstream
方法:put
api:/upstreams/{upstream name or id}
/targets/{target host:port or id}/upstream
5,delete
方法:delete
api:/upstreams/{upstream name or id}
/targets/{target host:port or id}/upstream
健康检查 health check
kong会发起对配置在upstream上的所有target进行健康检查,若检查失败,将会暂时移除不健康的target服务。
恢复之后会再次加入。具体参数可在upstream参数中配置。
检查结果主要为一下四大类(官网介绍)
- If a Target fails to be activated in the balancer due to DNS issues, its status displays as
DNS_ERROR
. - When health checks are not enabled in the Upstream configuration, the health status for active Targets is displayed as
HEALTHCHECKS_OFF
. - When health checks are enabled and the Target is determined to be healthy, either automatically or manually, its status is displayed as
HEALTHY
. This means that this Target is currently included in this Upstream’s load balancer execution. - When a Target has been disabled by either active or passive health checks (circuit breakers) or manually, its status is displayed as
UNHEALTHY
. The load balancer is not directing any traffic to this Target via this Upstream.
上述HEALTHY 、HEALTHCHECKS_OFF情况,target目标可以被转发请求,其他两类不被负载转发。
查看:get方法。api:/upstreams/{name or id}/health/
人生在世,杂事七八;饭要少吃,事要多知;抽个时间,总结一下;乐在分享,自在提升
kong命令(四)upstream的更多相关文章
- Kong命令(二)service
service介绍: service 是声明了一组name.host.port.protocol等配置的函数.可以绑定route.upstream上下游服务.并且对于route.upstream可以绑 ...
- Linux makefile教程之书写命令四[转]
书写命令———— 每 条规则中的命令和操作系统Shell的命令行是一致的.make会一按顺序一条一条的执行命令,每条命令的开头必须以[Tab]键开头,除非,命令是紧跟 在依赖规则后面的分号后的.在命令 ...
- 微服务Kong(四)——添加插件
在本节中,您将学习到,如何配置使用KONG的插件来管理您的API.KONG的核心原则之一就是通过插件来实现API的扩展.插件可以使您更为简单的扩展和管理您的API. 在以下的步骤中,您将通过配置key ...
- Linux基础命令(四)
作业一:1) 开启Linux系统前添加一块大小为15G的SCSI硬盘 [root@bogon ~]# fdisk -l Disk /dev/sda: 21.5 GB, 21474836480 byte ...
- Linux命令四
作业一: 1) 开启Linux系统前添加一块大小为20G的SCSI硬盘 2) 开启系统,右击桌面,打开终端 安装的是命令行界面 3) 为新加的硬盘分区,一个主分区大小为10G,剩余空间给扩展分区,在扩 ...
- kong 命令(五)plugin
介绍 plugin 插件 是运用在kong网关各模块的功能.在http请求或响应过程中执行的插件: 可以实现认证.负载.加密等功能. kong官网提供了一些插件:https://docs.konghq ...
- kong命令(三)route
介绍 route 是一套匹配客户端请求的规则.每个route都会匹配一个service,每个service可定关联多个route. 可以说service:route=1:n.一对多的关系.每个匹配到r ...
- linux常用命令(四)
1.压缩解压命令 gzip命令 默认为.gz格式文件 1.只能压缩文件不可压缩目录 2.不保留源文件 压缩 giz 解压 gunip tar命令 -c产生打包文件 -v显示相信打包压缩过程 - ...
- Linux的一些简单命令(四)-用户和组账户管理
linux操作系统是一个多用户操作系统,它允许多用户同时登录到系统上并使用资源.系统会根据账户来区分每个用户的文件,进程,任务和工作环境,使得每个用户工作都不受干扰 1.保存用户信息的文件:/etc/ ...
随机推荐
- redis json 降低性能 使用 hash
使用hashtable和hash-max-zipmap-entries内存优化和效率http://www.flyfifi.cn/blog/detail/71/
- Swift_IOS之提示框UIAlertController
import UIKit class ViewController: UIViewController ,UIActionSheetDelegate{ @IBAction func btn1(_ se ...
- python 过滤 b'及提取 cmd命令返回值
#!/usr/bin/env python # -*- coding:utf-8 -*- import subprocess import datetime plist = [] p = subpro ...
- 编译freeglut
下载freeglut http://freeglut.sourceforge.net/ 1>------ 已启动生成: 项目: CallbackMaker, 配置: Debug x64 --- ...
- QML登录界面
import QtQuick 2.9 import QtQuick.Window 2.2 import QtQuick.Controls 2.2 import QtGraphicalEffects 1 ...
- LeetCode_35. Search Insert Position
35. Search Insert Position Easy Given a sorted array and a target value, return the index if the tar ...
- 学习 TTreeView [2] - Items.Item[i]、Items[i]、.Text、SetFocus(设置焦点)、Select(选择)
本例效果图: 源码: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Co ...
- Python编译出现错误SyntaxError: Non-ASCII character '\xe7' 时解决方法
转载个解决办法:https://blog.csdn.net/wangchao701123/article/details/57084244 转自https://blog.csdn.net/jim742 ...
- 调用API修改Ocelot的配置文件
Ocelot是一个基于.net core的开源webapi服务网关开源项目,功能比较强大,Github项目地址为:https://github.com/ThreeMammals/Ocelot,关于Oc ...
- 迷惑性很强的crontab
提到定时任务,我们通常会想起linux的crontab,可以说服务器端大部分定时任务都是由它完成的.这东西固然耗用,但是坑也不少. 这不,昨天我在部署一个备份任务的时候,就不幸踩坑了.差点酿成 ...