前言】:

cobbler是一个可以实现批量安装系统的Linux应用程序。它有别于pxe+kickstart,cobbler可以实现同个服务器批量安装不同操作系统版本。

系统环境准备及其下载cobbler

一.系统环境

开启两个网卡。一个仅主机模式,一个桥接模式,主机模式对内提供cobbler服务。

——# ip a

系统版本:CentOS Linux release 7.5.1804 (Core)

内网IP:192.168.182.128/24     #用来对内通信,提供cobbler服务

外网IP:192.168.4.190/24      #连接外网

二. 关闭安全服务

——# systemctl stop firewalld       #关闭防火墙

——# setenforce 0                #关闭selinux

三.cobbler部署:

1.第一步:下载相关程序

——# yum install cobbler dhcp  tftp-server  xinetd  syslinux  httpd  -y

syslinux: 提供pxelinux.0这个文件 ,pxelinux.0引导文件引导vmlinux和initrd两个启动文件

yum安装cobbler需要使用下面两个源,大家可以复制下面的代码到自己的yum仓库保存即可:

——#cat  /etc/yum.repos.d/new.repo

[epel]

name=epel

enabled=1

gpgcheck=0
baseurl=https://mirrors.aliyun.com/epel/7/x86_64/

[centos]
name=centos base
enabled=1
gpgcheck=0
baseurl=http://mirrors.163.com/centos/7/os/x86_64/

2.步:配置DHCP服务

——# vim /etc/dhcp/dhcpd.conf

subnet 192.168.182.0 netmask 255.255.255.0 {

range 192.168.182.10 192.168.182.20;

default-lease-time 600;

max-lease-time 7200;

filename "pxelinux.0";

}

——# systemctl restart dhcpd

——# systemctl enable dhcpd

3.步:配置tftp

只改一项:

——# vim /etc/xinetd.d/tftp

# default: off

# description: The tftp server serves files using the trivial file transfer \

#    protocol.  The tftp protocol is often used to boot diskless \

#    workstations, download configuration files to network-aware printers, \

#    and to start the installation process for some operating systems.

service tftp

{

socket_type        = dgram

protocol        = udp

wait            = yes

user            = root

server            = /usr/sbin/in.tftpd

server_args        = -s /var/lib/tftpboot

disable            = no        #yes改为no

per_source        = 11

cps            = 100 2

flags            = IPv4

}

——# systemctl restart xinetd

4.第四步:启动httpd

——# systemctl restart httpd

5.步:启动cobbler

——# systemctl restart cobblerd

6.步:检查cobbler配置

——# cobbler check

The following are potential configuration items that you may want to fix:

1 : The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work.  This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.

2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.

3 : Some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely.  Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements.

4 : enable and start rsyncd.service with systemctl

5 : debmirror package is not installed, it will be required to manage debian deployments and repositories

6 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one

7 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

Restart cobblerd and then run 'cobbler sync' to apply changes.

根据如上反馈,需要一一进行修改才能继续进行

修改配置文件/etc/cobbler/settings

1问题一:

cobbler文件默认是127.0.0.1本地回环地址,需要更改为提供cobbler服务的ip地址192.168.182.128,在384行

384  server:192.168.182.128

2问题二:

netx_server也是默认本地127.0.0.1回环地址,需要修改为提供cobbler服务的ip地址 192.163.182,128,在272行

272  next_server: 192.168.182.128

3问题三:

缺少一些网络引导加载程序,我们只是处理网络引导,完全可以忽略

4问题四:

启动并设置开机自启“rsync”即可

——# systemctl restart rsyncd

——# systemctl enable rsyncd

5问题五:
 未安装debmirror包,需要它来管理debian部署和存储库,但我们不需要,可以忽略。

6问题六:
 需要更改密码

——# openssl passwd -1 -salt "123" "123456"

$1$123$7mft0jKnzzvAdU4t0unTG1      #生成密码加密符串

并把新生成的加密数据填写进/etc/cobbler/settings

——#vim /etc/cobbler/settings

。。。。。

101 default_password_crypted: "$1$123$7mft0jKnzzvAdU4t0unTG1"

7问题七:

