Jumat, 17 Desember 2021

Kickstart-Server CentOS 7.9_x86_64 For Apache Hadoop®

A. Prepare Kickstart Server environment

 1. Install all the required packages through yum

     yum install syslinux xinetd tftp-server dhcp httpd deltarpm python-deltarpm createrepo yum-utils

2. Create folder/directory and copy pxelinux.0

     mkdir /var/lib/tftpboot/pxelinux.cfg
     mkdir /var/lib/tftpboot/centos7
 
     cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/

3. Open the xinetd settings to enable tftp server
    vi /etc/xinetd.d/tftp
   # at line 14 change the parameter from yes to no.
        Disable=no

4. Restart the service to apply the settings made
    systemctl restart xinetd 

5. Set the service to start with each subsequent system reboots
    systemctl enable xinetd

6. Open the file and configure edit the DHCP Server
    vi /etc/dhcp/dhcpd.conf

#### vi /etc/dhcp/dhcpd.conf ###
Allow booting;
Allow bootp;
authoritative;
### Subnet definition hostname kickstart  server ###
ddns-update-style interim;
subnet 192.168.111.0 netmask 255.255.255.0 {
range dynamic-bootp 192.168.111.30 192.168.111.130;
option broadcast-address 192.168.111.255;
option routers 192.168.111.2;
filename "pxelinux.0";
next-server 192.168.111.80;
#use-host-decl-names on;
}
#### Client Node ###
host master01.kopi.com {
hardware ethernet 00:0C:29:33:9A:F2;
fixed-address 192.168.111.81;
option subnet-mask 255.255.255.0;
option routers 192.168.111.2;
option host-name "master01.kopi.com";
filename "pxelinux.0";
}
host master02.kopi.com {
hardware ethernet 00:0C:29:B0:74:AB;
fixed-address 192.168.111.82;
option subnet-mask 255.255.255.0;
option routers 192.168.111.2;
option host-name "master02.kopi.com";
filename "pxelinux.0";
}
host worker01.kopi.com {
hardware ethernet 00:0C:29:58:E8:B8;
fixed-address 192.168.111.83;
option subnet-mask 255.255.255.0;
option routers 192.168.111.2;
option host-name "worker01.kopi.com";
filename "pxelinux.0";
}
host worker02.kopi.com {
hardware ethernet 00:0C:29:CF:37:CE;
fixed-address 192.168.111.84;
option subnet-mask 255.255.255.0;
option routers 192.168.111.2;
option host-name "worker02.kopi.com";
filename "pxelinux.0";
}
host worker03.kopi.com {
hardware ethernet 00:0C:29:AE:A3:EF;
fixed-address 192.168.111.85;
option subnet-mask 255.255.255.0;
option routers 192.168.111.2;
option host-name "worker03.kopi.com";
filename "pxelinux.0";
}


7. Restart the service and make it permanent
    systemctl restart dhcpd
    systemctl enable dhcpd

8.
Create folder/directory
 

    mkdir -p /var/www/html/centos7.9
    mkdir -p /var/www/html/centos7.9/ks

9. Insert your CentOS 7. DVD + Mount it to /mnt
    mount /dev/sr0 /mnt

10. Check the contents to see if it is properly mounted
    ls -al /mnt/

11. copy all DVD the contents to the /var/www/html/centos7.9 directory & updates

    shopt -s dotglob
    cp -apvrf /mnt/* /var/www/html/centos7.9/     
 
     
sudo reposync -g -l -d -m --repoid=updates --newest-only --download-metadata --download_path=/var/www/html/

    createrepo /var/www/html/updates

    eject

12. Copy the vmlinuz and initrd.img files to the tftpboot directory
    cp /var/www/html/centos7.9/images/pxeboot/vmlinuz /var/lib/tftpboot/centos7 

    cp /var/www/html/centos7.9/images/pxeboot/initrd.img /var/lib/tftpboot/centos7

13. Copy the menu file
    cp /usr/share/syslinux/menu.c32 /var/lib/tftpboot/

14. Prepare the boot menu.
    vi /var/lib/tftpboot/pxelinux.cfg/default

default menu.c32
prompt 0
timeout 100

menu title === PXE-CentOS7.9-Boot Menu===
label 1
menu label ^ 1) CentOS 7.9.2009
kernel centos7/vmlinuz
append initrd=
centos7/initrd.img ks=http://192.168.111.80/ks/ks.cfg

15. Prepare the httpd server

    vi /etc/httpd/conf/httpd.conf
        Listen 192.168.111.80:80

    vi /etc/hosts
       192.168.111.80     kickserver    kickserver.customer.com

    vi /etc/httpd/conf.d/welcome.conf
        <LocationMatch "^/+$">
        Options +Indexes

     systemctl restart httpd
    systemctl enable httpd

    iptables -F; iptables -L
    systemctl stop iptables; systemctl disable iptables 
    systemctl stop firewalld;systemctl disable firewalld


    vi /etc/selinux/config
     SELINUX=disable
 

reboot

after that you can login and run cli (pls, verify with a local repository "updates")

yum update

reboot

(pls, verify your booting with a new kernel version 3.10.0-1160.80.1.el7)