Things I don't want to look for twice..

Monthly Archives: May 2013

apt-get install build-essentials RPM alternative

Considering I’m on a mix of RHEL and Debian infrastructure, I needed the same easy command to install everything needed in order to be able to compile something locally on my own, so instead of running this on Debian:

apt-get install build-essentials

You can type this on RedHat based systems:

yum groupinstall "Development Tools"

GlusterFS expand and rebalance

So, lets say there’s a testvol volume created from gluster1:/glusterfs and gluster2:/glusterfs, also there’s a mirror between them, so replication occurs.

You then decide you need to expand the volume, replication will still be in place, and you need to add 2 bricks from 2 severs (gluster3 and gluster4):

gluster volume add-brick testvol gluster3:/glustefs gluster4:/glusterfs

Bricks are added, and you can check with “df” to see they’re added on the fly. Rebalancing data is done by running the commad:

gluster volume rebalance testvol start

Also, the progress can be seen using:

gluster volume rebalance testvol status

GlusterFS remove extended attributes to completely remove bricks

GlusterFS is a distributed filesystem mostly contributed by RedHat.

Anyway, for me not reading the manual first, I thought that deleting a volume will also delete everything with it, and I can create a new volume in the same place as the old one. Wrong! Glusterd is setting some extended attributes to folders in which he creates the distributed filesystem. For that, you’ll need to install a package called “attr”.

Anayway, lets say, in my case, that you created a distributed replicate volume across 2 servers: gluster1, gluster2, and the volume used on both was /glusterfs. The comand you use should be:

gluster volume create testvol replica 2 transport tcp gluster1:/glusterfs gluster2:/glusterfs

In the mean time, you delete it:

gluster volume stop testvol
gluster volume delete testvol

When you try to recreate the volume:

gluster volume create prodvol replica 2 transport tcp gluster1:/glusterfs gluster2:/glusterfs get something like:

/glusterfs or a prefix of it is already part of a volume

That’s why you’ll need to do the following:

apt-get install attr
cd /glusterfs
for i in `attr -lq .`; do   setfattr -x trusted.$i .; done
attr -lq /glusterfs (for testing, the output should pe empty)