(找不到防护工具,需要使用(可选)电源管理功能。安装cman或围栏代理来使用它们),可以忽略。

7.第七步:同步和重启cobbler

——# systemctl restart cobblerd
——# cobbler sync

再次检查是否已经更改完成

——# cobbler check

The following are potential configuration items that you may want to fix:

1 : Some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely.  Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements.

2 : debmirror package is not installed, it will be required to manage debian deployments and repositories

3 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

Restart cobblerd and then run 'cobbler sync' to apply changes.

已经更改完毕!

8.步:挂载光盘并进行数据导入

挂载光盘

——# mount /dev/cdrom  /mnt

数据导入(需要一些时间)

9. 第九步:制作distro

distro 】: 发行版, 就是我们安装什么版本的linux操作系统的名称,一会我们会导入一个 distro.

——# cobbler import --path=/mnt  --name="centos7.5"

。。。。。。

查看distro

——# cobbler distro list
centos7.5-x86_64

查看profile

——# cobbler profile list
centos7.5-x86_64

profile】:类似于一个 配置文件,类似于你的 bash_profile, 里面包含你可以添加 kernel 参数,对应的kickstart 文件 以及 此profile 对应的 distro等等。

10.步:准备kickstart文件

只需要修改一处:

在root目录下找到ks文件,并移动到/var/lib/cobbler/kickstarts/到目录下改名为ks.cfg

——# mv  anaconda-ks.cfg  /var/lib/cobbler/kickstarts/ks.cfg

——# vim /var/lib/cobbler/kickstarts/ks.cfg

#version=DEVEL

# System authorization information

auth --enableshadow --passalgo=sha512

# Use CDROM installation media

url --url=http://192.168.182.128/cobbler/ks_mirror/centos7.5/  #这里需要更改为repodata所在的http地址

# Use graphical install

graphical

# Run the Setup Agent on first boot

firstboot --enable

ignoredisk --only-use=sda

............

11.十一步:自定义profile

——# cobbler profile add --distro=centos7.5-x86_64 --name=centos7.5_feige --kickstart=/var/lib/cobbler/kickstarts/ks.cfg

——# cobbler sync      #同步

12.十二步:查看profile删除无指定kickstart文件的profile

——# cobbler profile list

centos7.5-x86_64

centos7.5_feige

——# cobbler profile remove --name=centos7.5-x86_64

——# cobbler profile list

centos7.5_ken

四.cobbler自动化安装测试

新建一个虚拟机,需要和cobbler服务器所在同一个虚拟网络中即与我们上面设置的cobbler服务器的主机模式。内存需要3个G以上。

选择第我们自定义的包即可进行自动化安装。

末学者笔记--Centos7系统部署cobbler批量安装系统的更多相关文章

  1. 基于CentOS7系统部署cobbler批量安装系统(week3_day5_part1)-技术流ken

    前言 cobbler是一个可以实现批量安装系统的Linux应用程序.它有别于pxe+kickstart,cobbler可以实现同个服务器批量安装不同操作系统版本. 系统环境准备及其下载cobbler ...

  2. 基于Centos7系统部署cobbler批量安装系统

    前言 cobbler是一个可以实现批量安装系统的Linux应用程序.它有别于pxe+kickstart,cobbler可以实现同个服务器批量安装不同操作系统版本 系统环境的准备及下载cobbler 一 ...

  3. 006-(成功环境记录)基于Centos7系统部署cobbler批量安装系统

    1.1 cobbler简介 Cobbler是一个Linux服务器安装的服务,可以通过网络启动(PXE)的方式来快速安装.重装物理服务器和虚拟机,同时还可以管理DHCP,DNS等. Cobbler可以使 ...

  4. centos7系统部署cobbler批量安装系统

    系统环境: 一.开启两个网卡.一个仅主机模式,一个桥接模式,主机模式对内提供cobbler服务 [root@localhost ~]# ip a 1: lo: <LOOPBACK,UP,LOWE ...

  5. cobbler批量安装系统

    cobbler是一个可以实现批量安装系统的Linux应用程序.它有别于pxe+kickstart,cobbler可以实现同个服务器批量安装不同操作系统版本. 1.系统环境准备及其下载cobbler 1 ...

  6. cobbler批量安装系统使用详解-技术流ken

    前言 cobbler是一个可以实现批量安装系统的Linux应用程序.它有别于pxe+kickstart,cobbler可以实现同个服务器批量安装不同操作系统版本. 系统环境准备及其下载cobbler ...

  7. cobbler一键批量安装系统

    cobbler是一个可以实现批量安装系统的Linux应用程序.它有别于pxe+kickstart,cobbler可以实现同个服务器批量安装不同操作系统版本. 一.系统环境准备及其下载cobbler 1 ...

  8. 其他综合-Cobbler无人值守安装系统 CentOS 7

    Cobbler 无人值守安装系统 CentOS 7 1.实验描述 1.1 概述 作为运维,在公司经常遇到一些机械性重复工作要做,例如:为新机器装系统,一台两台机器装系统,可以用光盘.U盘等介质安装,1 ...

  9. 一键cobbler批量安装脚本

    前几天机房上架180台服务器,太多了,使用了cobbler批量安装,具体的看我上代码,我把配置cobbler的命令给堆积起来,也算是个脚本吧,欢迎拍砖指正,下面我上脚本: #!/bin/bash # ...

