Tuesday, November 4, 2014

DRBD: Wrong medium type while trying to determine filesystem size

If you encounter the following error when trying to format a DRBD device:
mke2fs 1.41.12 (17-May-2010)  
mkfs.ext4: Wrong medium type while trying to determine filesystem size
The node you are executing the command on is configured as Secondary instead of Primary, verify this by running the following command:
drbdadm role <resource>
If you see:
Secondary/Primary
It means that the node you ran the command on is Secondary, to fix it run the following command on the current node(primary):
drbdadm primary <resource>

Sunday, November 2, 2014

Install MediaWiki on CentOS 6

1. Install the following dependencies:
yum install ImageMagick gd texinfo texinfo-tex texlive httpd php php-xml php-pdo php-intl php-pecl-apc php-pecl-memcache
2. Download the latest version of Mediawiki:
cd /var/www/html
wget http://releases.wikimedia.org/mediawiki/1.23/mediawiki-1.23.6.tar.gz
3. Extract the tar file and change the ownership:
tar xvf mediawiki-1.23.6.tar.gz
mv mediawiki-1.23.6 mediawiki
chown apache:apache -R mediawiki
4. Restart Apache and configure mediawiki using the installation:
service httpd restart
mkdir /var/lib/mediawiki
chown apache:apache -R /var/lib/mediawiki
http:/1.1.1.1/mediawiki (set the SQLite data directory to /var/lib/mediawiki)
5. Use the new LocalSettings.php
cd /root/Downloads/
mv LocalSettings.php /var/www/html/mediawiki

Saturday, November 1, 2014

MediaWiki: blank page when trying to install on CentOS 6

If you encounter a blank page on the installation of MediaWiki, please make sure you've installed the following packages:
yum install php php-xml -y

Install Corosync, Pacemaker and Crmsh on CentOS 6

1. Create a temporary directory to hold a few rpms:
mkdir /tmp/ha
cd /tmp/ha
2. Install Corosync and Pacemaker:
yum install pacemaker corosync -y
3. Download crmsh and pssh:
yum install wget -y 
wget http://download.opensuse.org/repositories/network:/ha-clustering:/Stable/CentOS_CentOS-6/src/crmsh-2.1-1.6.src.rpm 
wget http://download.opensuse.org/repositories/network:/ha-clustering:/Stable/CentOS_CentOS-6/src/pssh-2.3.1-4.1.src.rpm
4. Build the RPMS:
yum install python-devel python-setuptools gcc make gcc-c++ rpm-build python-lxml cluster-glue-libs-devel pacemaker-libs-devel asciidoc autoconf automake redhat-rpm-config -y
rpmbuild --rebuild crmsh-2.1-1.6.src.rpm
rpmbuild --rebuild pssh-2.3.1-4.1.src.rpm
5. Install the newly created RPMS:
yum install /root/rpmbuild/RPMS/x86_64/*

Friday, October 31, 2014

Install Realtek RTL8188CE on CentOS 6

Since CentOS doesn't have suitable firmware and drivers for Realtek wireless cards, one needs to be installed.
1. Install ELRepo:
yum install http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm -y
2. Install kmod realtek firmware:
yum install *8192ce* -y
3. reboot the machine.

Wednesday, October 29, 2014

Adding directories to man path

To add a custom path to man(say you compiled an application in /usr/local/), all you have to do is edit the following file:
/etc/man.config
And edit the following:
MANPATH /usr/local/ha/share/man
To update the database immediately:
makewhatis -v  /usr/local/ha/share/man

No module named crmsh

If you encounter the following error while trying to compile crmsh:
crmFatal error:No module named crmshNo module named modules 
Failed to start the crm shell! This is likely due toa broken installation or a missing dependency. 
If you are using a packaged version of the crm shell,please try reinstalling the package. Also check yourPYTHONPATH and make sure that the crmsh module isreachable.
Please make sure that:
1. In case you've compiled crms in /usr/local, make sure to link the folders inside:
/usr/local/ha/lib64/python2.6/site-packages/
to
/usr/lib64/python2.6/site-packages/
by using the command:
ln -s /usr/local/ha/lib64/python2.6/site-packages/* /usr/lib64/python2.6/site-packages/
2. Make sure to install the following dependencies:
yum install *lxml* *PyYAML* -y