Batch deployment, unattended deployment, salt master/minion deployment

Source: Internet
Author: User

Batch deployment, unattended deployment, salt master/minion deployment

Preparation:

Rhel-server-6.4-x86_64-dvd.iso

Salt.tar.gz

Step 1: Prepare a server to manage other servers

System --- → rhel-server-6.4-x86_64-dvd.iso

Ip --- → route 10.10.111

Hostname ---- → admin.black.com

Configure the yum Source

Mkdir/iso

Mount/dev/cdrom/iso

Create/etc/yum. repo. d/yum. repo

Step 2: Use the admin Server as the DHCP server

Requirements:

1: assign ip addresses to other servers

2: Send the address of the tftp server to other servers.

3: specify the name of a network-enabled bootloader file.

Steps:

1: yum install dhcp *-y

2. modify the configuration file

[Root @ admin ~] # Cat/etc/dhcp/dhcpd. conf

#

# DHCP Server Configuration file.

# See/usr/share/doc/dhcp */dhcpd. conf. sample

# See 'man 5 dhcpd. conf'

#

Subnet 10.10.0 netmask subnet 255.255.0 {

Range dynamic-bootp restart 10.10.10 then 10.10.50;

Option routers route 10.10.111;

Next-server route 10.10.111;

Filename "pxelinux.0 ";

}

3:/etc/init. d/dhcpd restart

Test:

Prepare a server on the VM. Use the same Nic as admin to enable dhcp and remove CD/DVD.

Start

If the ip address can be obtained, this step is successful!

Step 3: Use the admin Server to create another tftp service

Requirement: Provide bootloader files, vmlinux kernel files, init initialization files, and

Menu file

Steps:

1:

Yum install tftp-server-y

Chkconfig tftp on

/Etc/init. d/xinetd restart

2:

Mkdir/iso

Mkdir/var/lib/tftpboot/pxelinux. cfg

Mount/opt/rhel-server-6.4-x86_64-dvd.iso/iso-o loop

Cp/iso/isolinx/isolinux. cfg/var/lib/tftpboot/pxelinux. cfg/default

Cp/iso/isolinux/*/var/lib/tftpboot/-rf

3:

Yum install syslinux *-y # To Get A bootloader that can be started on the network

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

/Etc/init. d/xinetd restart

Test:

The same as above; this is successful when a menu file appears.

Step 4: Use the admin Server and configure an nfs service to provide the installation directory tree for installation.

Requirements:

Install directory tree

Provide kickstart files

Steps:

Modify the exports file and specify the shared directory as follows:

[Root @ admin ~] # Cat/etc/exports

/Iso * (rw)

/Opt * (rw)

/Etc/init. d/nfs restart

Step 5: Prepare kickstart for unattended installation

Requirement: avoid human-computer interaction during batch deployment

You can manually write one or use a python tool to generate the ks file.

Steps:

Yum install system-config-kickstart-y

Admin] # system-config-kickstart # image decryption is required. You can also generate a file on another server, and then cp it.

Note that the installation source option is nfs.

For other options, disable iptables and selinux.

Save the generated ks. cfg file to the/opt directory because nfs shares the/opt directory,

Modify the default file

Vim/var/lib/tftpboot/pxelinux. cfg/default

# The modification content is as follows:

Timeout 50

......

Label linux

Menu label ^ Install or upgrade an existing system

Menu default

Kernel vmlinuz

Append initrd = initrd. img ks = nfs: Running 10.10.111:/opt/ks. cfg

Test: At this time, when other servers are started, they should be automatically installed.

Step 5: Modify the/opt/ks. cfg file to meet your requirements, such as the deployment of salt and yum sources.

# Prepare the required package on the admin Server and configure an ftp server for downloading from other servers.

Step 1: configure the ftp service to prepare files

Yum install vsftpd-y

Cp/opt/rhel-server-6.4-x86_64-dvd.iso/var/ftp # convenient for other services

Download to configure the yum Source

Mkdir/var/ftp/yum # configure your own software repository to install salt and package the required rpm

Copy to/var/ftp/yum, and then createrepo

Tar-xvf salt.tar.gz-C/

Cd/var/ftp/yum

Yum install createrepo-y-q

Createrepo.

Step 2: repair the ks. cfg file, configure the yum source, and configure the master/minion of the salt to use the admin server.

Management and automated O & M

% Post

Cat>/etc/yum. repos. d/yum. repo <EOF

[Rhel]

Name = Red Hat

Baseurl = file: // iso

Enabled = 1

Gpgcheck = 0

EOF

Cat>/etc/yum. repos. d/yum2.repo <EOF

[Rhel-salt]

Name = red hat salt

Baseurl = ftp: // using 10.10.111/yum

Enabled = 1

Gpgcheck = 0

EOF

Mkdir/iso

Curl-o/opt/rhel6.4.iso ftp: // 20.10.10.111/rhel-server-6.4-x86_64-dvd.iso

Mount/opt/rhel6.4.iso/iso-o loop

Echo "mount/opt/rhel6.4.iso/iso-o loop">/etc/rc. local

Yum install wget-y-q

Yum install salt-minion-y

Ip = 'ifconfig eth0 | awk-F "[:]" 'nr = 2 {print $13 }''

Sed/^ # master:/s/# master. */master: \ Users 10.10.111 // etc/salt/minion-I

Sed/^ # id:/s/# id:. */id: \ $ ip/etc/salt/minion-I

/Etc/init. d/salt-minion restart

Chkconfig salt-minion on

% End

Test:

After deployment, install salt-master on the admin server.

Execute salt-key-

Salt-key # Check whether the deployed server has been loaded

SUSE Linux 11 pxe + DHCP + tftp + ftp Unattended Installation

Use PXE to enable self-built dhcp tftp service for unattended CentOS6 Installation

Use PXE + DHCP + Apache + Kickstart to install CentOS5.8 x86_64

Kickstart fully automated installation of CentOS 6.3

Linux Installation notes on Kickstart

PXE/Kickstart remote automatic installation of RedHat Linux

DHCP + TFTP + HTTP + Kickstart automatic server deployment

This article permanently updates the link address:

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.