云计算速查表
本章汇总云计算常用术语、命令和最佳实践,方便快速查阅。
云计算基础术语
| 术语 | 英文 | 解释 |
|---|---|---|
| 云计算 | Cloud Computing | 通过互联网按需提供计算资源的模式 |
| 公有云 | Public Cloud | 由云服务商运营,多用户共享的云平台 |
| 私有云 | Private Cloud | 专为单个组织构建的云平台 |
| 混合云 | Hybrid Cloud | 公有云和私有云的结合 |
| 多云 | Multi-Cloud | 同时使用多个云服务商的服务 |
| IaaS | Infrastructure as a Service | 基础设施即服务 |
| PaaS | Platform as a Service | 平台即服务 |
| SaaS | Software as a Service | 软件即服务 |
| FaaS | Function as a Service | 函数即服务 |
| VPC | Virtual Private Cloud | 虚拟私有云 |
| 弹性伸缩 | Auto Scaling | 根据负载自动调整资源 |
| 高可用 | High Availability | 系统持续可用的能力 |
云服务商对照表
计算服务
| 服务类型 | AWS | Azure | GCP | 阿里云 |
|---|---|---|---|---|
| 虚拟机 | EC2 | Virtual Machines | Compute Engine | ECS |
| 容器服务 | ECS/EKS | AKS | GKE | ACK |
| 无服务器 | Lambda | Functions | Cloud Functions | 函数计算 |
| 批处理 | Batch | Batch | Batch | 批量计算 |
存储服务
| 服务类型 | AWS | Azure | GCP | 阿里云 |
|---|---|---|---|---|
| 对象存储 | S3 | Blob Storage | Cloud Storage | OSS |
| 块存储 | EBS | Disk Storage | Persistent Disk | 云盘 |
| 文件存储 | EFS | Files | Filestore | NAS |
| 归档存储 | Glacier | Archive Storage | Archive Storage | 归档存储 |
数据库服务
| 服务类型 | AWS | Azure | GCP | 阿里云 |
|---|---|---|---|---|
| 关系型数据库 | RDS/Aurora | SQL Database | Cloud SQL | RDS |
| NoSQL数据库 | DynamoDB | Cosmos DB | Firestore | 表格存储 |
| 缓存 | ElastiCache | Redis Cache | Memorystore | Redis |
| 数据仓库 | Redshift | Synapse | BigQuery | MaxCompute |
网络服务
| 服务类型 | AWS | Azure | GCP | 阿里云 |
|---|---|---|---|---|
| 负载均衡 | ALB/NLB | Load Balancer | Cloud Load Balancing | SLB |
| CDN | CloudFront | CDN | Cloud CDN | CDN |
| DNS | Route 53 | DNS | Cloud DNS | 云解析 |
| 专线 | Direct Connect | ExpressRoute | Interconnect | 物理专线 |
AWS CLI常用命令
EC2
# 列出实例
aws ec2 describe-instances
# 启动实例
aws ec2 start-instances --instance-ids i-12345678
# 停止实例
aws ec2 stop-instances --instance-ids i-12345678
# 创建实例
aws ec2 run-instances \
--image-id ami-12345678 \
--instance-type t3.micro \
--key-name my-key
# 创建安全组
aws ec2 create-security-group \
--group-name my-sg \
--description "My security group"
S3
# 列出存储桶
aws s3 ls
# 创建存储桶
aws s3 mb s3://my-bucket
# 上传文件
aws s3 cp file.txt s3://my-bucket/
# 下载文件
aws s3 cp s3://my-bucket/file.txt ./
# 同步目录
aws s3 sync ./local s3://my-bucket/remote
# 删除存储桶
aws s3 rb s3://my-bucket --force
Lambda
# 列出函数
aws lambda list-functions
# 创建函数
aws lambda create-function \
--function-name my-function \
--runtime python3.9 \
--handler index.handler \
--zip-file fileb://function.zip \
--role arn:aws:iam::123456789:role/lambda-role
# 调用函数
aws lambda invoke --function-name my-function output.json
# 更新函数代码
aws lambda update-function-code \
--function-name my-function \
--zip-file fileb://function.zip
RDS
# 列出数据库实例
aws rds describe-db-instances
# 创建数据库实例
aws rds create-db-instance \
--db-instance-identifier my-db \
--db-instance-class db.t3.micro \
--engine mysql \
--master-username admin \
--master-user-password password
# 创建快照
aws rds create-db-snapshot \
--db-instance-identifier my-db \
--db-snapshot-identifier my-snapshot
云计算最佳实践速查
安全最佳实践
| 实践 | 说明 |
|---|---|
| 最小权限原则 | 只授予完成任务所需的最小权限 |
| 启用MFA | 为所有用户启用多因素认证 |
| 加密数据 | 静态和传输中的数据都要加密 |
| 网络隔离 | 使用VPC和安全组隔离资源 |
| 定期审计 | 定期审查权限和配置 |
成本优化最佳实践
| 实践 | 说明 |
|---|---|
| 使用预留实例 | 稳定负载使用预留实例节省成本 |
| 自动伸缩 | 根据负载自动调整资源 |
| 清理未使用资源 | 定期清理未使用的存储、实例等 |
| 选择合适存储层级 | 根据访问频率选择存储层级 |
| 设置预算告警 | 监控成本,及时发现异常 |
高可用最佳实践
| 实践 | 说明 |
|---|---|
| 多可用区部署 | 在多个可用区部署应用 |
| 自动故障转移 | 配置数据库和服务的自动故障转移 |
| 负载均衡 | 使用负载均衡分发流量 |
| 健康检查 | 配置健康检查及时发现故障 |
| 灾备方案 | 制定灾备计划并定期演练 |
性能优化最佳实践
| 实践 | 说明 |
|---|---|
| 使用CDN | 加速静态内容分发 |
| 缓存热点数据 | 使用Redis等缓存减少数据库访问 |
| 读写分离 | 将读请求分发到只读副本 |
| 优化查询 | 优化SQL查询和索引 |
| 资源监控 | 监控资源使用,及时发现瓶颈 |
常用端口号
| 服务 | 端口 | 说明 |
|---|---|---|
| SSH | 22 | 远程登录 |
| HTTP | 80 | Web服务 |
| HTTPS | 443 | 安全Web服务 |
| MySQL | 3306 | MySQL数据库 |
| PostgreSQL | 5432 | PostgreSQL数据库 |
| Redis | 6379 | Redis缓存 |
| MongoDB | 27017 | MongoDB数据库 |
单位换算
| 单位 | 值 |
|---|---|
| 1 KB | 1024 Bytes |
| 1 MB | 1024 KB |
| 1 GB | 1024 MB |
| 1 TB | 1024 GB |
| 1 PB | 1024 TB |
SLA可用性对照
| SLA | 年停机时间 | 月停机时间 |
|---|---|---|
| 99% | 3.65天 | 7.31小时 |
| 99.9% | 8.77小时 | 43.83分钟 |
| 99.99% | 52.6分钟 | 4.38分钟 |
| 99.999% | 5.26分钟 | 26.3秒 |
参考资源
官方文档
认证考试
| 云服务商 | 认证 |
|---|---|
| AWS | AWS Certified Solutions Architect |
| Azure | Microsoft Certified: Azure Solutions Architect |
| GCP | Google Cloud Professional Cloud Architect |
| 阿里云 | 阿里云认证云计算架构师 |