Linux Automation Deployment Operating system

Source: Internet
Author: User
Tags rsyslog

Recent work is not very busy, I deployed a set of Linux Automation deployment operating system, now take the steps to remember, to deepen the impression.

First, the environment

Prepare two virtual machines, one of which has been installed in desktop, BASE SERVER, the operating system is centos6.5-x86_64, as the server, and the other is only installed virtual machine, the operating system is not installed for automated deployment test use;


Note: Desktop graphics must be installed, otherwise the use of Kickstart unattended function, no way to start the configuration;


The main software that needs to be used:

http

Dhcp

xinetd

Tftp-server

Tftp

Syslinux

System-config-kickstart


The above software, can be used directly using Yum installation, very convenient;


Second, install the configuration DHCP

Yum-y Install DHCP

Chkconfig DHCPD on

cd/etc/dhcp/

MV Dhcpd.conf Dhcpd.conf.bak

Cp/usr/share/doc/dhcp*/dhcpd.conf.sample./dhcpd.conf

Vim dhcpd.conf//Edit the principal configuration file of the DHCP service;

Add the following on approximately 11 lines:

FileName "pxelinux.0"; PXE network boot program;

Next-server 192.168.1.231; IP is the IP address of the machine, which is the IP address of the server;


Change the contents of approximately 49-57 lines as follows (adjust according to your actual situation):

Subnet 192.168.1.0 netmask 255.255.255.0 {range 192.168.1.241 192.168.1.245;   Option Domain-name-servers 192.168.1.1;   Option Domain-name "example.com";   Option routers 192.168.1.1;   Option broadcast-address 192.168.1.255;   Default-lease-time 600; Max-lease-time 7200; }


Finally save the exit;


VIM/ETC/RSYSLOG.CONF//define DHCP logs;

Add the following in the middle of the file:

local7.*/var/log/dhcpd.log


Service DHCPD configtest//test configuration file is abnormal;

Service Rsyslog restart//restart log services;

Service DHCPD restart//restart DHCP service;


Firewall to open TCP/UDP 67 port;


Third, installation configuration TFTP

Yum-y install xinetd tftp-server tftp syslinux

Chkconfig xinetd on

Chkconfig TFTP on

Service xinetd Restart

cp/usr/share/syslinux/pxelinux.0/var/lib/tftpboot/


Mkdir/mnt/share

Mkdir/mnt/centos6

Mount-t cifs-o usernaem=administrator,password=123456//192.168.1.77/iso/mnt/share///linux access to the directory of Windows shared ISO folders;


[Email protected] tftpboot]# ll/mnt/share/

Total 4363264

-rwxr-xr-x 1 root user1 4467982336 Mar 3 10:48 Centos6.5x86_64.iso


Mount-o LOOP/MNT/SHARE/CENTOS6.5X86_64.ISO/MNT/CENTOS6//Mount ISO to the appropriate directory;


Firewall to open TCP/UDP 69 port;


Iv. Installation Configuration HTTP

Yum-y Install httpd

Chkconfig httpd on

Mkdir/var/www/html/pub

Mount--bind/mnt/centos6//var/www/html/pub/

Service httpd Start


The firewall opens TCP 80 port;


Five, installation configuration Kickstart

Yum-y Install System-config-kickstart

System-config-kickstart//Start the graphical configuration interface, omitted here, the last generated file "Ks.cfg" saved to the/var/www/html/directory, the contents are as follows:

[email protected] html]# cat ks.cfg

# reboot after instal#platform=x86, amd64, or intel em64t#version=devel#  Firewall configurationfirewall --disabled# Install OS instead of  Upgradeinstall# use network installationurl --url= "Http://192.168.1.231/pub" # root  passwordrootpw --iscrypted $1$gywdu125$2fur.r57g/j7bkhx7f6pk1# system authorization  informationauth  --useshadow  --passalgo=sha512# Use text mode  Installtextfirstboot --disable# system keyboardkeyboard us# system languagelang  en_US# SELinux configurationselinux --disabled# Installation logging  levellogging --level=infolationreboot# system timezonetimezone --isutc asia/shanghai#  Network informationnetwork  --bootproto=dhcp --device=eth0 --onboot=on#  System bootloader configurationbootloader --location=mbr# clear the master boot recordzerombr#  partition clearing informationclearpart --all  # disk partitioning  Informationpart /boot --fstype= "Ext4"  --size=100part swap --fstype= "swap"  --size =2000part / --fstype= "Ext4"  --grow --size=1


Open the browser, enter: http://192.168.1.231/ks.cfg normal access to files;


Vi. Configuring PXE

cd/var/lib/tftpboot/

mkdir pxelinux.cfg

cp/mnt/centos6/isolinux/*/var/lib/tftpboot/

CP isolinux.cfg./pxelinux.cfg/default

Vim./pxelinux.cfg/default//Edit the PXE configuration file, add a label under approximately 22 lines, as follows:

Label centos6.5 Menu label ^install centos6.5-x86_64 system kernel vmlinuz append initrd=initrd.img ks=http://192.16 8.1.231/ks.cfg


Service xinetd Restart


Finally open the virtual machine without the operating system installed, after the boot, choose our custom label to install, about 15 minutes, the system fully automatic installation.



This article is from the "Square Hill" blog, please be sure to keep this source http://63638790.blog.51cto.com/513514/1617666

Linux Automation Deployment Operating system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.