Getting High With Lenny - Page 6

Want to support HowtoForge? Become a subscriber!
 
Submitted by randall (Contact Author) (Forums) on Tue, 2009-02-17 11:46. ::

Create a Vserver

Note that we already have mounted the LVM partition on /VSERVERS/web in an earlier step, we're going to place both the /var and /etc directories on the mountpoint and symlink to it, this way the complete Vserver and its config are available on the other node when mounted.

mkdir -p /VSERVERS/web/etc

mkdir -p /VSERVERS/web/barrier/var

When making the Vserver it will be in the default location /var/lib/vservers/web and its config in /etc/vservers/web.

newvserver --hostname web --domain example.com --ip 123.123.123.125/24 --dist etch --mirror http://123.123.123.81:3142/debian.apt-get.eu/debian --interface eth0

enter the root password

Create a normal user account now? <-- no

Choose software to install: <-- ok

On node1 we move the Vserver directories to the LVM volume on the DRBD disks and make symlinks from the normal locations. On node1:

mv /etc/vservers/web/* /VSERVERS/web/etc/

rmdir /etc/vservers/web/

ln -s /VSERVERS/web/etc /etc/vservers/web

mv /var/lib/vservers/web/* /VSERVERS/web/barrier/var

rmdir /var/lib/vservers/web/

ln -s /VSERVERS/web/barrier/var /var/lib/vservers/web

We need to set the same symlinks on node2, but the we need the Vserver directories available there first. The mounting should be handled by heartbeat by now so we make our resources move to the other machine. On node1:

/etc/init.d/heartbeat stop

On node2:

ln -s /VSERVERS/web/etc /etc/vservers/web

ln -s /VSERVERS/web/barrier/var /var/lib/vservers/web

On node1:

/etc/init.d/heartbeat start

Vserver web start

and enjoy!


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.