aws 基本操作入门 (如何创建机器 如何扩容磁盘)

  • 查看所有ec2的描述
    aws ec2 describe-instance-status

  • 查看所有的卷信息
    aws ec2 describe-volumes

  • 创建安全组
    aws ec2 create-security-group –group-name jav –description “Myy Group”

  • 安全组里面添加策略
    aws ec2 authorize-security-group-ingress –group-name jav –protocol tcp –port 22 –cidr 0.0.0.0/0

  • 创建ec2机器
    aws ec2 run-instances –key-name mykey –image-id ami-56d4ad31 –count 1 –instance-type t2.micro –security-groups jav –block-device-mapping file:///root/disk.json

{
    "DeviceName": "/dev/xvda",
    "Ebs": {
      "VolumeSize": 33
    }
}
  • 磁盘扩容
aws ec2 modify-volume --volume-id vol-070a7796c8543f11d --size 44 

xxx --volume-type io1 --iops 10000

注意, 磁盘扩容如果是standard的磁盘,也就是标准磁介质的磁盘,是无法从33GB扩容到44GB的,目前测试gp2的磁盘可以在线扩容,可是100GB的磁盘价格大概是standard的两倍。

An error occurred (InvalidParameterValue) when calling the ModifyVolume operation: Volume type EBS Magnetic is not supported.
磁性介质不支持调整属性

[EBS volumes] The volume type, which can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic. The default value is gp2 in the Amazon EC2 console, and standard in the AWS SDKs and the AWS CLI.
  • stop和终止实例
aws ec2 stop-instances --instance-ids i-08e87fd92fb07d3b6
aws ec2 terminate-instances --instance-ids i-08e87fd92fb07d3b6
  • key的创建

在网络和安全页面,有创建key的地方,一旦创建,会有一个pem文件被下载下来。

  • aws configure的配置

在 右上角,点击自己的名字 > 安全啥的 > 添加一个 ec2full权限的账户就可以操作了。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值