新增上游集群

<p class="shortdesc">上游集群是用于支撑后端业务服务接口的分布式访问,可以针对单个服务做负载均衡</p> <section class="section context"><div class="tasklabel"><h2 class="doc-tairway">背景信息</h2></div> <p class="p">PAFA-CLOUD-KONG 支持以集群的形式配置负载均衡的服务列表,上游集群是用一个自定义的集群名称作为一组目标节点的主机名,网络请求会按照哈希规则以及目标节点的权重来进行流量的分发。上游集群适用场景是将没有域名的几台节点组合在一起构成集群,并按需分配负载流量。</p> </section> <section><div class="tasklabel"><h2 class="doc-tairway">操作步骤</h2></div><ol class="ol steps"><li class="li step stepexpand"> <span class="ph cmd"><span class="ph" id="Add_cluster__d21e23">登录应用管理与运维平台。</span></span> </li><li class="li step stepexpand" id="Add_cluster__step_gfw_bfg_zrb"> <span class="ph cmd">在左侧导航栏,选择<span class="ph menucascade"><span class="ph uicontrol">服务治理</span><abbr> > </abbr><span class="ph uicontrol">接入层网关配置</span><abbr> > </abbr><span class="ph uicontrol">上游集群</span></span>。</span> </li><li class="li step stepexpand"> <span class="ph cmd">在<span class="ph uicontrol">上游集群</span>页签,单击右上角<span class="ph uicontrol">新增上游集群</span>按钮。</span> </li><li class="li step stepexpand"> <span class="ph cmd">在<span class="ph uicontrol">新增上游集群</span>页面,填写配置信息。</span> <div class="itemgroup info"> <ul class="ul" id="Add_cluster__ul_stb_scd_1sb"> <li class="li"><strong class="ph b">配置基础信息</strong><img class="image" id="Add_cluster__image_iws_ghg_zrb" src="https://obs-cn-shanghai.fincloud.pinganyun.com/pacloud/20220910180811-1090998b925f.png" width="800"><table class="table" id="Add_cluster__table_xhx_3dd_1sb"><caption></caption><colgroup><col style="width:16.722408026755854%"><col style="width:83.27759197324414%"></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="Add_cluster__table_xhx_3dd_1sb__entry__1">配置名称</th> <th class="entry" id="Add_cluster__table_xhx_3dd_1sb__entry__2">配置说明</th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="Add_cluster__table_xhx_3dd_1sb__entry__1 "> <p class="p">上游集群名称</p> </td> <td class="entry" headers="Add_cluster__table_xhx_3dd_1sb__entry__2 "> <p class="p">虚拟主机的名称,用作一组目标节点的Id标识,您可以按目标节点资源用途自定义命名。</p> <p class="p"> 配置后可用作代理服务的主机名。</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_xhx_3dd_1sb__entry__1 "> <p class="p">所属空间命名</p> </td> <td class="entry" headers="Add_cluster__table_xhx_3dd_1sb__entry__2 "> <p class="p">上游集群的所属空间</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_xhx_3dd_1sb__entry__1 "> <p class="p">Slots</p> </td> <td class="entry" headers="Add_cluster__table_xhx_3dd_1sb__entry__2 "> <p class="p">负载均衡算法基数,即Kong会按这个基数创建一个池,按目标节点的权重比例分配节点。</p> <p class="p"> 数值越大,负载均衡算法越精确,但是重建的成本就越大。默认是1000,配置值区间为10~65536。</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_xhx_3dd_1sb__entry__1 "> <p class="p">哈希字段</p> </td> <td class="entry" headers="Add_cluster__table_xhx_3dd_1sb__entry__2 "> <p class="p">负载均衡算法可以按照“none”,“consumer”,“cp”,“ccookie”,“cheader”生成HASH值,默认为“cnone”,且以轮询方式进行负载均衡。</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_xhx_3dd_1sb__entry__1 "> <p class="p">哈希备用字段</p> </td> <td class="entry" headers="Add_cluster__table_xhx_3dd_1sb__entry__2 "> <p class="p">当HASH字段配置的规则不能生效时,采用备选字段作为均衡算法hash值的算法规则。</p> </td> </tr> </tbody></table></li> <li class="li"><strong class="ph b">配置节点信息</strong><img class="image" id="Add_cluster__image_mdj_5dd_1sb" src="https://obs-cn-shanghai.fincloud.pinganyun.com/pacloud/20220910180811-1f50cdcc9736.png" width="800"><table class="table" id="Add_cluster__table_cws_ldd_1sb"><caption></caption><colgroup><col style="width:17.98561151079137%"><col style="width:82.01438848920863%"></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="Add_cluster__table_cws_ldd_1sb__entry__1"> <p class="p">配置名称</p> </th> <th class="entry" id="Add_cluster__table_cws_ldd_1sb__entry__2"> <p class="p">配置说明</p> </th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="Add_cluster__table_cws_ldd_1sb__entry__1 "> <p class="p">目标节点</p> </td> <td class="entry" headers="Add_cluster__table_cws_ldd_1sb__entry__2 "> <p class="p">目标节点即需要最终处理请求的节点,一般配置IP:PORT ,或者配置域名。</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_cws_ldd_1sb__entry__1 "> <p class="p">权重</p> </td> <td class="entry" headers="Add_cluster__table_cws_ldd_1sb__entry__2 "> <p class="p">权重最大值为Slots设置的值,请求来临时,权重大的节点优先处理请求。</p> <p class="p"> 如果为0则表示不会转发到该节点。</p> </td> </tr> </tbody></table></li> <li class="li"><strong class="ph b">主动健康检查</strong>:健康检查器周期性的检测目标节点的健康状态,在接收到服务请求时,请求将不再转发到被标记为非健康状态的目标节点上。<img class="image" id="Add_cluster__image_okq_vdd_1sb" src="https://obs-cn-shanghai.fincloud.pinganyun.com/pacloud/20220910180811-15dce3c99826.png"><table class="table" id="Add_cluster__table_evz_wcd_1sb"><caption></caption><colgroup><col><col><col></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="Add_cluster__table_evz_wcd_1sb__entry__1"> <p class="p">字段</p> </th> <th class="entry" id="Add_cluster__table_evz_wcd_1sb__entry__2"> <p class="p">默认值</p> </th> <th class="entry" id="Add_cluster__table_evz_wcd_1sb__entry__3"> <p class="p">说明</p> </th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__1 "> <p class="p">检查类型</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__2 "> <p class="p">http</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__3 "> <p class="p">可选项http/https/tcptcp只是检查IP端口是否连通</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__1 "> <p class="p">超时时间</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__2 "> <p class="p">1</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__3 "> <p class="p">即http/https的GET请求超时时间</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__1 "> <p class="p">并发数量</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__2 "> <p class="p">10</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__3 "> <p class="p">即同时对多少个后端服务之星健康检查</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__1 "> <p class="p">http路径</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__2 "> <p class="p">/</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__3 "> <p class="p">http/https请求的后端路径地址</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__1 "> <p class="p">健康检查间隔</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__2 "> <p class="p">0</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__3 "> <p class="p">即对健康节点的检查间隔,为0则不开启健康节点的健康检查</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__1 "> <p class="p">健康的http状态码</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__2 "> <p class="p">200,302</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__3 "> <p class="p">健康节点的判定标准</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__1 "> <p class="p">健康检查成功次数</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__2 "> <p class="p">0</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__3 "> <p class="p">健康节点的判定标准,即成功返回这么多次才能判定为健康节点</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__1 "> <p class="p">非健康的检查间隔</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__2 "> <p class="p">0</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__3 "> <p class="p">即对非健康节点的检查间隔,为0则不开启非健康节点的健康检查</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__1 "> <p class="p">非健康的http状态码</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__2 "> <p class="p">429,404,500,501,502,503,504,505</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__3 "> <p class="p">非健康节点的判定标准,即返回这些状态码即判定为非健康节点</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__1 "> <p class="p">非健康tcp失败次数</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__2 "> <p class="p">0</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__3 "> <p class="p">非健康节点的TCP请求判定标准,即达到这么多次就判定为非健康</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__1 "> <p class="p">非健康连接超时次数</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__2 "> <p class="p">0</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__3 "> <p class="p">超过次数超过这个设置即被判定为非健康节点</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__1 "> <p class="p">非健康http失败次数</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__2 "> <p class="p">0</p> </td> <td class="entry" headers="Add_cluster__table_evz_wcd_1sb__entry__3 "> <p class="p">非健康节点的http请求判定标准</p> </td> </tr> </tbody></table></li> <li class="li"><strong class="ph b">被动健康检查</strong>:被动健康检查的功能属性是定期的去检测非健康状态的节点,如果目标节点恢复了健康状态,就将该节点重新加入到负载均衡机器列表中。<img class="image" id="Add_cluster__image_r4t_wdd_1sb" src="https://obs-cn-shanghai.fincloud.pinganyun.com/pacloud/20220910180811-1e4b243d9bcb.png"><table class="table" id="Add_cluster__table_n5q_cdd_1sb"><caption></caption><colgroup><col><col><col></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="Add_cluster__table_n5q_cdd_1sb__entry__1"> <p class="p">字段</p> </th> <th class="entry" id="Add_cluster__table_n5q_cdd_1sb__entry__2"> <p class="p">默认值</p> </th> <th class="entry" id="Add_cluster__table_n5q_cdd_1sb__entry__3"> <p class="p">说明</p> </th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__1 "> <p class="p">检查类型</p> </td> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__2 "> <p class="p">http</p> </td> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__3 "> <p class="p">被动健康检查的请求类型</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__1 "> <p class="p">健康的http状态码</p> </td> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__2 "> <p class="p">200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308</p> </td> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__3 "> <p class="p">健康节点的判定标准</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__1 "> <p class="p">健康检查成功次数</p> </td> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__2 "> <p class="p">0</p> </td> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__3 "> <p class="p">健康节点的判定标准,即成功返回这么多次才能判定为健康节点</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__1 "> <p class="p">非健康的http状态码</p> </td> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__2 "> <p class="p">429,500,503</p> </td> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__3 "> <p class="p">非健康节点的判定标准,即返回这些状态码即判定为非健康节点</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__1 "> <p class="p">非健康tcp失败次数</p> </td> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__2 "> <p class="p">0</p> </td> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__3 "> <p class="p">非健康节点的TCP请求判定标准,即达到这么多次就判定为非健康</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__1 "> <p class="p">非健康连接超时次数</p> </td> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__2 "> <p class="p">0</p> </td> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__3 "> <p class="p">超过次数超过这个设置即被判定为非健康节点</p> </td> </tr> <tr class="row"> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__1 "> <p class="p">非健康http失败次数</p> </td> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__2 "> <p class="p">0</p> </td> <td class="entry" headers="Add_cluster__table_n5q_cdd_1sb__entry__3 "> <p class="p">非健康节点的http请求判定标准</p> </td> </tr> </tbody></table></li> </ul> </div> </li><li class="li step stepexpand"> <span class="ph cmd">完成后,单击<span class="ph uicontrol">确认</span>。</span> </li></ol></section>
以上内容是否解决了您的问题?
请补全提交信息!
联系我们

电话咨询

400-151-8800

邮件咨询

fincloud@ocft.com

在线客服

工单支持

解决云产品相关技术问题