Diff for "zeouter"

Differences between revisions 20 and 21

Deletions are marked like this. Additions are marked like this.
Line 226: Line 226:

==== Admin Night ====

===== MySQL =====
 * Shutdown Apache on Caro
 * Shutdown MySQL (/flexo-VM-02 at the time)
 * Du -sh to get size
 * Copy across
 * Start up MySQL (on Wally VM-02)

Gavin Fitzgerald

  • Studies Computer Systems (UL)

  • Committee Member : Nov '08 - May '10

  • Skycon '09 Committee Member

Procfilter Steps
  • Changed to mailconfig/zeouter cd mailconfig/zeouter

  • Renamed .forward to .forwarddisabled mv .forward .forwarddisabled

  • Opened vi, instructing it to create .procmailrc vi .procmailrc

  • Entered

TH=/bin:/usr/bin:/usr/bin
MAILDIR=/var/mail/zeouter   
LOGFILE=/home/zeouter/procmail.log
SHELL=/bin/bash
#
:0 c
!myEmail@gmail.com
#
:0 c:
* ^From: .*myStudentmail@studentmail.ul.ie
.ULEmail/
  • Saved and quit vi :wq

  • Tested twice and subscribed to 'ULEmail' folder

Admin Night One
Screen
  • Screen -DR > -rd, allows you to autologout screens being used elsewhere

  • Ctrl-a + w, shows what windows are open

  • Ctrl-a + c, new screen

  • Ctrl-a + 0 to 9, select which screen to open

  • Ctrl-a, Shift-a, Name a Screen

Pine
  • Ctrl-w, Search mail

Resource Checking
  • top, Task Manager

  • cat /proc/cpuinfo, Get list & info on cpus

  • cat /proc/mdstat, Get info on running harddrives

  • df -h, Get harddrive usage

Admin Night Two
Proxy
  • Open Putty

  • Go to Connection/SSH/Tunnels

  • Input 3128 into source port

  • Input proxy.skynet.ie:3128 into Destination

  • Click "add"

  • Connect to Skynet as normal

  • Don't forget to change your LAN Connection settings in your browser'

Admin Night Four
Apache2
Apache2 Setup & Config
  • apt-get install apache2

  • aptitude apache2

Config & Logs
  • Configs: /etc/apache2/

  • Logs: /var/log/apache3/

  • Webroot: /var/www/site1 - This would allow ip-address access so we prefer

    • /srv/site1

  • See the last 30 lines of a file:

    • tail -n 100 /var/log/apache3/httd/error.log

Setup www.site1.com

Put in

  • /etc/apache2/sites-available/site1.com

  • /etc/apache2/sites-enabled/ - Remove from here to disable site

  • ln -s /etc/apache2/sites-available/site1.com /etc/apache2/site-enabled/

a2en

#://a2ensite

  • /etc/apache2/mods-available/userdir.conf

  • ln -s /etc/apache2/mods-available/userdir.conf /etc/apache2/mods-enabled/

#://a2enmod

Stop & Start Apache
  • /etc/init.d/apache2 start

  • /etc/init.d/apache2 stop

Installing Python for Apache
  • apt-cache search python | grep apache

Xen

Talked about

  • legacy of Xen & Skynet

  • Xen vs KVM

Usage
  • xm list

    • List of running vms

  • xm top

  • xm shutdown vm-name

    • Check afterwards if shutdown was successful using list

  • xm destroy vm-name

    • Pulls the plug

  • xm console vm-name

    • Terminal for the vm ctrl + to quit

  • cd /etc/xen/

  • xm create -C vm01.cfg

    • Starts vm w/ console

  • etc/xen/vm01.cfg

    • Create & edit config file for vm01

  • ln -s /etc/xen/vm01.cfg /etc/xen/auto

    • SybLink config so that it auto starts

Install

wiki.debian.org/Xen - Good resource

  • aptitude -P install xen-linux-system

  • Grub1 /boot/grub/menu.lst

  • Grub2 /etc/default/grub

  • reboot

Manual Creation of a VM
  • lvscan - Current VMs

  • pvscan - Available physical memory & volume groups

  • lvcreate -n name-disk1 --size 10g vg1

    • Creating name-disk1 in volume group 1 with 10gb

  • lvcreate -n name-swap --size 512m vg1

  • mkfs ext3 /dev/vg1/name-disk1

  • mkswap /dev/vg1/name-swap

  • mount /dev/vg1/name-disk1 /mnt

  • debootstrap --arch amd64 squeeze /mnt

  • umount /mnt

  • /etc/xen/vm01.cfg

    • vcpus = '4' memory = '512' root = /dev/xvda disk = /dev/vg1/name-disk1 name = vm01

Automatic Creation of VM
  • apt-get install xen-tools

  • vi /etc/xen-tools/xen-tools.conf

  • xen-create-image --hostname eve-01 --ip 193.1.99.100

  • xen-delete-image eve-01

Migration Xen
  • On new dom0 Make changes, set the right size disk

    • vi /etc/xen-tools/xen-tools.con

  • On new dom0 Pick a free IP, and create VM

    • xen-create-image --hostname eve-vm04 --ip 193.1.99.93 --vcpus 2

  • On the new dom0 Xen server: Set netcat to listen and point to the correct disk

    • nc -l -p 7000 | dd of=/dev/vg1/eve-vm04-disk bs=2M

  • On the old dom0 do the following. Point to new dom0 IP

    • dd if=/dev/mapper/flexo-vm04 bs=2M | nc 193.1.99.98 -q 10 7000

  • On flexo-vm04

    • Ensure menu.lst values are correct & match the latest in /boot

mount /dev/vg1/eve-vm04-disk /mnt/
mkdir /mnt/boot/grub
vi /mnt/boot/grub/menu.lst

default         0
timeout         2

title           Debian GNU/Linux 6.0
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.32-5-xen-686 root=/dev/xvda2 console=hvc0 xencons=tty ro
initrd          /boot/initrd.img-2.6.32-5-xen-686

title           Debian GNU/Linux 6.0 (Single-User)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.32-5-xen-686 root=/dev/xvda2 ro single
initrd          /boot/initrd.img-2.6.32-5-xen-686

vi /mnt/etc/securetty
#make sure the following is there
hvc0
vi /mnt/etc/inittab
#make sure the following is there
co:2345:respawn:/sbin/getty 38400 hvc0

umount /mnt/

vi /etc/xen/eve-vm04.cfg
#Change IP to be correct

ln -s /etc/xen/eve-vm04.cfg /etc/xen/auto/

xm create -c /etc/xen/walle-vm04.cfg
Issues Encountered With Xen
  • If an error occurs during vm creation/deletion, the logical volume may still be created and mounted.

  • This must be unmoumnted from its location

    • umount /dev/vg1/eve-vm05-disk

  • Then removed

    • lvremove /dev/vg1/eve-vm05-disk

  • LSOF failed to show any process using the drive

  • As did Device-Mapper

    • dmsetup remove --force /dev/vg1/eve-vm05-disk

Admin Night
MySQL
  • Shutdown Apache on Caro

  • Shutdown MySQL (/flexo-VM-02 at the time)

  • Du -sh to get size

  • Copy across

  • Start up MySQL (on Wally VM-02)

last edited 2012-04-26 19:31:04 by 10