简体   繁体   English

如何在AWS EC2实例中增加磁盘的逻辑卷

[英]How to increase logical volume of a disk in AWS EC2 instance

df -h command returns df -h命令返回

[root@ip-SERVER_IP ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      7.8G  5.5G  2.0G  74% /
tmpfs            32G     0   32G   0% /dev/shm
cm_processes     32G     0   32G   0% /var/run/cloudera-scm-agent/process

I have a volume with 500GB of disk space. 我有一个具有500GB磁盘空间的卷。

Now, I installed some stuff in /dev/xvda1 and it keeps saying that: 现在,我在/dev/xvda1安装了一些东西,它一直在说:

The Cloudera Manager Agent's parcel directory is on a filesystem with less than 5.0 GiB of its space free. /opt/cloudera/parcels (free: 1.9 GiB (25.06%), capacity: 7.7 GiB)

Similarly: 类似地:

The Cloudera Manager Agent's log directory is on a filesystem with less than 2.0 GiB of its space free. /var/log/cloudera-scm-agent (free: 1.9 GiB (25.06%), capacity: 7.7 GiB)

From the memory stats, I see that the Filesystem above stuff is installed in must be: 从内存统计信息中,我看到安装了上述文件系统的文件必须是:

/dev/xvda1

I believe it needs to be resized so as to have more disk space but I don't think I need to expand the volume. 我认为需要调整其大小以具有更多的磁盘空间,但我认为不需要扩展该卷。 I have only installed some stuff and started with it. 我只安装了一些东西并开始使用它。

So I would like to know what exact steps I need to follow to expand the space in this partition and where exactly is my 500 GB? 因此,我想知道需要执行哪些确切的步骤来扩展此分区中的空间,以及我的500 GB到底在哪里?

I would like to know it step by step since I cannot afford to lose what I have on the server already. 我想逐步了解它,因为我已经无法失去已经在服务器上拥有的东西。 Please help 请帮忙

lsblk:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT 
xvda 202:0 0 500G 0 disk 
└─xvda1 202:1 0 8G 0 part /
  1. This question should be asked under serverfault.com. 此问题应在serverfault.com下提出。
  2. Don't "expand" the volume. 不要“扩大”音量。 It is not common practice to expand root drive in Linux for none-OS folder. 在Linux中为无OS文件夹扩展根驱动器​​是不常见的做法。 Since your stuff is inside /opt/cloudera/parcels , what you need to do is allocate a new partition, mount it, then copy for it. 由于您的东西在/opt/cloudera/parcels ,因此您需要做的是分配一个新分区,挂载它,然后为其复制。 example is shown here : paritioning & moving . 此处显示示例: 分区和移动 (assume /home is your /top/cloudera/parcels". (假设/ home是您的/ top / cloudera / parcels”。

  3. To check your disk volume , try this sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL 要检查磁盘容量,请尝试使用以下sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL

(update) In fact, if you create your EC2 instance under EBS volume, you don't need to allocate 500GB upfront. (更新)实际上,如果在EBS容量下创建EC2实例,则无需预先分配500GB。 You can allocate smaller space, then expand the disk space following this step : Expanding the Storage Space of an EBS Volume on Linux . 您可以分配较小的空间,然后按照以下步骤扩展磁盘空间: 在Linux上扩展EBS卷的存储空间 You should create a snapshot for the EBS before perform those task. 在执行这些任务之前,您应该为EBS创建快照。 However, there is a catch of EBS disk IOPS, if you allocate less space, there will be less IOPS given. 但是,EBS磁盘IOPS有很多问题,如果分配的空间更少,则分配的IOPS也会更少。 So if you allocate 500GB , you will get 500x 3 = max 1500 IOPS. 因此,如果分配500GB,您将获得500x 3 =最高1500 IOPS。

AWS LVM链接为您提供了有关如何在AWS EC2中增加逻辑卷大小的分步说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM