small logo

melfneerg.com

 - 'cos life is like that


[Blog]  [Pictures]  [Links]  [About
About the Author
Tudor Davies

author Tudor is a techie turned manager who fights like mad to keep his tech skills honed and relevant. Everything from web hosting, networking, *nix and the like. Constantly developing and co-ordinating with others to make the web a better (and easier to use) place.

pen

Friday, 25th Feb 2011  Posted @ 14:06

After a couple of days off with the kids and missus and a morning of meetings, I thought I would finish off the pen config.

To recap: I have 2 RAQ3 boxes running Centos 4.8 running ucarp (alpha and beta). They also have Webmin installed with most services disabled apart from Denyhosts, mysqld, named, postfix and sshd
Incidentally, I found problems with running named on the carp address, so I added a exec /sbin/service named restart to the vip-up script in /etc/sysconfig/carp/ directory, which fixed it neatly.

I have my PC with its DNS set to the carp address shared between alpha and beta and this fails over nicely, with nary a lookup failure. The next step was to get pen running.

yum install pen
Simple enough. Setting up a simple failover balancer is done thus:
pen 80 -C localhost:19000 www.hostname1.tld:80 www.hostname2.tld:80
This sets up pen listening on port 80 (on all addresses including the carp address) and sends the first (and all subsequent requests from the same host) to www.hostname1.tld. The next (and subsequent) request that comes in from another host will be sent to www.hostname2.tld. I ran that on alpha and then beta as well.

The next step was to point a DNS entry at the carp address, browse to it and see where I ended up. On the first web server. Try it from another host - get the second server.

Then I failed the first pen/carp server (alpha) by pulling its network cable out and used another host workstation to browse to the DNS entry defined above. Yet again, I ended up on the first web server, proving carp had failed over, DNS lookups were still working and that pen was pointing me to a live web server.

If you want, you can then start failing the backend web servers and watch pen mark them as down, sending packets only to the live server. Frankly, it just works and it works well.

Now that I have that configuration nailed down I will be trying pound as that offers reverse proxying as well as load balancing, meaning you can offload some of your web server processing

[ no comments : Add ]

Tweet


carp

Tuesday, 22nd Feb 2011  Posted @ 09:34

So installing CARP was easy enough.

yum install carp -y
The you need to configure the file /etc/sysconfig/carp/vip-001.conf:
#Virtual IP configuration file for UCARP
# The number (from 001 to 255) in the name of the file is the identifier
# $Id: vip-001.conf.example 1527 2004-07-09 15:23:54Z dude $

# Set the same password on all mamchines sharing the same virtual IP
PASSWORD="[your password]"

# You are required to have an IPADDR= line in the configuration file for
# this interface (so no DHCP allowed)
BIND_INTERFACE="eth0"

# Do *NOT* use a main interface for the virtual IP, use an ethX:Y alias
# with the corresponding /etc/sysconfig/network-scripts/ifcfg-ethX:Y file
# already configured and ith ONBOOT=no
VIP_INTERFACE="eth0:0"

# If you have extra options to add, see "ucarp --help" output
# (the lower the "-k " the higher priority and "-P" to become master ASAP)
OPTIONS="-k 128 -P"
You then need to create a /etc/sysconfig/network-scripts/ifcfg-eth0:0 file that contains:
DEVICE=eth0:0
ONBOOT=no
BOOTPROTO=
IPADDR=[the VIP address]
NETMASK=255.255.255.255
USERCTL=yes
IPV6INIT=no
Then you just need the following to finish it all of:
chkconfig --add carp
chkconfig carp on
service carp start
If there are no errors - you are done and can move to the next machine to be part of the failover group.

Then test your failover. For me, I lost 1 ping during the swapover between boxes.

Next up - configuring pen for HTTP and DNS load balancing :)

[ no comments : Add ]

Tweet


Damn them...

Tuesday, 22nd Feb 2011  Posted @ 08:32

Well that was a bust.

Got everything installed but it doesnt want to play nicely, so I shall instead write my own php script around pen (which was what Zen was doing). I suspect the issue being such an old version of CentOS (4.4) which is pretty much the most a RAQ3 can run.

Ho-hum - back to the drawing board...

[ no comments : Add ]

Tweet


Load balancers

Monday, 21st Feb 2011  Posted @ 15:09

After having replaced my RAQ3s with a newer (and supremely more powerful (though still lowly) server), the question came to mind as to what to do with them.

In the interests of some work I am doing (at work) and my own personal interest, I am turning them into an HA pair of load balancers using Zen and ucarp.

