/autolab-2013

Autolab toolkit version 2013

Primary LanguageShell

Copyleft by: Guan Xuetao <xuetao.guan@qq.com>

Attention:
	* All commands assume root permission
	* Avoid modifying code in /opt/autolab-2013, but in /raid/share/autolab-2013
	* All daemons are run in clustermanager, include nfs/dhcpd/dns

-----------------------------
For all hosts:
-----------------------------
1. Config network
	check /etc/host.conf, with: order hosts, bind
	Edit /etc/hosts, add:
		128.2.220.30  sandshark.ics.cs.cmu.edu        sandshark
		128.2.220.31  sawshark.ics.cs.cmu.edu         sawshark

2. Create autolab-2013:
	cd /opt
	git clone /raid/share/autolab-2013.git
	cd autolab-2013
	source autolab.sh
	make dist_init
	make install_rpyc
	make install_tashi

3. Python 2.7.4 (Released April 6 2013)
	wget http://www.python.org/ftp/python/2.7.4/Python-2.7.4.tar.xz .
	tar xfJ Python-2.7.4.tar.xz
	./configure
	make
	make install
	NOTE: Python 2.7.4 will be installed on /usr/local/

-----------------------------
For ClusterManager:
-----------------------------
0. Config network
	edit /etc/sysconfig/network-script/ifcfg-em2 with static ip addr
	ifconfig em2 192.168.2.31 up

1. Create nfs:
	nfs root: /raid/shared
	softlink: /raid/share		to simplify script
	subdirs:
		autolab-2013.git	the repo
		autolab-2013		the working tree
		backup			backup dir
		images			to store image files
	edit /etc/exports (should be empty by default)
		/raid/shared 128.2.220.0/24(rw,no_root_squash,async)
	enable nfs daemon
		mv K60nfs S60nfs	in rc5.d (check inittab for run level)
		service nfs start

2. Config Dns
	install dameons			not installed by default
		yum install bind
	create key
		cd /var/named
		dnssec-keygen -a HMAC-MD5 -b 128 -n HOST sawshark
		chown named /var/named/K*
	update key section in named.conf
	allow named read /etc/rndc.key (???)
	copy net-configs/named.conf-zone to named.conf, and change correspondingly
	change options section in named.conf
		listen-on port 53 { 192.168.2.31; };
		allow-query     { localhost; 192.168.2.0/24; };
	init dns db config
		make cm_dnsinit
	enable dns daemon
		chmod g+w /var/named
		mv K83named S83named	in rc5.d
		service named start

3. Config Dhcp
	install dameons			not installed by default
		yum install dhcp
	copy net-configs/dhcpd.conf to /etc/dhcp/ dir
	add dhcpd user (Warning: uid 177 is not unique)
		useradd --system --gid dhcpd --home / --shell /sbin/nologin --comment "DHCP server" dhcpd
	check /var/lib/dhcpd permission (or change /etc/init.d/dhcpd)
		chown dhcpd:dhcpd -R /var/lib/dhcpd
	enable dhcp daemon
		mv K35dhcpd S35dhcpd
		service dhcpd start

-----------------------------
For NodeManagers:
-----------------------------
1. Get nfs:
	nfs root: /raid/share
	edit fstab
		sawshark.ics.cs.cmu.edu:/raid/shared	/raid/share	nfs	rw	0 0
	manually mount:
		mount sawshark.ics.cs.cmu.edu:/raid/shared /raid/share

2. Create qemu
	make install_qemu
	make node_qemuinit

3. Network environmnt
	make node_netinit
	ifconfig br2013 192.168.2.xx up