随机推荐

  1. P1462 通往奥格瑞玛的道路 (二分+最短路)

    题目 P1462 通往奥格瑞玛的道路 给定\(n\)个点\(m\)条边,每个点上都有点权\(f[i]\),每条边上有边权,找一条道路,使边权和小于给定的数\(b\),并使最大点权最小. 解析 二分一下 ...

  2. python学习day19 面向对象(一)封装/多态/继承

    面向对象 封装思想:将同一类的函数函数封装到同一个py文件中,方便调用 面向对象也有封装的作用,将同一类的函数封装到一个类中 多态(鸭子模型):多种类型/多种形态 #,什么事鸭子模型 对于一个函数,p ...

  3. 怎么解决docker pull拉取镜像速度过慢的问题

    在我们安装了docker之后,在利用docker pull下载镜像的时候,由于国内的源会出现的问题就是速度真的很慢,可以用龟速来形容,最痛苦的是当你耐心的等待几个小时之后,出现unexpected E ...

  4. JMeter的介绍和简单使用

    Apache官网(https://jmeter.apache.org/)对JMeter的解释: Apache JMeter™ Apache JMeter™应用程序是开源软件,   为负载功能和性能测试 ...

  5. 1.7分布式工具配置及安装(仅供学习Xshell,VMware)

    前言 最近因为换工作以及其他的一些琐事,耽误了更博时间,再加上分布式的这几个软件之前没撸过....这学习这几个工具上也花了点时间 本篇博客为后续分布式的学习提供基础的安装和配置. 首先,系统为Cent ...

  6. mac 连接linux服务器,用scp命令实现本地文件与服务器文件之间的互相传输

    mac连接linux服务器 打开终端,切换到root权限下,切换root权限命令:sudo -i 通过ssh命令连接linux服务器:ssh root@ip地址(root是账户名) 然后根据提示输入密 ...

  7. 深入理解Java自带的线程池和缓冲队列

    前言 线程池是什么 线程池的概念是初始化线程池时在池中创建空闲的线程,一但有工作任务,可直接使用线程池中的线程进行执行工作任务,任务执行完成后又返回线程池中成为空闲线程.使用线程池可以减少线程的创建和 ...

  8. uCos-II移值(一)

    os_cpu.h文件 该文件主要是完成操作系统使用的内部数据类型.常数以及宏的定义,这些都是与处理器平台密切相关的: 第一部分 以下部分定义了系统内部常用的数据类型,为了增加系统的可移植性,系统内核只 ...

  9. JGUI源码:实现简单进度条(19)

    程序效果如下 实现进度条动画主要有两种方法:(1)使用缓动,(2)使用Jquery Animate,本文使用第二种方法,先实现代码,后续进行控件封装 <style> .jgui-proce ...

  10. PHP和JS在循环、条件判断中的不同之处

    一.条件判断: php中算  false 的情况 1. boolean:false 2. 整形:0 3.浮点型:0 4.字符串:"" "0"(其他都对) 5.空 ...