This meant removing Virtualmin, which is easily done using the

sh install.sh --uninstall
Now they are plain, vanilla Centos 4.4 boxen.
Firstly, I added RPMForge to their repositories and started installing software that was required:
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el4.rf.i386.rpm
rpm -Uhv rpmforge-release-0.5.1-1.el4.rf.i386.rpm
yum install rrdtool
yum install pen
Thats everything "application" wise, so now we just need a load of Perl modules.
Install the CPAN bundle:
perl -MCPAN -e shell
install Bundle::CPAN
Once that has completed, you need to install the following modules:
CGI
Data::Validate::IP
File::Grep
GD
GD::3DBarGrapher
IO::Interface
IO::Socket
Network::IPv4Addr
Proc::Daemon
RRD::Simple
Tie::File
Sys::Hostname

So thats all the dependencies for Zen and ucarp installed, now to install the actual applications. Follow the instructions regarding Zen from here and the ucarp instructions from here
Then configure some services and start testing.

I will update this post as things crop up (if anything needs changing during the install/configure process) and there will be another post when I get round to stress testing them using ab (Apache Bench)

[ no comments : Add ]

Tweet


The Best Trance in the World

Saturday, 19th Feb 2011  Posted @ 22:44

I found a posting on a trance forum listing the results of a poll listing the top trance tracks EVAR! Anyway, I thought I would reproduce here and also make it a feature on my video blog over at auralfellation in the coming months, doing a complete countdown. Anyway, here it is for your commenting pleasure:

