您的当前位置:首页>全部文章>文章详情

Aurora数据库使用CORN管理scale

gathin发表于:2023-11-09 15:48:50浏览:222次TAG: #Autoscaling #awscli

使用aurora数据库,在空闲时间减少数据库台数

输入命令后将看到这个aurora 集群已经配置的 crone 状态

~$ aws --region ap-northeast-1 application-autoscaling describe-scheduled-actions --service-namespace rds --resource-id cluster:jp003-aurora-replicate-cluster

增加一个CRON计划, 北京时间 每周一到周五 每天6点30分,开启两台数据库

~$ aws --region ap-northeast-1 application-autoscaling put-scheduled-action --service-namespace rds --schedule "cron(0 0 22 ? * SUN-THU)" --scheduled-action-name 'jp003-aurora-work-out' --resource-id cluster:jp003-aurora-replicate-cluster --scalable-dimension rds:cluster:ReadReplicaCount --scalable-target-action 'MinCapacity=2,MaxCapacity=15'

~$ aws --region ap-northeast-1 application-autoscaling put-scheduled-action --service-namespace rds --schedule "cron(0 00 10 ? * MON-FRI)" --scheduled-action-name 'jp003-aurora-work-in' --resource-id cluster:jp003-aurora-replicate-cluster --scalable-dimension rds:cluster:ReadReplicaCount --scalable-target-action 'MinCapacity=1,MaxCapacity=15'
`

对应的命令语法中有,删除cron 计划

~$ aws application-autoscaling delete-scheduled-action --service-namespace rds --scalable-dimension rds:cluster:ReadReplicaCount --resource-id cluster:jp003-aurora-replicate-cluster --scheduled-action-name jp003-aurora-cluster-schedule-workday-out
腾讯云采购季云服务器一折促销