Getting High With Lenny - Page 6

On this page

  1. Create a Vserver

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 --ip --dist etch --mirror --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!

Share this page:

0 Comment(s)