sasha - xpander
energy 52 - café del mar
dj tiesto - suburban train (original, cosmic gate mix)
paul van dyk - for an angel (original, deviant mix)
delerium - silence (original, dj tiesto, fades sanctuary mix)
gouryella - gouryella (original, tsnuami mix)
rank 1 - airwave (original, dj tiesto mix)
three drives - greece 2000 (original, g&m project mix)
push - universal nation (2000 remake, the anthem, club mix)
veracocha - carte blanche
cass & slide - perception (original, vocal, new vocal mix)
chicane - saltwater
thrillseekers - synaesthesia (en-motion mix)
samuel barber - adagio for strings (william orbit, ferry corsten, dj tiesto mix)
solar stone - solarcoaster (original, midway mix)
yahel - voyage
solar stone - seven cities (original, v-ones living cities mix)
binary finary - 1998
system f - out of the blue
bt - flaming june (original, bt, pvd mix)
bedrock - heaven scent
push - strange world 2000 remake
jose amnesia - the eternal (original, pulser mix)
paul oakenfold - southern sun (dj tiesto mix)
lost tribe - gamemaster
armin van buuren - communication
m.i.k.e. - sunrise at palamos
orbital - halcyon + on + on (original, chicane mix)
gouryella - walhalla
nu-nrg - dreamland
armin van buuren - burned with desire
robert miles - children (original, tilts courtyard mix)
dumonde - never look back (original, dj tiesto mix)
salt tank - eugina (michael woods mix)
hybrid - finished symphony
motorcycle - as the rush comes
gouryella - tenshi
andain - beautiful things (original, gabriel & dresden mix)
holden & thompson - nothing (93 returning mix)
underworld - born slippy
oceanlab - satellite (above & beyond mix)
plastic boy - silver bath
solar stone - 3rd earth
paul van dyk - nothing but you
sasha - wavy gravy
way out west - mindcircus (gabriel & dresden mix)
paul van dyk - crush (original, radio edit)
dj tiesto - sparkles (original, airscape mix)
dj tiesto - in my memory (original, airwave, v-one mix)
pulsar - cloudwalking
dj tiesto - traffic
push - the legacy
age of love - age of love
chicane - autumn tactics (thrillseekers club mix)
humate - love stimulation (original, paul van dyk love club, bedrocks ambient mix)
paul van dyk - words
saltwater - the legacy (original, alphazone mix)
coast coast - home
sander kleinenberg - my lexicon
delerium - innocente (original, dj tiesto mix)
bt - namistai
moogwai - viola (armin van buuren mix)
rapid eye - circa forever
dj tiesto - flight 643
second sun - empire
bt - mercury & solace (original, bt 12" master mix)
gouryella - ligaya
ralphie b - massive
tillman uhrmacher - on the run (ocean to shore mix)
paul van dyk - out there and back
polar stone - speak in sympathy
billy ray martin - honey (original, chicane club mix)
blank & jones - cream (paul van dyk mix)
cloud 69 - sixty nine ways
signum - second wave
bt - dreaming (original, libra mix)
future sound of london - papua new guinea
kamaya painters - endless wave (original, albion mix)
new order - confusion (original mix)
ppk - resurrection
utah saints - lost vagueness (oliver lieb vocal mix)
cygnus x - superstring (original, rank1 mix)
gtr - mistral
mesh - purple haze
pqm - you are sleeping (original. luke chable vocal pass)
james holden - a break in the clouds
underworld - cowgirl
underworld - dark & long (original, dark train mix)
binary finary - 1999
delerium - after all (original, svenson & gielen mix)
system f - solstice
altitude - altitude (s.h.o.k.k. mix)
nalin & kane - open your eyes
aria - dido (armin van buurens universal religion mix)
solid globe - north pole
ascension - someone
cygnus x - the orange theme (original, moonman mix)
james holden - horizons (original, way out west mix)
push - til we meet again
insigma - open your eyes (original insigma mix)
vengaboys - kiss (airscape mix)
faithless - insomnia
prodigy - breathe
dj tiesto - magik journey
agnelli & nelson - everyday (lange, alex gold, original mix)
ferry corsten - punk (original, kid vicious mix)
paul van dyk - forbidden fruit
hallucinogen - lsd
hydra - affinity
ayla - ayla
chicane - dont give up (original, disco citizens vs tomski mix)
solar factor - urban shakedown
tilt - i dream
mauro picotto - lizard
solid globe - sahara
strings - into the night
afterburn - northpole
agnelli & nelson - holding on to nothing
iio - rapture (riva, armin van buuren mix)
crystal method - trip like i do
johnny shaker - pearl river
jan johnston - flesh (original, dj tiesto mix)
art of trance - madagascar
darren tate vs jono grant - let the light shine in
fire & ice - lost emotions
sasha & emerson - scorchio
li kwan - point zero
paul van dyk - another way
solid sessions - janeiro (armin van buuren mix)
plastic boy - live another life
tony walker - field of joy
bt - force of gravity (original, ferry corsten bootleg mix)
fictivision vs c-quence - symbols (original mix)
jam & spoon - stella
john vesta - gull
nitromethane - time to die (original, seraque mix)
sasha - belfunk
bt - remember
paul van dyk - avenue
transa - supernova
astral projection - anything is possible
astral projection - mahadeva
bt - giving up the ghost
leama - requiem for a dream (leamas dream mix)
members of mayday - 10 in 01
timo maas - der scheiber (original, rapid eye mix)
conjure one - tears from the moon
riva - stringer
safri duo - played-a-live
kamaya painters - far from over
marco v - simulated
midway - monkey forest
ratty - sunrise
signum - solar level
system f - exhale
aphex twin - girl/boy song
armin van buuren - yet another day
luke chable & danny bonnici - ride
pulser - my religion
s.o. project - direct dizko
the generator - where are you now? (moonman mix)
jeff mills - the bells
layo & bushwacka - love story
probspot - foreplay
rui da silva - touch me
starkid - crayons
dj tiesto - theme from norefjell (dj jan & christophe chantzis mix)
ferry corsten - sublime
sasha - rabbitweed
three drives - sunset in ibiza
transa - enervate
above & beyond - no one on earth
airwave - when things go wrong
albion - air (original, oliver lieb mix)
atlantis vs avatar - fiji
bt - godspeed
darude - sandstorm
dj scotty vs full gainer - everything i do (original, hardcore mix)
ferry corsten - rock your body rock (original, f. massif mix)
filo and peri presents whirlpool - under the sun (solarstone mix)
fire & ice - souvenir de chine
fragma - miracle
g&m project - sunday afternoon
junkie xl - future in computer hell
marco v - loops & things relooped
moby - why does my heart feel so bad
prodigy - voodoo people
pulp victim - the world 99
ullrich schnauss - nobodys home
armin van buuren - blue fear
astura - orions belt
binary finary - 2000
c m - dream universe
dj tiesto - nyana
faithless - salva mea
floyd - come together
junk project - control 1999
m.o.r.p.h - maximum overdrive (benicio mix)
man with no name - floor essence
oliver lieb - subraumstimulation
paul van dyk - connected
prodigy - no good
rio klein - fearless (original, push, a&g mix)
space brothers - legacy
warrior - if you want me
york - reachers of civilization (rank1 mix)
airwave vs rising star - sunspot
dj tiesto - walking on clouds
green martian - wizardry
gus gus - purple (sasha vs the light mix)
lost witness - happiness happening
orbital - belfast
rank 1 - such is life
rank 1 - symsonic
airwave - alone in the dark
cern - the message (northern mix)
fictivision vs phynn - escape (phynn mix)

[ no comments : Add ]

Tweet


mySQL maintenance

Monday, 14th Feb 2011  Posted @ 11:43

Sometimes it becomes necessary to ensure that your databases (and indeed db server) are operating "efficiently".

To this, I regularly use the following to make sure everything is in tip top order:

mysqltuner.pl - check the config and performance of your mysql server. It offers suggestions on performance tweaks to make to your /etc/my.conf and how well it is performing.

mytop - top for mySQL databases, you can see the activity on a particular database.

Optimize only fragmented tables in MySQL - make this into a script and run it when mysqltuner warns you that a database or more need optimising

Its also a good idea to back up your databases. I found a script years ago that does just that and its produced below:

#!/bin/sh
#

for I in `echo "show databases;" | mysql -u [id] -p[password] | grep -v Database`;
do mysqldump -u [id] -p[password] $I | gzip > "$I.sql.gz"; done
Basically, it lists all the databases you have access to and then dumps the database for a zipped file.

On my system, I then include these file in the backup schedule (run on all machines) which backup to one of the FreeNAS shares (mounted over NFS).

[ no comments : Add ]

Tweet


DenyHosts

Wednesday, 9th Feb 2011  Posted @ 20:09

Using Linux?
Are you the subject of SSH brute force attacks?

I have been for some time, so I installed DenyHosts on all my boxes, like this:

wget http://packages.sw.be/denyhosts/denyhosts-2.6-3.el5.rf.noarch.rpm
rpm -i denyhosts-2.6-3.el5.rf.noarch.rpm
chkconfig denyhosts on
edit your /etc/denyhosts/denyhosts.cfg
then
service denyhosts start
I have mine emailing me when it adds a new host to the /etc/hosts.deny file, so that I can check it occasionally.

Note: These instructions are specifically for RedHat & CentOS 5 installations

[ no comments : Add ]

Tweet


Gallery

Wednesday, 9th Feb 2011  Posted @ 15:44

Added the first pictures into the Gallery. Nothing very interesting.

First picture (from top down):
Vanilla Box - Dev server
Cisco 2924XL - 10/100 Ethernet Switch
Firewall

Second picture (from top down):
Compaq DL360 G3 - Web server
Dell PowerEdge 1750 - Mail/Web server
Dell PowerEdge 750 - LDAP/SQL server
TP-Link GigE switch
Maxtor MaxAttach 4300 - FreeNAS server
Compaq MSA30 SCSI Array - additional FreeNAS storage

Thats my complete hosting/server environment. The dev server has replaced the Cobalt RAQ3 that was there as my newer code was just taking too long to process - Celeron 2.4GHz, 1.25Gb RAM, 40Gb ATA/133 vs AMD K6-350, .5Gb RAM, 10Gb ATA/33 - a definite improvement :)

