- 浏览: 2566635 次
- 性别:
- 来自: 成都
-
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
AMAZON DynamoDB(6)Autoscaling Configuration
We use Serverless framework to deploy our Lambda, so we can try to configuration the auto scaling for DynamoDB there.
I firstly want to do that on serverless.yml. I do the follow changes in serverless.yml
ddbCapaciies:
read:
int:
min: 1
max: 5
stage:
min: 5
max: 10
prod:
min: 10
max: 500
write:
int:
min: 1
max: 5
stage:
min: 5
max: 10
prod:
min: 10
max: 500
capacities:
- table: DevicePairingInfoTable # DynamoDB Resource
read:
minimum: ${self:custom.ddbCapaciies.read.${self:custom.stage}.min} # Minimum read capacity
maximum: ${self:custom.ddbCapaciies.read.${self:custom.stage}.max} # Maximum read capacity
usage: 0.80 # Targeted usage percentage
write:
minimum: ${self:custom.ddbCapaciies.write.${self:custom.stage}.min} # Minimum write capacity
maximum: ${self:custom.ddbCapaciies.write.${self:custom.stage}.min} # Maximum write capacity
usage: 0.80 # Targeted usage percentage
PairingCodeTable:
Type: AWS::DynamoDB::Table
DeletionPolicy: Retain
Properties:
TableName: ${self:custom.dbPairingCodeName}
AttributeDefinitions:
- AttributeName: pairingCode
AttributeType: S
- AttributeName: serialNumber
AttributeType: S
- AttributeName: platform
AttributeType: S
KeySchema:
- AttributeName: pairingCode
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: ${self:custom.ddbCapaciies.read.${self:custom.stage}.min}
WriteCapacityUnits: ${self:custom.ddbCapaciies.write.${self:custom.stage}.max}
GlobalSecondaryIndexes:
- IndexName: ${self:custom.dbPairingCodeSerialIndex}
KeySchema:
- AttributeName: serialNumber
KeyType: HASH
Projection:
ProjectionType: ALL
ProvisionedThroughput:
ReadCapacityUnits: ${self:custom.ddbCapaciies.read.${self:custom.stage}.min}
WriteCapacityUnits: ${self:custom.ddbCapaciies.write.${self:custom.stage}.max}
- IndexName: ${self:custom.dbPairingCodePlatformIndex}
KeySchema:
- AttributeName: platform
KeyType: HASH
Projection:
ProjectionType: ALL
ProvisionedThroughput:
ReadCapacityUnits: ${self:custom.ddbCapaciies.read.${self:custom.stage}.min}
WriteCapacityUnits: ${self:custom.ddbCapaciies.write.${self:custom.stage}.max}
But when I deploy that I get an error with table already exists. That should be because of I create the table by script, not from servless yaml.
An error occurred: xxxxxTable - xxxxxxx-int-devicePairingCode already exists.
We can only do that if the tables are created by serverless yaml at the beginning. But my table is created by my dump script. I need to check how to do that in shell script.
Follow the link
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/AutoScaling.CLI.html
Alter the AutoScaling on DynamoDB
No finished, we will currently do that from the console.
References:
https://github.com/sbstjn/serverless-dynamodb-autoscaling
https://sbstjn.com/serverless-dynamodb-auto-scaling-with-cloudformation.html
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/AutoScaling.CLI.html
We use Serverless framework to deploy our Lambda, so we can try to configuration the auto scaling for DynamoDB there.
I firstly want to do that on serverless.yml. I do the follow changes in serverless.yml
ddbCapaciies:
read:
int:
min: 1
max: 5
stage:
min: 5
max: 10
prod:
min: 10
max: 500
write:
int:
min: 1
max: 5
stage:
min: 5
max: 10
prod:
min: 10
max: 500
capacities:
- table: DevicePairingInfoTable # DynamoDB Resource
read:
minimum: ${self:custom.ddbCapaciies.read.${self:custom.stage}.min} # Minimum read capacity
maximum: ${self:custom.ddbCapaciies.read.${self:custom.stage}.max} # Maximum read capacity
usage: 0.80 # Targeted usage percentage
write:
minimum: ${self:custom.ddbCapaciies.write.${self:custom.stage}.min} # Minimum write capacity
maximum: ${self:custom.ddbCapaciies.write.${self:custom.stage}.min} # Maximum write capacity
usage: 0.80 # Targeted usage percentage
PairingCodeTable:
Type: AWS::DynamoDB::Table
DeletionPolicy: Retain
Properties:
TableName: ${self:custom.dbPairingCodeName}
AttributeDefinitions:
- AttributeName: pairingCode
AttributeType: S
- AttributeName: serialNumber
AttributeType: S
- AttributeName: platform
AttributeType: S
KeySchema:
- AttributeName: pairingCode
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: ${self:custom.ddbCapaciies.read.${self:custom.stage}.min}
WriteCapacityUnits: ${self:custom.ddbCapaciies.write.${self:custom.stage}.max}
GlobalSecondaryIndexes:
- IndexName: ${self:custom.dbPairingCodeSerialIndex}
KeySchema:
- AttributeName: serialNumber
KeyType: HASH
Projection:
ProjectionType: ALL
ProvisionedThroughput:
ReadCapacityUnits: ${self:custom.ddbCapaciies.read.${self:custom.stage}.min}
WriteCapacityUnits: ${self:custom.ddbCapaciies.write.${self:custom.stage}.max}
- IndexName: ${self:custom.dbPairingCodePlatformIndex}
KeySchema:
- AttributeName: platform
KeyType: HASH
Projection:
ProjectionType: ALL
ProvisionedThroughput:
ReadCapacityUnits: ${self:custom.ddbCapaciies.read.${self:custom.stage}.min}
WriteCapacityUnits: ${self:custom.ddbCapaciies.write.${self:custom.stage}.max}
But when I deploy that I get an error with table already exists. That should be because of I create the table by script, not from servless yaml.
An error occurred: xxxxxTable - xxxxxxx-int-devicePairingCode already exists.
We can only do that if the tables are created by serverless yaml at the beginning. But my table is created by my dump script. I need to check how to do that in shell script.
Follow the link
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/AutoScaling.CLI.html
Alter the AutoScaling on DynamoDB
No finished, we will currently do that from the console.
References:
https://github.com/sbstjn/serverless-dynamodb-autoscaling
https://sbstjn.com/serverless-dynamodb-auto-scaling-with-cloudformation.html
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/AutoScaling.CLI.html
发表评论
-
Stop Update Here
2020-04-28 09:00 331I will stop update here, and mo ... -
NodeJS12 and Zlib
2020-04-01 07:44 491NodeJS12 and Zlib It works as ... -
Docker Swarm 2020(2)Docker Swarm and Portainer
2020-03-31 23:18 377Docker Swarm 2020(2)Docker Swar ... -
Docker Swarm 2020(1)Simply Install and Use Swarm
2020-03-31 07:58 381Docker Swarm 2020(1)Simply Inst ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 351Traefik 2020(1)Introduction and ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 439Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 449Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 392Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 475VPN Server 2020(2)Docker on Cen ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 401Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 496NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 438Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 346Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 262GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 463GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 336GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 322Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 330Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 306Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(1)Running with Component
2020-02-19 01:17 320Serverless with NodeJS and Tenc ...
相关推荐
- **AutoScaling Launch Configuration**: 启动配置包含了实例类型、AMI、安全组等配置信息,因此在这里可以更改实例类型。 **结论**: 实例类型应在AutoScaling Launch Configuration中进行修改。 #### 题目211: ...
- **Amazon DynamoDB**:无服务器、高性能的NoSQL数据库,Spring Data库提供了对DynamoDB的集成支持。 - **Amazon EC2**:弹性计算云,可以运行Spring Boot应用的实例。 - **Amazon Lambda**:无服务器计算平台,...
6. **DynamoDB**:DynamoDB是AWS的NoSQL数据库服务,适合高吞吐量的应用。配置可能涉及表的创建、索引、读写容量和自动缩放设置。 7. **IAM(Identity and Access Management)**:IAM用于控制AWS资源的访问权限。...
- 考虑到 FortiWeb 的性能和可用性,可能需要配置 AWS Auto Scaling Group 和 CloudWatch 监控。Terraform 可以定义伸缩策略和触发器,根据 CPU 使用率或其他指标动态调整实例数量。 6. **持续集成/持续部署 (CI/...
Terraform AWS是HashiCorp Configuration Language(HCL)的一种应用,用于自动化Amazon Web Services(AWS)资源的创建、配置和管理。Terraform是一种基础设施即代码(IaC)工具,它允许开发者以声明性的方式定义云...
我们可以配置Auto Scaling Group来确保应用层能够根据负载自动扩展。 3. **数据库层**: 数据库层存储和管理应用程序的数据。Terraform支持多种数据库服务,如AWS的RDS(Relational Database Service)用于MySQL、...