為什麼 Amazon S3 儲存貯體上的變更沒有顯示在 Storage Gateway 檔案共用上?

1 分的閱讀內容
0

我對 Amazon Simple Storage Service (Amazon S3) 儲存貯體進行了變更,例如上傳新檔案或移除現有檔案。但是,這些變更不會傳播至 AWS Storage Gateway 檔案共用。如何解決這個問題?

簡短說明

當您使用檔案共用將檔案本端寫入快取時,Storage Gateway 會自動更新檔案共用快取。但是,當您將檔案直接上傳至 Amazon S3 時,Storage Gateway 不會自動更新快取。執行此動作時,您必須執行 RefreshCache 作業以查看檔案共用上的變更。如果您具有多個檔案共用,則必須在每個檔案共用上執行 RefreshCache 作業。

您可以使用 Storage Gateway 主控台和 AWS Command Line Interface (AWS CLI) 重新整理快取。

解決方案

使用 Storage Gateway 主控台

若要使用 Storage Gateway 主控台重新整理快取,請參閱重新整理 Amazon S3 儲存貯體中的物件。 

使用 AWS CLI

1.    執行 list-file-shares 命令:

$ aws storagegateway list-file-shares

**注意事項:**如果您在執行 AWS CLI 命令時收到錯誤,請確保您使用的是最新版本的 AWS CLI

2.    複製檔案共用的 Amazon Resource Number (ARN),其包含您想要重新整理的快取。然後,執行 refresh-cache 命令,並輸入 ARN 作為 --file-share-arn 的值:

$ aws storagegateway refresh-cache --file-share-arn arn:aws:storagegateway:eu-west-1:12345678910:share/share-FFDEE12

若要自動化 RefreshCache 作業,請參閱如何在 Storage Gateway 上自動化 RefreshCache 作業?


AWS 官方
AWS 官方已更新 2 年前