[ no comments : Add ]

Tweet


Ooh!

Monday, 7th Feb 2011  Posted @ 10:14

So I recovered my old server from the garage in order to remove the 120Gb drives from it.

Opened it up and found a 200Gb and a 250Gb. Brilliant.

Although now I have no idea where the 120Gb drives have gone! Ho-hum!

In other news, I have done a redesign. Quicker and cleaner I reckon. Let me know what you think.

[ no comments : Add ]

Tweet


RAQ3

Monday, 24th Jan 2011  Posted @ 11:02

So I reinstalled CentOS on alpha last night and currently it is installing virtualmin and webmin, following a "yum upgrade"...

However, there were a few kernel panics while starting up this morning and I have had a sequence of kernel panics, segmentation faults and such like since it first booted correctly.

This will be down to either memory or hard disk. The hard disk is an ancient 20gb and it may be time to replace it. But with what? It doesnt support anything larger than 127Gb, so I may have to dismantle my ancient NASLite+ box (which I stopped using a few years back) and steal disk from there. Which may end up with me replacing all the 40Gb drives I have in various boxen with the 120s (as there are 4 I think!)

In other news, installed CentOS 5.5 on a Tyan S2098 (Tomcat i845GL) but have been having terrible issues with the network cards. They are Intel but not had any joy getting them to negotiate with my Netgear router. But that could be down to the router being shite of course... I shall grab on of my other switches and see what it makes of it all (cos then I wont be swearing quite so loudly while the missus is trying to watch TV!)

[ no comments : Add ]

Tweet




layout and initial css based on the Qtractor page