Holly/HollyVM Install Log

From Nottinghack Wiki
Revision as of 20:29, 27 February 2012 by Daniel (talk | contribs) (→‎27/02/2012)
Jump to navigation Jump to search

As part of Holly's move to a VM we changed to a Debian squeeze install rather than a Ububtu 10.04 Server
This is a ruff log of all the install and setup tweaks

21/02/2012

hollyvm 1core, 1gb ram, 50gb hdd
Source debian-6.0.4-amd64-netinstall.iso
LVM partitions

  • 10GB root / ext3
  • 38GB home /home ext3
  • 3GB swap

yes that a big swap space for just 1gb of ram--'RepRap' Matt 19:26, 21 February 2012 (EST) tasksel

  • Web Server
  • Mail Server
  • SSH Server
  • Standard Systems Utilities

To install vmware tools
apt-get install build-essential linux-headers-`uname -r`
mount /media/cdrom
tar zxf /media/cdrom/VMwareTools-8.6.0-425873.tar.gz
umount /meida/cdrom
cd vmware-tools-distrib/
./vmware-install.pl
default answers for install

adduser daniel
usermod -a -G sudo daniel

installed custom sshd_config
restarted sshd

apt-get install mysql-server
apt-get install php5-myqsl

22/02/2012

Switching to upstart to support our instrumentation projects snapshot hollyvm
apt-get install upstart

adduser james
usermod -a -G sudo james

add instrumentation with with same uid gid as before
addgroup --gid 1005 instrumentation
adduser --uid 1005 --gid 1005 instrumentation
passwd -l instrumentation

23/02/2012

adding users to adm to view /var/logs
usermod -a -G adm dpslwk
usermod -a -G adm daniel
usermod -a -G adm james

apt-get instal phpmyadmin
added dpslwk user to mysql

copied over apache sites-avalible/{cacti | intranet}
changed webmaster in default{-ssl}
mkdir in instrumentation for sites
a2ensite {cacti | intranet}
/etc/init.d/apache2 reload


apt-get install subversion
apt-get install git
apt-get install libpcap0.8-dev
apt-get install libmysqlclient-dev

Address graphs:
copied macmon source (to be relased) to ~daniel/addr, then ran make

Install mosquitto:
add unstable repo to /etc/apt/sources.list:
deb http://ftp.debian.org/debian unstable main contrib non-free

Create /etc/apt/apt.conf.d/local with:
APT::Default-Release "squeeze";
(so squeeze is always the default)

apt-get update
apt-get install mosquitto
apt-get install libmosquitto0-dev
apt-get install mosquitto-clients

edit mosquitto.conf, add/uncomment:
pid_file /var/run/mosquitto.pid
user instrumentation
log_dest topic
log_dest stdout
log_type error
log_type warning
log_type notice
log_type information
log_timestamp true


build instrumentation stuff:
svn checkout http://nottinghack-instrumentation.googlecode.com/svn/ nottinghack-instrumentation-read-only
make

sftp'd cacti dir from holly
exported cacti db from holly and imported
recreate cacti mysql user
apt-get install rrdtool
TODO cacti cron job
rrd files didn't move nicely so found this http://www.tolaris.com/2010/09/06/rrdtool-this-rrd-was-created-on-other-architecture/
rrddump on holly and rrdrestore on hollyvm
restore use this:-
for i in *.xml; do rrdtool restore -f $i `basename $i .xml` ; done

LSI scsi from vmware causes issues with mpt
/etc/init.d/mpt-statusd stop
update-rc.d-insserv -f mpt-statusd remove

tar'd across /var/www

turns out debian only install vim.tiny by default, which doesn't like my arroyo keys
apt-get install vim

apt-get install ntp
update /etc/ntp.conf to disable debian servers
add uk pool servers
/etc/init.d/ntp restart

24/02/2012

Copy over instrumentation database, and configure the mac address counter.
On holly:
mysqldump -u daniel -p instrumentation > instrumentation.sql

Sftp'd to hollyvm

On hollyvm:
mysql> create database instrumentation;
mysql -u daniel -p instrumentation < instrumentation.sql

Create users:
daniel@hollyvm:~/nottinghack-instrumentation-read-only/db$ mysql instrumentation -u daniel -p < setup.sql

add "/usr/bin/screen -d -m /home/daniel/addr/macmon" to rc.local
copy rrd_addr.pl to ~instrumentation/addr_graphs/
dump RRD file on holly:
daniel@holly:/var/lib/rrd$ rrdtool dump temp0.rrd > temp0.xml

sftp to hollyvm, then restore:
daniel@hollyvm:~$ rrdtool restore temp0.xml temp0.rrd
cp temp0.rrd /home/instrumentation/addr_graphs/

apt-get install librrds-perl

add crontab entry:

  • /5 * * * * instrumentation /home/instrumentation/addr_graphs/rrd_addr.pl >/dev/null

26/02/2012

adding bits to compile arduino code
apt-get install gcc-avr avr-libc avrdude

27/02/2012

apt-get install fetchmail
copy /etc/fetchmailrc to hollyvm

copy upstart config file from /etc/init to hollyvm

copy ~instrumentation/conf/* from holly to hollyvm
mkdir /home/instrumentation/logs

ToDo

Quick list in no order

  • apache sites
  • check php config
    • ini seems fine --'RepRap' Matt 20:03, 25 February 2012 (EST)
    • need to look at users/group for exec of scripts
  • ntp
  • phpmyadmin
  • avr bits
    • compiles --'RepRap' Matt 13:32, 26 February 2012 (EST)
    • will check avrdude program after switch
  • copy mysql db's
    • cacti
    • instrumentaion
  • cacti
    • cacti DB's
  • addr_graphs
  • user instrumentation
    • copy /home/instrumentation
  • user james
  • recompile/install instrumentation
  • check serial to MatrixMQTT

ToDo just before live switch

  • switch mac in Kryten for dhcp ip
  • renew dhcp lease
  • start mosquitto
  • start instrumentaion, macmon, cacti cron job, fetch mail
  • reboot arudino's
  • test gatekeeper!!