- 浏览: 2542829 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
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 310I will stop update here, and mo ... -
NodeJS12 and Zlib
2020-04-01 07:44 468NodeJS12 and Zlib It works as ... -
Docker Swarm 2020(2)Docker Swarm and Portainer
2020-03-31 23:18 362Docker Swarm 2020(2)Docker Swar ... -
Docker Swarm 2020(1)Simply Install and Use Swarm
2020-03-31 07:58 364Docker Swarm 2020(1)Simply Inst ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 330Traefik 2020(1)Introduction and ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 424Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 428Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 367Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 445VPN Server 2020(2)Docker on Cen ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 377Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 468NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 414Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 332Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 243GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 445GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 321GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 307Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 310Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 286Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(1)Running with Component
2020-02-19 01:17 303Serverless with NodeJS and Tenc ...
相关推荐
用法将添加到您的项目中: # Via yarn$ yarn add serverless-dynamodb-autoscaling# Via npm$ npm install serverless-dynamodb-autoscaling 将插件添加到您的serverless.yml : plugins : - serverless-dynamodb-...
DynamoDB 的 Auto Scaling dynamo-scale是一种工具,可根据当前利用率自动扩展您的 Amazon DynamoDB 吞吐量(读/写容量)。 跑步 npm install 安装依赖项。 要启动 dynamo-scale 只需运行 node dynamodb.js 请...
npm install --save-dev serverless-dynamodb-autoscaling-plugin serverless.yml: plugins: - serverless-dynamodb-autoscaling-plugin custom: autoscaling: - table: Table read: minimum: 5 maximum: ...
boto3是Amazon Web Services(AWS)的官方Python SDK,它为开发者提供了与AWS服务交互的接口,包括EC2、S3、DynamoDB等众多服务。通过boto3,开发者可以方便地在Python应用程序中使用AWS的功能。 而mypy-boto3-auto...
该库是针对AWS Boto3 SDK的扩展,Boto3是Amazon Web Services (AWS)的Python开发工具包,它允许Python开发者轻松地访问和操作AWS的各种服务,包括EC2、S3、DynamoDB等。"mypy-boto3-autoscaling-plans"则专门针对AWS...
**AWS Auto Scaling** 是Amazon Web Services提供的一项服务,它能够动态调整EC2实例的数量,以满足应用程序的负载需求。通过自动扩展,你可以确保在高负载时增加计算资源,而在低负载时减少资源,从而节省成本并...
boto3是AWS的官方Python开发工具包,它提供了与AWS服务的全面集成,包括EC2(弹性计算云)、S3(简单存储服务)、DynamoDB(键值和文档数据库)、RDS(关系数据库服务)以及我们这里关注的Autoscaling服务。...
本文将深入探讨名为`mypy-boto3-application-autoscaling`的Python库,它与AWS(Amazon Web Services)的应用自动扩展服务紧密结合,帮助开发者轻松管理和优化其应用程序的性能。 `mypy-boto3-application-auto...
《Python库mypy-boto3-application-autoscaling详解》 在现代软件开发中,Python以其易读性、灵活性和丰富的库支持,成为了后端开发的热门选择。在Python的世界里,`mypy`和`boto3`是两个非常重要的工具,而`mypy-...
terraform-aws-dynamodb Terraform模块,用于使用自动缩放功能配置DynamoDB表。 Autoscaler会根据负载来缩放DynamoDB表的预配置OPS。 要求 此模块需要 >= 1.17.0 该项目是我们针对DevOps的全面方法的一部分。 它...
本文档旨在帮助IT专业人员了解AWS认证SAA-C02考试的相关知识点,涵盖Amazon API Gateway、AWS Lambda、Amazon DynamoDB、Amazon EC2 Auto Scaling、Amazon RDS、Amazon Fargate等多个服务和技术。 知识点1: AWS ...
Amazon DynamoDB 是一种完全托管的 NoSQL 数据库服务,提供快速且可预测的性能,同时还能够实现无缝扩展。使用 DynamoDB,您可以免除操作和扩展分布式数据库的管理工作负担,因而无需担心硬件预置、设置和配置、复制...
Amazon DynamoDB:构建NoSQL数据库驱动的应用程序 Amazon DynamoDB是一个键值和文档数据库,可在任何规模上提供单位毫秒的性能。 它是一个完全托管的,多区域,多活动,持久的数据库,具有针对Internet规模应用程序...
Amazon DynamoDB 设计模式 此存储库包含示例数据模型和源代码,用于演示 Amazon DynamoDB 的设计模式。 例子 数据模型和源代码在/examples文件夹下列出。 设备状态日志 - [数据模型] 网上商店 - [数据模型] 使用 ...
Amazon DynamoDB是一款由亚马逊提供的高性能、完全托管的NoSQL数据库服务,旨在提供极低延迟的数据访问。它非常适合需要高吞吐量、可预测性能以及对数据可用性和一致性有严格要求的应用程序。而`aws-dynamodb-scala`...
弹簧数据动力学模型使用Spring-Data-Rest的Amazon DynamoDB Spring-Data存储库演示开始按照Amazon示例教程中的描述创建并填充Amazon DynamoDB“论坛”,“线程”和“回复”表: 使用您的DynamoDB终端节点和AWS凭证...
DynamoDB Cookbook by Tanmay Deshpande, Over 90 hands-on recipes to design Internet scalable web and mobile applications with Amazon DynamoDB
适用于JavaScript的Amazon DynamoDB DataMapper 该存储库托管着几个软件包,这些软件包共同构成一个对象,以使用Amazon DynamoDB为JavaScript应用程序提供文档映射器。 入门 提供了一种简单的方法来持久存储应用...
在现代的云原生应用开发中,Amazon DynamoDB作为一款高性能、完全托管的NoSQL数据库服务,被广泛应用于存储和检索大规模数据。针对Go语言的开发者,亚马逊AWS提供了一个官方的SDK,然而,对于一些特定需求或性能优化...
DynamoDB 软件-amazon-awssdk-dynamodb 码头工人 本地堆栈 杰克8 ws 执行 剧本 配置您的AWS CLI: region: sa-east-1 accessKeyId: test-key secretKey: test-secret 启动本地堆栈: 命令: localstack start ...