This content has been machine translated dynamically.
Dieser Inhalt ist eine maschinelle Übersetzung, die dynamisch erstellt wurde. (Haftungsausschluss)
Cet article a été traduit automatiquement de manière dynamique. (Clause de non responsabilité)
Este artículo lo ha traducido una máquina de forma dinámica. (Aviso legal)
此内容已经过机器动态翻译。 放弃
このコンテンツは動的に機械翻訳されています。免責事項
이 콘텐츠는 동적으로 기계 번역되었습니다. 책임 부인
Este texto foi traduzido automaticamente. (Aviso legal)
Questo contenuto è stato tradotto dinamicamente con traduzione automatica.(Esclusione di responsabilità))
This article has been machine translated.
Dieser Artikel wurde maschinell übersetzt. (Haftungsausschluss)
Ce article a été traduit automatiquement. (Clause de non responsabilité)
Este artículo ha sido traducido automáticamente. (Aviso legal)
この記事は機械翻訳されています.免責事項
이 기사는 기계 번역되었습니다.책임 부인
Este artigo foi traduzido automaticamente.(Aviso legal)
这篇文章已经过机器翻译.放弃
Questo articolo è stato tradotto automaticamente.(Esclusione di responsabilità))
Translation failed!
gRPC reverse bridging
在这种情况下,Citrix ADC 设备无缝桥接在 HTTP/2 连接上接收的 gRPC 内容,然后通过 HTTP/1.1 将其转发到后端 gRPC 服务器。
反向桥接的工作原理
下图显示了 GrPC 桥接配置中组件如何相互交互。
- 客户端通过 HTTP/2 帧和 proto-buf 有效负载中的 gRPC 头在 HTTP/2 连接上发送 gRPC 请求。
- 根据策略评估,负载平衡虚拟服务器(与 GrPC 服务绑定)将请求通过 HTTP/1.1 连接转换并转发到后端服务器。
- 在收到 HTTP/1.1 响应时,如果响应中没有 grpc-status 代码,ADC 将从 HTTP 响应代码中派生 grpc 状态案例。
- 然后,设备在将响应转发给客户端之前,将 gRPC 标头插入 HTTP/2 尾片。
使用 CLI 配置 grPC 反向桥接
要配置 grPC 反向桥接,必须完成以下步骤:
- 在 HTTP/2 和 HTTP/2 直接启用的情况下添加 HTTP 配置文件 1,以实现负载平衡虚拟
- 在后端服务器禁 用 HTTP/2 的情况下添加 HTTP 配置文件 2
- 添加 SSL/HTTP 类型的负载平衡虚拟服务器并设置为 HTTP 配置文件 1
- 为 gRPC 端点添加服务并设置为 HTTP 配置文件 2
- 将 gRPC 端点的服务绑定到负载平衡虚拟服务器
- 如果响应没有 grpc 状态码,则将 HTTP-Status 码映射到 grPC 状态码
在 HTTP/2 和 HTTP/2 直接启用的情况下添加 HTTP 配置文件 1,以实现负载平衡虚拟
要开始反向桥接配置,必须添加两个 HTTP 配置文件。一个配置文件用于为 gRPC 客户端请求启用 HTTP/2,另一个配置文件用于为非 GRPC 服务器响应禁用 HTTP/2。
在命令提示符下,键入:
add ns httpProfile <name> - http2 ( ENABLED | DISABLED ) [-http2Direct ( ENABLED | DISABLED )]
示例:
add ns httpProfile profile1 –http2 ENABLED -http2Direct ENABLED
在后端服务器禁用HTTP/2 的情况下添加 HTTP 配置文件 2
使用 Citrix ADC 命令行禁用 HTTP 配置文件上对后端服务器响应的 HTTP/2 支持。
在命令提示符下,键入:
add ns httpProfile <name> - http2 ( ENABLED | DISABLED ) [-http2Direct ( ENABLED | DISABLED )]
示例:
add ns httpProfile profile2 –http2 DISABLED http2Direct DISABLED
添加 SSL/HTTP 类型的负载平衡虚拟服务器并设置为 HTTP 配置文件 1
使用 Citrix ADC 命令界面添加负载平衡虚拟服务器。
在命令提示符下,键入:
add lb vserver <name> <service type> [(<IP address>@ <port>)] [-httpProfileName <string>]
示例:
add lb vserver lb-grpc HTTP 10.10.10.10 80 -httpProfileName profile1
注意 : 如果您使用的是 SSL 类型的负载平衡虚拟服务器,则必须绑定服务器证书。请参阅绑定服务器证书主题了解更多信息
为 gRPC 端点添加服务并设置为 HTTP 配置文件 2
使用 Citrix ADC 命令界面添加带 GrPC 端点的服务并设置 HTTP 配置文件 2。
在命令提示符下,键入:
add service <name> (<IP> | <serverName> ) <serviceType> <port> [-httpProfileName <string>]
示例:
add service svc-grpc 10.10.10.11 HTTP 80 -httpProfileName profile2
将 gRPC 端点的服务绑定到负载平衡虚拟服务器
使用 Citrix ADC 命令界面将 gRPC 服务绑定到负载平衡虚拟服务器。
在命令界面,键入:
bind lb vserver <name> <serviceName>
示例:
bind lb vserver lb-grpc svc-grpc
将 HTTP 响应代码映射到 gRPC 状态码
如果服务器未生成 gRPC 状态代码,Citrix ADC 设备将根据收到的 HTTP 响应生成合适的 gRPC 状态代码。下面的映射表中列出了状态代码。
HTTP 响应状态码 | gRPC 状态码 |
---|---|
200 | 正常 |
400 | INTERNAL = 13 |
403 | PERMISSION_DENIED = 7 |
401 | UNAUTHENTICATED = 16 |
429, 502, 503, 504 | UNAVAILABLE = 14 |
404 | UNIMPLEMENTED = 12 |
使用 GUI 配置 grPC 反向桥接
在 HTTP/2 和 HTTP/2 直接启用的情况下添加 HTTP 配置文件 1,以实现负载平衡虚拟
- 导航到系统 > 配置文件,然后单击 HTTP 配置文件。
- 在 HTTP 配置文件 1 中启用 HTTP/2 选项。
在后端服务器禁用HTTP/2 的情况下添加 HTTP 配置文件 2
- 导航到系统 > 配置文件,然后单击 HTTP 配置文件。
- 在 HTTP 配置文件中启用 HTTP/2 选项 2。
- 单击 OK(确定)。
添加 SSL/HTTP 类型的负载平衡虚拟服务器并设置为 HTTP 配置文件 1
- 导航到流量管理 > 负载平衡 > 虚拟服务器。
- 单击添加为 GRPC 通信创建负载平衡虚拟服务器。
- 在“负载平衡虚拟服务器”页中,单击 概要文件。
- 在“配置文件”部分中,选择配置文件类型为 HTTP。
- 单击 确定 ,然后单击 完成。
使用 grPC 端点添加服务并设置为 HTTP 配置文件 2
- 导航到流量管理 > 负载平衡 > 服务。
- 单击添加为 GRPC 通信创建应用程序服务器。
- 在“负载平衡服务”页面中,转到“概要文件”部分。
- 在配置文件下,为 GRPC 端点添加 HTTP 配置文件。
- 单击 确定 ,然后单击 完成。
将 gRPC 端点的服务绑定到负载平衡虚拟服务器
- 导航到流量管理 > 负载平衡 > 虚拟服务器。
- 单击添加为 GRPC 通信创建负载平衡虚拟服务器。
- 在 负载平衡虚拟服务器 页面中,单击 服务和服务组 部分。
- 在“负载平衡虚拟服务器服务绑 定”页中,选择要绑定的 GRPC 服务。
- 单击关闭,然后单击完成。
有关详细 GUI 过程,请参阅 负载平衡 主题。
共享
共享
This Preview product documentation is Citrix Confidential.
You agree to hold this documentation confidential pursuant to the terms of your Citrix Beta/Tech Preview Agreement.
The development, release and timing of any features or functionality described in the Preview documentation remains at our sole discretion and are subject to change without notice or consultation.
The documentation is for informational purposes only and is not a commitment, promise or legal obligation to deliver any material, code or functionality and should not be relied upon in making Citrix product purchase decisions.
If you do not agree, select Do Not Agree to exit.