使用代理

本文档介绍如何将鸿鹄彩云配置为使用代理。支持认证和未认证的代理。

需求

代理支持需要以下述核心服务的版本比20150901更新。

  • sdc
  • imgapi
  • sdc-docker

具有当前鸿鹄彩云支持合同的客户对其当前核心服务发布组件处理代理流量的能力有疑问,请通过help.ww-it.cn联系我们支持。

所需网站

您的代理商至少需要允许访问以下站点:

网站 目的 备注
updates.ww-it.cn 更新鸿鹄彩云的核心服务 鸿鹄彩云需要操作
images.ww-it.cn 种子镜像 鸿鹄彩云需要操作
index.docker.io Docker镜像 可选的;如果您希望从Docker Hub中获取所需信息,则需要此选项
registry.hub.docker.com Docker镜像 可选的;如果您希望从Docker Hub中获取所需信息,则需要此选项

此外,您将需要允许访问您将从其中提取的任何其它Docker存储库。

使用代理进行配置

不认证的代理

headnode# sapiadm update $(sdc-sapi /applications?name=sdc | json -H 0.uuid) \
metadata.http_proxy=http://YourProxy:YourProxyPort

需要认证的代理

headnode# sapiadm update $(sdc-sapi /applications?name=sdc | json -H 0.uuid) \
metadata.http_proxy=http://YourProxyUser:YourProxyPassword@YourProxy:YourProxyPort

这种变化将需要五分钟时间才能传播到相关的核心服务。

注意: 鸿鹄彩云配置变量是http_proxy,无论您的代理URL是http://还是https://。

检查测试配置

您可以运行以下测试来确认代理访问并验证您的配置。如果您有自定义网站,则需要进行相应的调整。

  • 以下命令应该返回您的代理的URL:

    headnode# sdc-sapi /applications?name=sdc | json -H 0.metadata.http_proxy
    
  • 从管理节点测试ww-it.cn端点

    headnode# updates-imgadm ping
    pong
    headnode# joyent-imgadm ping
    pong
    
  • 测试sdcadm工具,以验证我们能够联系更新服务器;这应该返回没有错误。请注意,镜像数量和返回的版本可能会根据更新频道的内容而有所不同。

    headnode# sdcadm avail
    SERVICE   IMAGE                                 VERSION
    portolan  81faa870-a96b-11e5-a150-b75f8f0ccedd  portolan@release-20151224-20151223T114815Z-g7028219
    rabbitmq  17038a46-a96b-11e5-acff-3b5a22d9aa45  rabbitmq@release-20151224-20151223T114438Z-gb1ad38d
    

错误处理

以下测试使用curl直接进行测试,旨在通过提供实际的响应代码和收到的响应来帮助诊断代理问题。

  • 使用curl测试 images.ww-it.cn 和 updates.ww-it.cn 的ping接口

    • 不用认证:
    headnode# https_proxy=http://YourProxy:YourProxyPort curl -vi https://images.joyent.com/ping
    headnode# https_proxy=http://YourProxy:YourProxyPort curl -vi https://updates.joyent.com/ping
    
    • 需要认证:
    headnode# https_proxy=http://YourProxyUser:YourProxyPassword@YourProxy:YourProxyPort curl -vi https://images.joyent.com/ping
    headnode# https_proxy=http://YourProxyUser:YourProxyPassword@YourProxy:YourProxyPort curl -vi https://updates.joyent.com/ping
    
  • 测试访问 index.docker.io

    • 不用认证:
    headnode# https_proxy=https://YourProxy:YourProxyPort curl -vi  https://index.docker.io/v2
    
    • 需要认证:
    headnode# https_proxy=https://YourProxyUser:YourProxyPassword@YourProxy:YourProxyPort curl -vi  https://index.docker.io/v2
    

results matching ""

    No results matching ""