Previous work done once unattended automatic batch installation CentOS, no resistance at that time too busy, forget to take notes. Now just the company new into a batch of servers to shelves, to do the system, just use this opportunity to do the following notes:
What is PXE? What is Kickstart? This is not described here in one by one, because there are so many interpretations of these concepts on the web, and I'll elaborate on the installation conditions and detailed steps of the Pxe+kickstart.
Prerequisites to perform Pxe+kickstart installation:
DHCP server;
TFTP server;
Kickstart generated by the ks.cfg configuration file;
A server that hosts the system installation files, such as NFS, HTTP, or FTP servers;
A host with PXE-enabled NIC boot.
Department of Environment: Server System for the CENTOS-6.6_X86_64,IP address is: 10.0.0.13. Since the server is minimized, we need to use the System-config-kickstart tool later, which must depend on X windows, so we need to install X windows and Desktop in advance and reboot the system to get it into graphical mode.
First, the Environment preparation
[Email protected] ~]# cat/etc/redhat-release
CentOS Release 6.6 (Final)
[Email protected] ~]# uname-m
x86_64
[[email protected] ~]# yum-y groupinstall ' X Window System '
[[email protected] ~]# yum-y groupinstall ' Desktop '
The error is as follows:
Error:samba4-common conflicts with samba-common-3.6.23-24.el6_7.x86_64
You could try using--skip-broken to work around the problem
You could try Running:rpm-va--nofiles--nodigest
Depending on the error prompt, and the error prompt, the system gives the following workaround:
1. Use the "--skip-broken" option to skip the above error;
2. Try running "Rpm-va--nofiles--nodigest" To resolve this error
[[email protected] ~]# Rpm-va--nofiles--nodigest #运行此命令, without any action or hint, then skip the error directly using the first method
[[email protected] ~]# yum-y groupinstall ' desktop '--skip-broken #跳过或忽略上面的错误安装 ' desktop ', everything is OK, hehe
Then modify the/etc/inittab file and restart the server so that it runs in graphical mode, the main modified file content is as follows:
Id:5:initdefault:
Save exit, init 6 restart server
Second, unattended installation combat
Mount the CD ISO file to the/mnt/cdrom directory, as follows:
Mkdir-p/mnt/cdrom
Mount-o Loop centos-6.6-x86_64-minimal.iso/mnt/cdrom #CentOS -6.6-x86_64-minimal.iso disc image file can be downloaded by yourself
Installing httpd
Rpm-qa httpd #没安装的话就yum安装一下
Yum-y Install httpd Httpd-tools
Copy all the contents (Files and folders) under the CD ISO file to/var/www/html (this directory is the Apache default DocumentRoot directory).
cp-rf/mnt/cdrom/*/var/www/html
-
Install Tftp-server and enable the TFTP service while starting the xinetd process
1) Install Tftp-server
yum-y Install tftp-server
2) Modify the/etc/xinetd.d/tftp file to change the value of disable from Yes to No, as follows:
650) this.width=650; "src="/HTTP/ S3.51cto.com/wyfs02/m01/79/d1/wkiol1abr2hyjom3aaaogroi06q311.png "title=" 1.png "alt=" Wkiol1abr2hyjom3aaaogroi06q311.png "/>
3) Restart xinetd process
/etc/init.d/xinetd Restart
-
To configure a PXE-enabled boot program (note: The contents of the Centos-6.6-x86_64 CD have been copied to the/var/www/html directory before, so you can just copy the required files from the/var/www/html directory)
mkdir/tftpboot
yum-y install syslinux
cp/usr/share/syslinux/ Pxelinux.0/tftpboot
cp/var/www/html/images/pxeboot/initrd.img/tftpboot
cp/var/ Www/html/images/pxeboot/vmlinuz/tftpboot
cp/var/www/html/isolinux/*.msg/tftpboot/
MKDIR/TFTPBOOT/PXELINUX.CFG
cp/var/www/html/isolinux/isolinux.cfg/tftpboot/pxelinux.cfg/ Default Note: Do not modify the default file at this time, although it is now possible to boot through the network and manually install the Kickstart, but because here we are talking about unattended automatic installation, So do not modify the default file first.
Install the DHCP service and configure
Yum-y Install DHCP
Cp/usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample/etc/dhcp/dhcpd.conf
Then modify the/etc/dhcp/dhcpd.conf configuration file, the file last modified content as follows:
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/79/D2/wKioL1abvtiwUolyAAA8AK_crkU361.png "title=" 666666666.png "alt=" Wkiol1abvtiwuolyaaa8ak_crku361.png "/>
Finally, start the DHCP service:/ETC/INIT.D/DHCPD start
Install Kickstart, and configure System-config-kickstart
1) yum-y Install System-config-kickstart
Configure the Kickstart in graphical mode, as follows
2) System-config-kickstart
Run the above command to set some basic configuration of the system, such as time zone, root password, etc.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/79/D2/wKioL1abwobi7QonAAF5zeqdf20271.png "title=" 4444.png "alt=" Wkiol1abwobi7qonaaf5zeqdf20271.png "/>
3) next to install, it is recommended to choose HTTPD installation, remember not to enter any account, but the use of anonymous installation. During the installation process, the installation options are selected according to the boot, and no changes are required.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/79/D2/wKioL1abw0XDfai8AAD8AA3O3CA506.png "title=" 55555555555.png "alt=" Wkiol1abw0xdfai8aad8aa3o3ca506.png "/>
4) Install MBR
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/79/D2/wKioL1abw-XzvpmGAAF2ynKiDgU040.png "title=" 111111111111111.png "alt=" Wkiol1abw-xzvpmgaaf2ynkidgu040.png "/>
5) Set the partition
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/79/D2/wKioL1abxfihRkRfAAFRj_V2L1k242.png "title=" 3333333333333333333333333.png "alt=" Wkiol1abxfihrkrfaafrj_v2l1k242.png "/>
6) Configure the network
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/79/D2/wKioL1abxpuAV3P_AACJ7rGwcE8639.png "title=" 22222222222.png "alt=" Wkiol1abxpuav3p_aacj7rgwce8639.png "/>
7) Authentication Configuration
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/79/D2/wKioL1abxy2xqy92AAElA-F8LMg994.png "title=" 77777777777777777.png "alt=" Wkiol1abxy2xqy92aaela-f8lmg994.png "/>
8) SELinux and firewall configuration
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/79/D3/wKiom1abx1iA1O-1AADwARuXeAY517.png "title=" 8888888888888888888.png "alt=" Wkiom1abx1ia1o-1aadwaruxeay517.png "/>
9) Graphical Environment configuration
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/79/D3/wKiom1abx8XwSIyQAAECJfKe9qA486.png "title=" 9999999999.png "alt=" Wkiom1abx8xwsiyqaaecjfke9qa486.png "/>
10) Package Installation options
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/79/D3/wKiom1abyGGTkLuLAAEhOqEUjjI285.png "title=" 11111111111111111111111111111111111111.png "alt=" Wkiom1abyggtklulaaehoqeujji285.png "/>
The remaining two are the scripts to be shipped before the installation and the scripts to be run after installation
11) Finally save the generated ks.cfg file to/var/www/html, ks.cfg file configuration method for automated unattended installation of the focus and difficulty, this file is slightly misconfigured requires human intervention.
Modify the/tftpboot/pxelinux.cfg/default file, specify the method to read the ks.cfg, that is, modify the first line of the file content, the first line of the modified file is as follows:
Default Text KS = Http://10.0.0.13/ks.cfg
In addition, the intention is to change the timeout time from the original 600 to 1,timeout time is the time to wait for the user to manually select when booting, set to "1" indicates direct boot.
After starting all the servers that all kickstart need, you can start the "unattended, fully automated installation of the CentOS system." The start command is as follows:
/ETC/INIT.D/HTTPD start
Chkconfig httpd on
/ETC/INIT.D/DHCPD start
Chkconfig DHCPD on
/etc/init.d/xinetd restart
Chkconfig xinetd on
Enclosed unattended Installation
This article is from the "Lanzhou Linux operation and Maintenance" blog, please be sure to keep this source http://linuxzkq.blog.51cto.com/9379412/1736010
Pxe+dhcp+apache+kickstart Unattended Installation CentOS-6.6