Friday, August 19, 2011

DRBD on RHEL6 with YUM group

Building DRBD for 2.6.32-71.el6.x86_64 kernel

1.mkdir -p /root/rpmbuild/SOURCES/


3.cp drbd-8.3.10.tar.gz /root/rpmbuild/SOURCES/

4.tar -xvf drbd-8.3.10.tar.gz drbd-8.3.10

6../configure --with-km --with-distro=redhat --enable-spec

7.rpmbuild -bb drbd.spec

8.rpmbuild -bb drbd-km.spec /root/rpmbuild/RPMS/x86_64

10.mkdir /YUM/DiskReplicator

11.cp drbd-* /YUM/DiskReplicator/ /YUM/DiskReplicator/

13.createrepo . ---> The "." is important /etc/yum.repos.d/rhel6-1.repo

name=rhel6-1 LoadBalancer repo
gpgcheck=0 /tmp/ -->To avoid rpm name clash

16.yum install yum-utils

17.yum-groups-manager -n "Disk Replicator" --id=drbd --description="DRBD, packages from ANSIL" --save=comps.xml --mandatory drbd.x86_64 --mandatory drbd-bash-completion.x86_64 --mandatory drbd-heartbeat.x86_64 --mandatory drbd-km-2.6.32_71.el6.x86_64.x86_64 --mandatory drbd-pacemaker.x86_64 --mandatory drbd-udev.x86_64 --mandatory drbd-utils.x86_64 --mandatory drbd-xen.x86_64

18.createrepo -g comps.xml /YUM/DiskReplicator/

19.yum grouplist "Disk Replicator"

20.yum groupinstall "Disk Replicator"

Monday, August 15, 2011

How to Configure YUM in RHEL6

Easy way to create your own repo
1. Put your RHEL6 media on DVD drive
2. Create a partition with size 6GB and mount it as /yum
3. Download the below script to /yum
4. Give execute permission to the downloaded script
5. Please open the file and try to understand it. If you found all safe ,then go to next step
6. Execute it...You will get an RHEL repo accessible through ftp

***Please feel free to comment your experience ***


Manual Steps (*Different approach from above script .The repo file not look like usual one)

YouTube Link :
1.create a directory to store packages .(Better you create a partition with 5GB size and mount it as /YUM)
mkdir /YUM
2.mount RHEL6 DVD
mount /dev/dvd /mnt
3.go to the mounted directory
cd /mnt/Packages/
4.copy all contents of DVD to /YUM (Note the "." in command )
cp . /YUM/
5.Install createrepo package with dependancies
rpm -ivh deltarpm-**.el6.x86_64.rpm python-deltarpm-**.el6.x86_64.rpm createrepo-**.rpm
6.install FTP server
rpm -ivh vsftpd-2.2.2-6.el6.x86_64.rpm
7.Create repository using
createrepo -g /YUM/HighAvailability/repodata/****-comps-rhel6-HighAvailability.xml –o \
/YUM/HighAvailability/ /YUM/Packages/

createrepo -g /YUM/LoadBalancer/repodata/*****-comps-rhel6-LoadBalancer.xml –o \
 /YUM/LoadBalancer/ /YUM/Packages/

createrepo -g /YUM/ResilientStorage/repodata/****-comps-rhel6-ResilientStorage.xml –o  \
 /YUM/ResilientStorage/ /YUM/Packages/

createrepo -g /YUM/ScalableFileSystem/repodata/****-comps-rhel6-ScalableFileSystem.xml –o \
 /YUM/ScalableFileSystem/ /YUM/Packages/

createrepo -g /YUM/Server/repodata/****-comps-rhel6-Server.xml -o /YUM/Server/ /YUM/Packages/
8.Create a repo file in /etc/yum.repos.d/

The Server id contains the main path to the packages.(bold in [Server] baseurl )

vi /etc/yum.repos.d/rhel6-1.repo
name=rhel6-1 Server repo
name=rhel6-1 HighAvailability repo
name=rhel6-1 ScalableFileSystem repo
name=rhel6-1 ResilientStorage repo
name=rhel6-1 LoadBalancer repo
9.Edit ftp server configuration file to make /YUM as anonymous root
vi /etc/vsftpd/vsftpd.conf 
10.Restart ftp service
service vsftpd restart
11.Add a rule in iptables to accept ftp connections in /etc/sysconfig/iptables
vi /etc/sysconfig/iptables
-A INPUT -p tcp -s --dport 21 -i eth0 -j ACCEPT

12.Add ip_conntrack_ftp module in /etc/sysconfig/iptables-config which is needs to be added for FTP support[ip_nat_ftp]

vi /etc/sysconfig/iptables-config
service iptables restart
13.Install the following packages[both clients and server need these packages] to transfer files
You need to install it from DVD
Follow step 2 and 3 and then
rpm -ivh libedit-2.11-4.20080712cvs.1.el6.x86_64 openssh-clients-5.3p1-20.el6.x86_64 ftp-0.17-51.1.el6.x86_64.rpm
14.transfer yum configuraion files to clients

scp /etc/yum.repos.d/rhel6-1.repo *.*.*.*:/etc/yum.repos.d/
15.Check yum configuratoin

yum grouplist will give you these ouputs

Installed Groups:
E-mail server
FTP server
Available Groups:
Additional Development
Afrikaans Support


Enjoy RHEL6 Package Management

I've made a video for easy understanding

LVM thin provisioning - file system usage and pool usage dosn't match

When I was demonstrating LVM thin provisioning to new batch of campus hires ; they pointed out an important mismatch between thin pool usag...