在虛擬私有雲端中啟用閘道 - AWSStorage Gateway

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

在虛擬私有雲端中啟用閘道

您可以在現場部署軟體設備以及雲端儲存基礎設施之間建立私有連線。然後您可以使用軟體設備將資料傳輸到AWS存儲,而無需與網關通信AWS在公有網際網路上存儲服務。使用亞馬遜 VPC 服務,您可以啟動AWS資源。您可利用 Virtual Private Cloud (VPC) 來控制您的網路設定,例如 IP 地址範圍、子網路、路由表和網路閘道。如需 VPC 的詳細資訊,請參「什麼是 Amazon VPC?」中的Amazon VPC User Guide

若要在 VPC 中搭配 Storage Gateway 道 VPC 端點使用閘道,請執行下列動作:

  • 使用 VPC 控制台來建立適用於 Storage Gateway 的 VPC 端點,並取得 VPC 端點 ID。在創建和激活網關時指定此 VPC 終端節點 ID。

  • 如果您啟動檔案閘道,請為 Amazon S3 建立 VPC 端點。在為網關創建文件共享時,請指定此 VPC 終端節點。

  • 如果您要啟動檔案閘道,請設定 HTTP 代理,並在該檔案閘道 VM 本機主控台中進行設定。您需要為以 Hypervisor 為基礎的內部部署檔案閘道 (例如以 VMware、Microsoft HyperV 和 Linux 核心型虛擬機器 (KVM) 為基礎的內部部署檔案閘道) 設定此代理。在這些情況下,您需要代理以讓閘道從 VPC 外部存取 Amazon S3 私有端點。如需設定 HTTP 代理的詳細資訊,請參閱設定 HTTP 代理

注意

您的閘道必須在建立 VPC 端點的同一區域中啟動。

對於檔案閘道,為檔案共享設定的 Amazon S3 存儲必須位在建立適用於 Amazon S3 的 VPC 端點同一個區域。

建立 Storage Gateway 道的 VPC 端點

按照這些指示來建立 VPC 端點。如果您已經有適用於 Storage Gateway 的 VPC 端點,則您可以使用它。

建立 Storage Gateway 道的 VPC 端點
  1. 登入 AWS Management Console,並在 https://console.aws.amazon.com/vpc/ 開啟 Amazon VPC 主控台。

  2. 在導覽窗格中,選擇 Endpoints (端點),然後選擇 Create Endpoint (建立 端點)

  3. 建立端點頁面上,選擇AWS服務為了服務目錄

  4. Service Name (服務名稱) 中,選擇 com.amazonaws.region.storagegateway。例如:com.amazonaws.us-east-2.storagegateway

  5. 針對 VPC,選擇您的 VPC,並記下其可用區域和子網路。

  6. 確認未選取 Enable Private DNS Name (啟用私有 DNS 名稱)

  7. 針對 Security group (安全群組),選擇要用於您的 VPC 的安全群組。您可以接受預設的安全群組。驗證您的安全群組中已允許所有下列 TCP 連接埠:

    • TCP 443

    • TCP 1026

    • TCP 1027

    • TCP 1028

    • TCP 1031

    • TCP 2222

  8. 選擇 Create endpoint (建立端點)。端點的最初狀態是 pending (擱置中)。建立端點後,記下所新建 VPC 端點的 ID。

  9. 建立端點後,請選擇 Endpoints (端點),然後選擇新的 VPC 端點。

  10. DNS Names (DNS 名稱) 區段,使用未指定可用區域的第一個 DNS 名稱。您的 DNS 名稱看起來會像這樣:vpce-1234567e1c24a1fe9-62qntt8k.storagegateway.us-east-1.vpce.amazonaws.com

現在您有一個 VPC 端點,您可以建立您的閘道。

重要

如果您要建立檔案閘道,您也需要建立適用於 Amazon S3 的端點。依照上方「建立適用於 Storage Gateway 的 VPC 端點」章節中的相同步驟,但這次在com.amazonaws.us-east-2.s3在「服務名稱」下。接著選取您希望 S3 端點關聯的路由表,而不是子網路/安全群組。如需說明,請參閱「」建立閘道端點

設置和配置 HTTP 代理(僅限本地文件網關)

如果您啟動檔案閘道,您需要安裝 HTTP 代理並使用檔案閘道虛擬機器本機主控台配置。您需有此代理,內部部署的檔案閘道才可從 VPC 外部存取 Amazon S3 私有端點。如果您在 Amazon EC2 中已有 HTTP 代理,您可以使用它。不過,您需要驗證安全性群組中是否已允許所有下列 TCP 連接埠:

  • TCP 443

  • TCP 1026

  • TCP 1027

  • TCP 1028

  • TCP 1031

  • TCP 2222

