设为首页 收藏本站
查看: 1280|回复: 0

[经验分享] AWS标准扩容(三)

[复制链接]

尚未签到

发表于 2019-2-3 12:42:00 | 显示全部楼层 |阅读模式
AWS扩容过程:
You can increase the storage space of an existing EBS volume without losing the data on the volume.
你能够不丢数据地增加现在EBS卷上的存储空间。
To do this, you migrate your data to a larger volume and then extend the file system on the volume to recognize the newly-available space. After you verify that your new volume is working properly, you can delete the old volume.要做到这一点,你迁移你的数据到一个更大的卷然后扩展卷上的文件系统来识别新的可用空间。在你验证新的卷工作正常后,你可以删除老的卷。


  •   Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.打开EC2Console
  •   In      the navigation pane, choose Instances and      then locate the instance with the volume that you want to expand. 找到导航窗格,选择“Instances”然后找到需要扩容的实例
  •   Make      a note of the instance ID and Availability Zone. You will specify this      information when you attach a new volume to the instance later in this      procedure.记录下实例的ID号和可用区域。当你附加一个新的磁盘到此实例的过程中你需要指定这些信息。
  •   Verify      that the instance Shutdown      Behavior is set to Stop and not Terminate.

    •   Choose the instance.
    •   From       the context-menu (right-click) choose Instance Settings, and then choose Change Shutdown Behavior.
    •   If       the Shutdown behavior is       set to Terminate,       choose Stop,       and then choose Apply.
                    If the
      Shutdown       behavior is already set to Stop, then choose Cancel.


核实是被stop而不是terminate.a.选择实例  b.右击选择“Instance settings”然后,选择“Change shutdown behavior”. c.如果“shutdown behavior”将被设置为“Terminate”,选择“Stop”,然后选择“Apply”;如果“shutdown behavior”已经被设置为“Stop”,选择“Cancel”.


  5. Stop the instance. For more      information about how to stop an instance, see Stopping and Starting Your Instances.
            
Warning
            
When you stop an instance, the data on any      instance store volumes is erased. Therefore, if you have any data on      instance store volumes that you want to keep, be sure to back it up to persistent storage.
停止实例。如果有数据放在instance store,请备份到persistent storage.
  6. Create a snapshot of the volume to expand.


    •   In the navigation pane, choose Volumes, and then locate the volume you want to expand.
    •   From       the context-menu (right-click) choose the volume that you want to       expand, and then choose Create Snapshot.
    •   Enter       information in the Name and Description fields,       and then choose Yes,       Create.

创建一个卷的snapshot用于扩展。右击需要做snapshot的磁盘创建snapshot,加入名字和描述。
  7. Create a new volume from the snapshot.


    •   In the navigation pane, choose Snapshots.
    •   When       the status of the snapshot that you just created is set to completed, choose the snapshot, and       then from the context-menu (right-click) choose Create Volume.
    •   In       the Create Volume dialog       box, choose the desired volume type and enter the new volume size. You       must also set the Availability       Zone to match the instance       Availability Zone. Choose Yes, Create.
                    
      Important
                    
      If you do not set the Availability Zone to       match the instance then you will not be able to attach the new volume to       the instance.

创建新的卷对于这个snapshot.当 备份完毕后右击这个snapshot创建卷。输入卷的类型和大小。你必须把它放在可用区域。

  8. Detach the old volume.


    •   In the navigation pane, choose Volumes, and then choose the old volume from the list. Make a note       of the device name in the Attachment Information field. You will specify this information when you attach a       new volume to the instance later in this procedure. The information       appears in the following format:
                    
      i-xxxxxxxxxxxxxxxxx (instance_name):device_name
    •   From       the context-menu (right-click) choose the old volume, and then choose Detach Volume.
    •   In       the Detach Volume dialog       box, choose Yes,       Detach. It may take several minutes for the       volume to detach.

分离老的卷。

  •   找到老的卷,记下设备名称,在attachment      information你可以找到。当你附加一个新的卷在这个实例的时候你需要指定这个信息。
  •   右击老的卷,然后选择detach      volume.
  •   选择yes,detach.

  9. Attach the newly expanded volume


    •   In the navigation pane, choose Volumes.
    •   From       the context-menu (right-click) choose the new volume, and then choose Attach Volume.
    •   Start       typing the name or ID of the instance in the Instance field,       and then choose the instance.
    •   Enter the same device name retrieved in Step       8.a, and then choose Yes,       Attach. It is important to attach       the new volume to the exact location you noted above (for example /dev/sda1).


附加新的扩展过的卷。
a.右击,选择attach volume.
b.输入实例的名字和Id在“instance”这个字段,选择实例。
c.输入设备名称,选择yes,attach.


  10.Restart the instance.


    •   In the navigation pane, choose Instances and then choose the instance you want to       restart.
    •   From       the context-menu (right-click) choose Instance State, and then choose Start.
    •   In       the Start Instances dialog       box, choose Yes,       Start. If the instance fails to start, and the volume being       expanded is a root volume, verify that you attached the expanded volume       using the same device name as the original volume, for example /dev/sda1.



重启实例,右击实例,选择instance state,然后选择start. 然后选择yes,start.




  •   注意:
Note
After you are done resizing your volume, you should delete the snapshot you created in the procedure above to avoid incurring storage costs.
在你resize你的卷后,你应该删除刚刚创建的snapshot,避免招致存储花费。


  11. Extending a Linux File System扩展文件系统:
  For ext2, ext3, and ext4 file systems, this command is resize2fs. For XFS file systems, this command is xfs_growfs.注意在使用xfs_growfs需要安装包:
sudo yum install xfsprogs

Then use the following command, substituting the mount point of the file system (XFS file systems must be mounted to resize them).注意下括号里面的内容:xfs文件系统必须挂载状态。
[ec2-user ~]$ sudo xfs_growfs -d /mnt



怎么查看文件系统的类型:
file -s /dev/xvd*

显示块设备:
  lsblk command to list the block devices attached to your instance. The example below shows three volumes: /dev/xvda, /dev/xvdb, and /dev/xvdf.

注意:
Note
If you receive an xfsctl failed: Cannot allocate memory error, you may need to update the Linux kernel on your instance. For more information, refer to your specific operating system documentation.
如果是收到一个:xfsctl faild:cannot 分配内存错误,你或许需要更新linux内核了。








  





运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-671304-1-1.html 上篇帖子: PV & PVC 下篇帖子: EBS 11i数据库升级(9i->10g)几点事项
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表