LoginSignup
3
0

More than 1 year has passed since last update.

FSx File Gateway を構築してみた

Posted at

はじめに

AWS には、Amazon FSx File Gatewayと呼ばれるストレージ関連のサービスがあります。

AWS 上に作成した FSx for Windows File Server を、オンプレミス側にキャッシュしてくれるものです。Amazon FSx File Gateway は、ネットワークの最適化とキャッシングをしているため、ユーザーやアプリケーションからは、共有データがあたかもオンプレミスにあるかのように見えます。

FSx File Gateway の構成方法や、キャッシュの更新期間などがよくわからなかったので、検証をしてみました。構築手順を忘れないために残しておきます。

VPC Endpoint の作成

まず、VPC Endpoint を作成します。File Storage Gateway が AWS 側と通信するための Endpoint です。

VPC のページで、Create endpoint を押します。

image-20230225193042617.png

適当に名前を指定して、Storage Gateway サービスを選択します。

storagegateway

image-20230225193332333.png

Subnet を選択します。

image-20230225193438267.png

Create Endpoint を押します。

image-20230225193453780.png

VPC Endpoint が作成されました。

image-20230225193759801.png

Gateway の作成

Create gateway を押します。

image-20230225171958194.png

FSx File Gateway を選択します。

FSx-File-Gateway

image-20230225172312855.png

今回は、簡単に検証するため、Amazon EC2 を選びます。オンプレミスに ESXi や Hyper-V 等がある場合は、それ以外を選択しても良いでしょう。

選択して、Launch Instance を押します。

image-20230225194106885.png

作成処理が始まります。

image-20230225172419365.png

一定時間後、EC2 インスタンスが作成されます。

image-20230225172509969.png

実際に EC2 のページを見ると、m5.xlarge の EC2 インスタンスが作成されています。

image-20230225194646741.png

EBS の構成はこんな感じです。キャッシュのための領域は 150 GiB ですね。必要に応じて大きなキャッシュ領域を用意しても良いと思います。

image-20230225194705826.png

Next を押します。

image-20230225172551611.png

Storage Gateway のネットワーク的な設定をします。

  • Gateway は、VPC 上の Endpoint を経由して、AWS と通信するように指定

image-20230225194321174.png

Next を押します。

image-20230225194419405.png

Disk cache を指定します。

image-20230225194758971.png

Configure

image-20230225194812964.png

Gateway が作成されました。

image-20230225194836894.png

Storage Gateway の DNS 設定

Storage Gateway 側の OS で DNS 設定が必要です。Storage Gatewat の EC2 インスタンスに対して、一時的に SSH を許可してアクセスをします。

Storage Gateway の Private IP を確認します。

image-20230225200813204.png

SSH でアクセスします。ユーザー名は admin です。

ssh admin@10.0.1.169

2 を選んで、Network Configuration をします。

        AWS Storage Gateway - Configuration

        #######################################################################
        ##  Currently connected network adapters:
        ##
        ##  eth0: 10.0.1.169
        #######################################################################

        1: HTTP/SOCKS Proxy Configuration
        2: Network Configuration
        3: Test Network Connectivity
        4: FSx Connectivity Status
        5: View System Resource Check (0 Errors)
        6: License Information
        7: Command Prompt

        Press "x" to exit session

        Enter command: 2

1 で、編集をします。

        AWS Storage Gateway - Network Configuration

        1: Edit DNS Configuration
        2: View DNS Configuration
        3: Configure Hostname
        4: View Hostname Configuration

        Press "x" to exit

        Enter command: 1

eth0 の Edit をします

        DNS Configuration:


        Available adapters: eth0
        Enter network adapter: eth0

DHCP は使わない

        Assign by DHCP [y/N]: N

DNS を指定 : Directory Service の IP アドレスを指定

        Enter primary DNS [10.0.0.2]: 10.0.100.47
        Enter secondary DNS [10.0.0.2]: 10.0.1.113

Apply

        Apply config [y/N]: y

確認します。無事に設定されています。

        1: Edit DNS Configuration
        2: View DNS Configuration
        3: Configure Hostname
        4: View Hostname Configuration

        Press "x" to complete your network configuration and exit

        Enter command: 2

        DNS Configuration


        Available adapters: eth0
        Enter network adapter: eth0

        Source: Assigned statically
        DNS: 10.0.100.47
        DNS: 10.0.1.113
        Domain search list: ap-northeast-1.compute.internal


        Press any key to continue