如果您沒有 Amazon EC2 代理,請使用下列程序來設定和配置 HTTP 代理。

設定代理伺服器
  1. 啟動 Amazon EC2 AMI。我們建議使用已網路最佳化的執行個體系列,例如 c5n.large。

  2. 請使用下列命令安裝 squid:sudo yum install squid。 這會在/etc/squid/squid.conf

  3. 將此組態檔的內容以下列內容取代:

    # # Recommended minimum configuration: # # Example rule allowing access from your local networks. # Adapt to list your (internal) IP networks from where browsing # should be allowed acl localnet src 10.0.0.0/8 # RFC1918 possible internal network acl localnet src 172.16.0.0/12 # RFC1918 possible internal network acl localnet src 192.168.0.0/16 # RFC1918 possible internal network acl localnet src fc00::/7 # RFC 4193 local private network range acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines acl SSL_ports port 443 acl SSL_ports port 1026 acl SSL_ports port 1027 acl SSL_ports port 1028 acl SSL_ports port 1031 acl SSL_ports port 2222 acl CONNECT method CONNECT # # Recommended minimum Access Permission configuration: # # Deny requests to certain unsafe ports http_access deny !SSL_ports # Deny CONNECT to other than secure SSL ports http_access deny CONNECT !SSL_ports # Only allow cachemgr access from localhost http_access allow localhost manager http_access deny manager # Example rule allowing access from your local networks. # Adapt localnet in the ACL section to list your (internal) IP networks # from where browsing should be allowed http_access allow localnet http_access allow localhost # And finally deny all other access to this proxy http_access deny all # Squid normally listens to port 3128 http_port 3128 # Leave coredumps in the first cache dir coredump_dir /var/spool/squid # # Add any of your own refresh_pattern entries above these. # refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 refresh_pattern . 0 20% 4320
  4. 如果您不需要鎖定代理伺服器,也不需要進行任何變更,則請啟用並開始使用下列命令。這些命令會在伺服器開機時將其啟動。

    sudo chkconfig squid on sudo service squid start

您現在可以設定適用於 Storage Gateway 的 HTTP 代理來使用它。設定閘道以使用代理時,請使用預設的 squid 連接埠 3128。產生的 squid conf 檔案預設會涵蓋下列要求的 TCP 連接埠:

  • TCP 443

  • TCP 1026

  • TCP 1027

  • TCP 1028

  • TCP 1031

  • TCP 2222

使用虛擬機器本機主控台設定 HTTP 代理
  1. 登入您閘道的 VM 本機主控台。如需關於登入的詳細資訊,請參閱登入文件閘道本機主控台

  2. 在主要功能表中,選擇 Configure HTTP proxy (設定 HTTP 代理)

  3. Configuration (組態) 功能表中,選擇 Configure HTTP proxy (設定 HTTP 代理)

  4. 提供代理伺服器的主機名稱和連接埠。

如需如何設定 HTTP 代理的詳細資訊,請參閱設定 HTTP 代理

允許流量到 HTTP 代理中所需端口

如果您使用 HTTP 代理,請確定允許從 Storage Gateway 道到下列目的地和連接埠的流量。

當 Storage Gateway 透過公有端點通訊時,它會與下列 Storage Gateway 服務通訊。

anon-cp.storagegateway.region.amazonaws.com:443 client-cp.storagegateway.region.amazonaws.com:443 proxy-app.storagegateway.region.amazonaws.com:443 dp-1.storagegateway.region.amazonaws.com:443 storagegateway.region.amazonaws.com:443 (Required for making API calls) s3.region.amazonaws.com (Required only for File Gateway)
重要

取決於您的網關AWS區域,替換區域以及對應的區域字串。例如,若您在美國西部(俄勒岡)區域建立閘道,端點即為:storagegateway.us-west-2.amazonaws.com:443

當 Storage Gateway 透過 VPC 端點通訊時,它會與AWS服務可以透過 Storage Gateway VPC 端點上的多個連接埠以及 Amazon S3 私有端點上的連接埠 443。

  • Storage Gateway VPC 端點上的 TCP 連接埠。

    • 443、1026、1027、1028、1031 和 2222

  • S3 私有端點上的 TCP 連接埠

    • 443