How to contribute a limited/specific amount of  storage as a slave to the cluster?

How to contribute a limited/specific amount of storage as a slave to the cluster?

Hola Connections!

Whenever the Datanode shares the storage space to Master Node, it always shares the whole storage by default.

Ever got stuck up with the thought of how could you share limited / specific amount storage for example 10 GB from 20GB ? If yes, I am here to answer you how !

And if not, let us know how it could be useful ;)

  • Imagine the situation where you have shared the whole storage of Datanode . Now your Datanode capacity has got full and it's hung up! Or just imagine the system crashed or the single system is overloaded !
  • Or Just in case you don't wish to share the whole storage to Master !

Now, let us look at how to share specific amount of storage:

  • This is the Datanode holding 10GB storage space
No alt text provided for this image

When storage is shared to the Namenode it shares whole storage like this:

No alt text provided for this image

Now I wish to Attach 5 GB of EBS storage externally to my instance and share only 2GB of it. So, I have attached volume as follows:

If you are unaware about how to create volume and attach it you can refer to this article of mine → Create and attach volume

No alt text provided for this image

Now we need to create partition. To do so we follow 4 steps:

Step 1: Confirm about how much partition we need and create its physical partition.

→ Here we need 2GB

No alt text provided for this image
No alt text provided for this image




Step 2: Load the driver

→ Command: udevadm settle

Step 3 :Format the Partition

→ Command: mkfs.ext4 disk_path

No alt text provided for this image

Step 4: Mount the partition to directory (To activate)

→ Command: mouth disk_path directory_path

No alt text provided for this image

Now as we have successfully created the partition of 2GB and mounted it to /limitshare, we need to edit our hdfs-site.xml with directory path as follows.

No alt text provided for this image




Now you can see the limited amount of storage is successfully shared.

No alt text provided for this image







Hoping of this was helpful....Thank you !
Priyanka Hajare

DevOps Engineer || Python || Docker || Ansible || Kubernetes || AWS || Jenkins || Buildkite || GoCD || GIT || GITHUB ||

4 年

Well done ??Hasti Vora

要查看或添加评论,请登录

Hasti Vora的更多文章

社区洞察

其他会员也浏览了