微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

将 Amazon Aurora PostgreSQL 从 9.6 升级到 10

如何解决将 Amazon Aurora PostgreSQL 从 9.6 升级到 10

我正在尝试通过 CloudFormation 模板命令 9.6Amazon aurora Postgresql 从版本 10.14 升级aws cloudformation update-stack --stack-name base --template-body file://cloudformation/base.yml,但每次更新都会回滚其中之一以下消息:

  1. 不可修改数据库参数:wal_consistency_checking

  2. 不可修改数据库参数:ssl_dh_params_file

base.yml 的部分如下所示:

DatabaseCustomParameterGroupIdentifier:
  Description: ID of the database parameter group
  Value: !Ref DatabaseCustomParameterGroup
  Export:
    Name: DatabaseCustomParameterGroupIdentifier

DatabaseCustomParameterGroup:
  Type: AWS::RDS::DBParameterGroup
  Properties:
    Description: Database Custom Parameter Group
    Family: aurora-postgresql10
    Parameters:
      pg_stat_statements.track: ALL
      shared_preload_libraries: pg_stat_statements
      track_activity_query_size: 2048
      pglogical.use_spi: true
      pglogical.synchronous_commit: true
      temp_file_limit: "-1"
      ssl_dh_params_file: ""
      wal_consistency_checking: 'all'

我从这些链接中引用了这 2 个参数:https://www.postgresql.org/docs/10/runtime-config-developer.htmlhttps://www.postgresql.org/docs/10/runtime-config-connection.html

[编辑-我] 我可以在 RDS > Parameter Groups with Modifiable value 中看到这两个参数为 false

enter image description here

此外,当我尝试删除参数组时,我收到以下消息:

Failed to delete default.aurora-postgresql10: Default DBParameterGroup cannot be deleted: default.aurora-postgresql10 (Service: AmazonRDS; Status Code: 400; Error Code: InvalidDBParameterGroupState).

请告知我在这里做错了什么!

[编辑-II]

如果我尝试删除这两个参数并再次运行 CF 命令,我会得到这个:

The following parameters are not defined for the specified group: ssl_dh_params_file,wal_consistency_checking (Service: AmazonRDS; Status Code: 400; Error Code: InvalidParameterValue)

[编辑-III]

  1. 根据 AWS 文档,我无法删除认参数组。也许这是我尝试删除此参数组时出现上述错误的原因?
  2. 如果我看到这两个参数的属性,我可以从控制台看到以下内容
    {
      "ParameterName": "wal_consistency_checking","Description": "Sets the WAL resource managers for which WAL consistency checks are done.","Source": "engine-default","ApplyType": "dynamic","DataType": "string","IsModifiable": false,"MinimumEngineVersion": "10.4","ApplyMethod": "pending-reboot"
    },{
      "ParameterName": "ssl_dh_params_file","Description": "Location of the SSL DH parameters file.","ApplyMethod": "pending-reboot"
    }

解决方法

那些发现升级困难的人,这就是我所做的:

  • 更新了基本模板并为 Postgres 10 版本添加了 AWS::RDS::DBParameterGroup 设置
  • 之后我执行了 aws cloudformation update-stack --stack-name base --template-body file://cloudformation/base.yml --capabilities CAPABILITY_IAM 命令来更新基础堆栈
  • 然后我从控制台执行:aws rds modify-db-cluster 命令
$ aws rds modify-db-cluster \
>     --db-cluster-identifier DB_CLUSTER_IDENTIFIER \
>     --engine-version 10.14 \
>     --db-cluster-parameter-group-name default.aurora-postgresql10 \
>     --db-instance-parameter-group-name base-dbcustomparametergroup-pg10 \
>     --allow-major-version-upgrade \
>     --apply-immediately \
>     --debug
  • 最后,我为专用的 Rails 环境执行了 CF 命令:aws cloudformation update-stack --stack-name staging --template-body file://cloudformation/template.yml --capabilities CAPABILITY_IAM

您可以在更新您的基础堆栈并复制 AWS > RDS > Parameter Group 的名称后获取 db-instance-parameter-group-name 的值

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。