Loading...
Loading...
Compare original and translation side by side
| Category | Example | Use Case |
|---|---|---|
| Standard | db.m6g.large | General purpose |
| Memory Optimized | db.r6g.large | High memory workloads |
| Burstable | db.t3.medium | Variable workloads, dev/test |
| 类别 | 示例 | 使用场景 |
|---|---|---|
| 标准型 | db.m6g.large | 通用场景 |
| 内存优化型 | db.r6g.large | 高内存负载场景 |
| 突发性能型 | db.t3.medium | 可变负载、开发/测试场景 |
| Type | IOPS | Use Case |
|---|---|---|
| gp3 | 3,000-16,000 | Most workloads |
| io1/io2 | Up to 256,000 | High-performance OLTP |
| magnetic | N/A | Legacy, avoid |
| 类型 | IOPS | 使用场景 |
|---|---|---|
| gp3 | 3,000-16,000 | 大多数负载场景 |
| io1/io2 | 最高256,000 | 高性能OLTP场景 |
| 磁存储 | N/A | 遗留场景,不推荐使用 |
undefinedundefined
**boto3:**
```python
import boto3
rds = boto3.client('rds')
response = rds.create_db_instance(
DBInstanceIdentifier='my-postgres',
DBInstanceClass='db.t3.medium',
Engine='postgres',
EngineVersion='16.1',
MasterUsername='admin',
MasterUserPassword='SecurePassword123!',
AllocatedStorage=100,
StorageType='gp3',
DBSubnetGroupName='my-db-subnet-group',
VpcSecurityGroupIds=['sg-rds12345'],
MultiAZ=True,
BackupRetentionPeriod=7,
StorageEncrypted=True,
PubliclyAccessible=False
)
**boto3:**
```python
import boto3
rds = boto3.client('rds')
response = rds.create_db_instance(
DBInstanceIdentifier='my-postgres',
DBInstanceClass='db.t3.medium',
Engine='postgres',
EngineVersion='16.1',
MasterUsername='admin',
MasterUserPassword='SecurePassword123!',
AllocatedStorage=100,
StorageType='gp3',
DBSubnetGroupName='my-db-subnet-group',
VpcSecurityGroupIds=['sg-rds12345'],
MultiAZ=True,
BackupRetentionPeriod=7,
StorageEncrypted=True,
PubliclyAccessible=False
)aws rds create-db-instance-read-replica \
--db-instance-identifier my-postgres-replica \
--source-db-instance-identifier my-postgres \
--db-instance-class db.t3.medium \
--availability-zone us-east-1baws rds create-db-instance-read-replica \
--db-instance-identifier my-postgres-replica \
--source-db-instance-identifier my-postgres \
--db-instance-class db.t3.medium \
--availability-zone us-east-1baws rds create-db-snapshot \
--db-snapshot-identifier my-postgres-snapshot-2024-01-15 \
--db-instance-identifier my-postgresaws rds create-db-snapshot \
--db-snapshot-identifier my-postgres-snapshot-2024-01-15 \
--db-instance-identifier my-postgresaws rds restore-db-instance-from-db-snapshot \
--db-instance-identifier my-postgres-restored \
--db-snapshot-identifier my-postgres-snapshot-2024-01-15 \
--db-instance-class db.t3.medium \
--db-subnet-group-name my-db-subnet-group \
--vpc-security-group-ids sg-rds12345aws rds restore-db-instance-from-db-snapshot \
--db-instance-identifier my-postgres-restored \
--db-snapshot-identifier my-postgres-snapshot-2024-01-15 \
--db-instance-class db.t3.medium \
--db-subnet-group-name my-db-subnet-group \
--vpc-security-group-ids sg-rds12345aws rds restore-db-instance-to-point-in-time \
--source-db-instance-identifier my-postgres \
--target-db-instance-identifier my-postgres-pitr \
--restore-time 2024-01-15T10:30:00Z \
--db-instance-class db.t3.mediumaws rds restore-db-instance-to-point-in-time \
--source-db-instance-identifier my-postgres \
--target-db-instance-identifier my-postgres-pitr \
--restore-time 2024-01-15T10:30:00Z \
--db-instance-class db.t3.mediumundefinedundefinedundefinedundefinedimport boto3
import psycopg2
rds = boto3.client('rds')import boto3
import psycopg2
rds = boto3.client('rds')undefinedundefined| Command | Description |
|---|---|
| Create instance |
| List instances |
| Modify settings |
| Delete instance |
| Reboot instance |
| Start stopped instance |
| Stop instance |
| 命令 | 描述 |
|---|---|
| 创建实例 |
| 列出实例 |
| 修改配置 |
| 删除实例 |
| 重启实例 |
| 启动已停止的实例 |
| 停止实例 |
| Command | Description |
|---|---|
| Manual snapshot |
| List snapshots |
| Restore from snapshot |
| Point-in-time restore |
| Copy snapshot |
| 命令 | 描述 |
|---|---|
| 创建手动快照 |
| 列出快照 |
| 从快照恢复 |
| 时间点恢复 |
| 复制快照 |
| Command | Description |
|---|---|
| Create read replica |
| Promote to standalone |
| 命令 | 描述 |
|---|---|
| 创建只读副本 |
| 将副本升级为独立实例 |
undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined
**Solutions:**
- Scale up instance class
- Optimize slow queries
- Add read replicas
- Check for locking/blocking
**解决方案:**
- 升级实例规格
- 优化慢查询
- 添加只读副本
- 检查锁/阻塞情况undefinedundefinedundefinedundefinedaws cloudwatch get-metric-statistics \
--namespace AWS/RDS \
--metric-name ReplicaLag \
--dimensions Name=DBInstanceIdentifier,Value=my-postgres-replica \
--start-time $(date -d '1 hour ago' -u +%Y-%m-%dT%H:%M:%SZ) \
--end-time $(date -u +%Y-%m-%dT%H:%M:%SZ) \
--period 60 \
--statistics Averageaws cloudwatch get-metric-statistics \
--namespace AWS/RDS \
--metric-name ReplicaLag \
--dimensions Name=DBInstanceIdentifier,Value=my-postgres-replica \
--start-time $(date -d '1 hour ago' -u +%Y-%m-%dT%H:%M:%SZ) \
--end-time $(date -u +%Y-%m-%dT%H:%M:%SZ) \
--period 60 \
--statistics Average