步驟 1:建立快取 - Amazon ElastiCache

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

步驟 1:建立快取

您即將啟動的快取將會即時執行,而非在沙盒中執行。在刪除快取之前,您都需針對快取支付標準 ElastiCache 使用費。如果您一鼓作氣完成這裡所述的練習,並在完成時刪除快取,則總計費用會很少 (通常不到 1 美元)。如需 ElastiCache 使用費率的詳細資訊,請參閱 Amazon ElastiCache

建立無伺服器快取

AWS Management Console

使用 ElastiCache 主控台建立新快取:

  1. 登入 AWS Management Console 並前往 https://console.aws.amazon.com/elasticache/ 開啟 ElastiCache 主控台。

  2. 在主控台左側的導覽窗格中,選擇 Memcached 快取

  3. 在主控台的右側,選擇建立 Memcached 快取

  4. 快取設定中,輸入名稱。您可以選擇性地輸入快取的說明

  5. 讓預設設定保持選取狀態。

  6. 按一下建立以建立快取。

  7. 快取處於「作用中」狀態後,您就可以開始對快取寫入和讀取資料。

使用 AWS CLI 建立新快取

下列 AWS CLI 範例會使用 create-serverless-cache 建立新快取。

Linux

aws elasticache create-serverless-cache \ --serverless-cache-name CacheName \ --engine memcached

Windows

aws elasticache create-serverless-cache ^ --serverless-cache-name CacheName ^ --engine memcached

請注意,「狀態」欄位的值會設定為 CREATING

若要確認 ElastiCache 已完成建立快取,請使用 describe-serverless-caches 命令。

Linux

aws elasticache describe-serverless-caches --serverless-cache-name CacheName

Windows

aws elasticache describe-serverless-caches --serverless-cache-name CacheName

建立新快取後,繼續進行 步驟 2:對快取讀取和寫入資料