Storage Gateway の Restart をします。

        AWS Storage Gateway - Network Configuration

        1: Edit DNS Configuration
        2: View DNS Configuration
        3: Configure Hostname
        4: View Hostname Configuration

        Press "x" to complete your network configuration and exit

        Enter command: x

        Restarting networking...

        Restarting network (via systemctl):                [  OK  ]

        You must restart your gateway to complete the network configuration.

        Restart gateway now [y/N]: y

x で SSH を離脱

        AWS Storage Gateway - Configuration

        #######################################################################
        ##  Currently connected network adapters:
        ##
        ##  eth0: 10.0.1.169
        #######################################################################

        1: HTTP/SOCKS Proxy Configuration
        2: Network Configuration
        3: Test Network Connectivity
        4: FSx Connectivity Status
        5: View System Resource Check (1 WARNING)
        6: License Information
        7: Command Prompt

        Press "x" to exit session

        Enter command: x

Attach

作成した Storage Gateway に、FSx をアタッチします。

image-20230225195807661.png

対象の Storage Gateway と、FSx が参加している Active Directory の情報を入れます。Storage Gateway もドメイン参加が必要です。

image-20230225195956234.png

Storage Gateway の IP アドレスなどを指定します。

  • Local Endpoint IP address : FSx File Gateway のインスタンスの Private IP を指定

image-20230225202701253.png

Cache を更新する Interval を指定します。FSx for Windows File Server 側で更新されたデータを定期的に FSx File Gateway に反映する設定です。最短 5 分から指定できます。

image-20230225202754410.png

Attach を押します。

image-20230225202829411.png

Updating となります。

image-20230225202847770.png

一定時間後、Availble となります。

image-20230225203700566.png

Storage Gateway の IP アドレスを確認します。

image-20230225203742233.png

FSx File Gateway にアクセス確認

Gateway → FSx 本体

Active Directory に参加しているコンピューターから、FSx File Gateway の IP アドレスにアクセスします。

\\10.0.1.169

image-20230225203928108.png

FSx File Gateway 側に、適当にファイルを作ってみます。

image-20230225204143587.png

本体側 (FSx for Windows File Server) にすぐに反映されました。

image-20230225204225770.png

FSx 本体 → Gateway

本体側 (FSx for Windows File Server) で、新たにファイルを作成しても、FSx File Gateway 側にはすぐに反映されません。

image-20230225204312496.png

設定で入れたように、5 分ほど待機すると反映されました。

image-20230225204645643.png

検証を通じてわかったこと

  • FSx File Gateway が、Active Directory に参加出来ないときは、Gateway を稼働している仮想マシンの DNS 設定を確認する。デフォルトでは入っていなかったので、手動で入れる作業が基本的には必要なはず。
  • FSx File Gateway 側に作成・更新したファイルは、基本的にはほぼリアルタイムに本体側 (FSx for Windows File Server) に反映される。
    • もちろん、データの更新量によってはタイムラグは存在すると思われる
  • 本体側 (FSx for Windows File Server) に作成されたファイルは、FSx File Gateway 側のキャッシュに反映させるための設定がある。
    • Interval は 最短 5 分から指定可能。
    • 表現を変えると、最短でも 5 分待機しないと最新のファイルを確認できないと言える。
  • File Gateway に必要な要件が以下の Document に記載されている。
    • 目についたものをいくつか抜粋。
    • ネットワーク帯域は、最低 100 Mbps 以上。実際には、利用するワークロードによって必要な帯域は異なる。
    • 4 vCPU
    • 16 GiB メモリ
    • オンプレミスで稼働する仮想基盤のハイパーバイザーは、以下のものが利用可能
      • VMware ESXi Hypervisor (version 6.5, 6.7, or 7.0)
      • Microsoft Hyper-V Hypervisor (version 2012 R2, 2016, 2019, or 2022)
      • Linux Kernel-based Virtual Machine (KVM)
    • https://docs.aws.amazon.com/ja_jp/filegateway/latest/filefsxw/Requirements.html
  • Performance の例が Document に記載されている
    image-20230225211310880.png
3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0