如何針對 CloudFormation 中的 AWS::Elasticsearch::Domain 資源執行就地升級或取代升級?
2 分的閱讀內容
0
我要針對 AWS CloudFormation 中的 AWS::Elasticsearch::Domain 資源執行就地升級。
簡短描述
若要為您的 AWS::Elasticsearch::Domain 資源啟用就地升級,您必須在 CloudFormation 範本中使用名為 EnableVersionUpgrade 的 UpdatePolicy 屬性。您可以使用 EnableVersionUpgrade 政策來啟用或停用 Amazon OpenSearch Service 網域的就地升級。
在您執行就地升級或取代升級之前,請考慮下列事項:
- Amazon OpenSearch Service 支援 5.1 版或更高版本的就地 OpenSearch Service 升級。
- 如果您在堆疊更新期間變更 EngineVersion 屬性的值,則 CloudFormation 會為 OpenSearch Service 網域執行取代更新。然後,CloudFormation 會建立一個新網域。
- 透過就地升級,您可以追蹤網域的升級歷程記錄,並保留相同的網域端點 URL。您不需要對與網域連接的服務進行組態變更。這些服務將可存取您網域的新版本。
- 取代升級不允許您追蹤升級記錄。系統會以新網域和該網域的新端點 URL 取代舊網域。若要允許與您網域連接的服務存取新網域,您必須對服務進行組態變更。如需詳細資訊,請參閱建立和管理 OpenSearch Service 網域。
解決方案
1. 在您的 CloudFormation 堆疊範本中,新增 EnableVersionUpgrade 更新政策。
2. 若要允許 CloudFormation 執行就地升級,請將 EnableVersionUpgrade 設定為 true,並將 ElasticsearchVersion 設定為您版本的值。
-或-
若要要用新的 AWS::Elasticsearch::Domain 資源替換 AWS::Elasticsearch::Domain 資源,請將 EnableVersionUpgrade 設定為 false 或不指定任何值。
例如,UpdatePolicy 屬性為針對以下範本中的就地升級所設定:
>AWSTemplateFormatVersion: 2010-09-09 Description: AWS CloudFormation sample template to launch an Amazon OpenSearch Service Domain. Performing an update using the same template and supplying a different ElasticsearchVersion will perform an in-place upgrade for an Elasticsearch Domain resource. Parameters: ElasticsearchVersion: Type: String AllowedValues: ['5.6', '5.5', '5.3', '5.1', '6.8', '6.7', '6.5', '6.4', '6.3', '6.2', '6.0', '7.4', '7.1'] Default: 5.3 Description: The version of Amazon OpenSearch Service to use. InstanceTypeForDataNode: Type: String Default: m3.medium.elasticsearch Description: The instance type for your data nodes. NumberOfDataNodes: Type: String Default: 1 Description: The number of data nodes (instances) to use in the OpenSearch Service domain. Resources: ElasticSearchDomain: Type: AWS::Elasticsearch::Domain UpdatePolicy: EnableVersionUpgrade: true ### In-place Upgrade Properties: ElasticsearchClusterConfig: InstanceCount: !Ref NumberOfDataNodes InstanceType: !Ref InstanceTypeForDataNode ElasticsearchVersion: !Ref ElasticsearchVersion
3. 若要完成就地升級或取代升級程序,請使用 CloudFormation 主控台或 AWS Command Line Interface (AWS CLI) 來更新您的堆疊。
相關資訊
AWS 官方已更新 3 年前
沒有評論
相關內容
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前