AWS: EC2 — изменение типа инстанса и EBS — изменение размера хранилища

До недавних дней, процедура изменения типа инстанса или добавления гигабайт на ваш жесткий диск через консоль AWS было проблемой, чреватой создания копии инстанса, его конфигурацией и подменой оригинального на копию, с переназначением Elastic IP.

Расскажу, как это сделать гораздо быстрее и безопаснее.

Изменяем тип инстанса EC2

Например, если вам понадобились дополнительные мощности и вы готовы к переходу на более производительный сервер

  • В разделе EC2 переходим в под-раздел Instances
  • Останавливаем целевой инстанс — выбираем инстанс и затем нажимаем ActionsInstance StateStop
  • Как только сервер будет остановлен изменяем его тип: ActionsInstance SettingsChange Instance Type
  • Выбираем необходимый тип и подтверждаем выбор — Apply
  • Стартуем измененный инстанс: ActionsInstance StateStart

Таким образом, можно изменять мощность как в большую сторону, так и в меньшую

Изменяем размер жестного диска EBS

  • В разделе EC2 переходим в подраздел  Elastic Block StoreVolumes
  • Выбираем именно тот Volume (жесткий диск) который нам необходим — идентифицируем его или по тегам, которые мы составляли при добавления Volume к нашему серверу при создании или же по столбцу Attachment information
  • Далее: ActionsModify Volume
  • Устанавливаем новый размер хранилища Size и, затем, Modify

Так мы увеличили размер хранилища. Осталось внести изменения в системе, для расширения основного раздела жесткого диска.

Далее инструкция будет для Linux (CentOS в частности, а для других систем можно обратиться к официальной документации)

Соединяемся с сервером по SSH. Затем получаем рут права

$ sudo su

Выводим список блоков хранения, прикрепленных к серверу

# lsblk

Обычно, основной блок имеет имя nvme0n1, закидываем на него не привязанную память

# growpart /dev/nvme0n1 1

Удостоверяемся что память привязана

# lsblk

Говорим файловой системе, что можно использовать эту новую память. Выводим список разделов

# df -h

И применяем изменения к основному разделу (чаще всего это /dev/nvme0n1p1)

# sudo resize2fs /dev/nvme0n1p1

Удостоверимся, что изменения произошли успешно

# df -h

Готово! При этом, перезагрузка сервера не требуется.

AWS: EC2 — изменение типа инстанса и EBS — изменение размера хранилища: 33 комментария

  1. Hello, my name’s Eric and I just ran across your website at questpro.club…

    I found it after a quick search, so your SEO’s working out…

    Content looks pretty good…

    One thing’s missing though…

    A QUICK, EASY way to connect with you NOW.

  2. ATT: questpro.club / Questpro клуб любителей интересных вопросов WEBSITE SERVICES
    This notice RUNS OUT ON: Sep 23, 2020

    We have not gotten a payment from you.
    We’ve tried to contact you but were unable to contact you.

    For information as well as to process a discretionary payment for solutions.

    09232020014157.

  3. Cool website!

    My name’s Eric, and I just found your site — questpro.club — while surfing the net. You showed up at the top of the search results, so I checked you out. Looks like what you’re doing is pretty cool.

  4. RE: questpro.club / Questpro клуб любителей интересных вопросов WEBSITE SERVICES
    This notification EXPIRES ON: Oct 30, 2020

    We have not received a payment from you.
    We have actually tried to call you however were incapable to reach you.

  5. Hey there, I just found your site, quick question…

    My name’s Eric, I found questpro.club after doing a quick search – you showed up near the top of the rankings, so whatever you’re doing for SEO, looks like it’s working well.

    So here’s my question – what happens AFTER someone lands on your site? Anything?

  6. Hello, my name’s Eric and I just ran across your website at questpro.club…

    I found it after a quick search, so your SEO’s working out…

    Content looks pretty good…

    One thing’s missing though…

    A QUICK, EASY way to connect with you NOW.

  7. Hey there, I just found your site, quick question…

    My name’s Eric, I found questpro.club after doing a quick search – you showed up near the top of the rankings, so whatever you’re doing for SEO, looks like it’s working well.

    So here’s my question – what happens AFTER someone lands on your site? Anything?

  8. Hello, my name’s Eric and I just ran across your website at questpro.club…

    I found it after a quick search, so your SEO’s working out…

    Content looks pretty good…

    One thing’s missing though…

  9. Fantastic post but I was wanting to know if you could write a litte more on this subject?
    I’d be very thankful if you could elaborate a little bit more.
    Thanks!

  10. If you want to be young, you need a real person wig, thin hair and white hair, and you still want to slap them? Hurry up and find Do Laimi to send additional issuance! Want to change hairstyle anytime? Do Laimi can wear a real wig.

  11. Great post. I was checking continuously this blog
    and I am impressed!
    Extremely helpful info particularly the last part
    I care for
    such info a lot. I was looking
    for this certain information for
    a long time. Thank you and best of luck.

  12. Oh my goodness! Awesome article
    dude! Thank you so much, However I am having difficulties
    with your RSS. I don’t understand why I cannot
    join it. Is there anybody else getting
    the same RSS problems?
    Anyone that knows the answer can you kindly respond?

    Thanks!!

  13. Cool website!

    My name’s Eric, and I just found your site — questpro.club — while surfing the net. You showed up at the top of the search results, so I checked you out. Looks like what you’re doing is pretty cool.

    But if you don’t mind me asking – after someone like me stumbles across questpro.club, what usually happens?

  14. Excellent post however , I was wondering if you could write a litte more
    on this subject? I’d be very grateful if you could elaborate a little bit further.
    Bless you!

  15. Today, I went to the beach front with my children. I found a sea shell and gave it to
    my 4 year old daughter and said «You can hear the ocean if you put this to your ear.» She put
    the shell to her ear and screamed. There was a
    hermit crab inside and it pinched her ear. She never wants to go
    back! LoL I know this is totally off topic but
    I had to tell someone!

  16. Thanks a bunch for sharing this with all of us you really recognise what you are speaking about! Bookmarked. Kindly also seek advice from my site =). We can have a hyperlink change agreement among us!

  17. Высшее образование в сфере гуманитарных и естественных наук на 12 факультетах по 35 специальностям первой ступени образования и 22 специальностям второй

Добавить комментарий

Ваш адрес email не будет опубликован.