yum安装

yum install -y epel-release
yum install -y httpd dhcp tftp cobbler cobbler-web pykickstart xinetd
#httpd dhcp tftp cobbler 程序及其依赖服务 #cobbler-web web管理 #pykickstart KS文件检查 #xinetd 守护进程 systemctl start cobblerd && systemctl enable cobblerd
systemctl start httpd && systemctl enable httpd
systemctl start xinetd && systemctl enable xinetd

  

配置文件

/etc/cobbler             # 配置文件目录
/etc/cobbler/settings # cobbler主配置文件
/etc/cobbler/dhcp.template # DHCP服务的配置模板
/etc/cobbler/tftpd.template # tftp服务的配置模板
/etc/cobbler/rsync.template # rsync服务的配置模板
/etc/cobbler/iso # iso模板配置文件目录
/etc/cobbler/pxe # pxe模板文件目录
/etc/cobbler/power # 电源的配置文件目录
/etc/cobbler/users.conf # Web服务授权配置文件
/etc/cobbler/users.digest # web访问的用户名密码配置文件
/etc/cobbler/dnsmasq.template # DNS服务的配置模板
/etc/cobbler/modules.conf # Cobbler模块配置文件
/var/lib/cobbler # Cobbler数据目录
/var/lib/cobbler/config # 配置文件
/var/lib/cobbler/kickstarts # 默认存放kickstart文件
/var/lib/cobbler/loaders # 存放的各种引导程序
/var/www/cobbler # 系统安装镜像目录
/var/www/cobbler/ks_mirror # 导入的系统镜像列表
/var/www/cobbler/images # 导入的系统镜像启动文件
/var/www/cobbler/repo_mirror # yum源存储目录
/var/log/cobbler # 日志目录
/var/log/cobbler/install.log # 客户端系统安装日志
/var/log/cobbler/cobbler.log # cobbler日志

  

/etc/cobbler/settings中几个比较重要的参数设置(根据需求设置)

manage_dhcp:1
manage_dns:1
manage_tftpd:1
restart_dhcp:1
restart_dns:1
pxe_just_once:1 #防止安装循环配置始终从网络引导,激活此选项时机器告诉 Cobbler 安装已完成。Cobbler 将系统对象的 netboot 标志更改为 false,这会强制机器从本地磁盘引导
next_server:<服务器的 IP 地址> #用在 DHCP 配置文件中,向机器告知提供引导文件的服务器地址
server:<服务器的 IP 地址> #用于引用 Cobbler 服务器地址

  

初始化cobbler

systemctl restart cobblerd
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 : change 'disable' to 'no' in /etc/xinetd.d/tftp
4 : 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.
5 : enable and start rsyncd.service with systemctl
6 : debmirror package is not installed, it will be required to manage debian deployments and repositories
7 : 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

  

获取启动文件

cobbler get-loaders   #下载有点慢

  

开启TFTP服务

vim /etc/xinetd.d/tftp
disable = no
systemctl restart xinetd

  

开启rsyncd服务

systemctl start rsyncd && systemctl enable rsyncd

设置默认root密码

openssl passwd -1 -salt 'root' 'root'   #密码明文为root
$1$root$9gr5KxwuEdiI80GtIzd.U0
vim /etc/cobbler/settings
101 default_password_crypted: "$1$root$9gr5KxwuEdiI80GtIzd.U0" 

cobbler管理DHCP

vim /etc/cobbler/dhcp.template #重启cobbler后,cobbler会生成一个模板文件
subnet 192.168.100.0 netmask 255.255.255.0 {
option routers 192.168.100.1;
option domain-name-servers 192.168.100.1;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.100.50 192.168.100.100;
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;

  

生成新的配置文件

[root@linux-node1 ~]# systemctl restart cobblerd
[root@linux-node1 ~]# cobbler sync

  

导入镜像

mount /dev/cdrom /mnt #在光驱中加载一个完成的centos7 ISO文件
mount: /dev/sr0 is write-protected, mounting read-only
cobbler import --path=/mnt/ --name=/CentOS-7-x86_64 --arch=x86_64 #使用import导入
cobbler profile list #查看镜像目录
CentOS-7-x86_64
cobbler profile report #查看cobbler系统仓库中的版本信息
Name : CentOS-7-x86_64
TFTP Boot Files : {}
Comment :
DHCP Tag : default
Distribution : CentOS-7-x86_64 #版本名称
Enable gPXE? : 0
Enable PXE Menu? : 1
Fetchable Files : {}
Kernel Options : {} #自定义内核参数
Kernel Options (Post Install) : {}
Kickstart : /var/lib/cobbler/kickstarts/sample_end.ks #这里显示此系统版本使用的是系统自带的kickstart文件

  

制作ks文件

kickstart文件的制作非常简单。

首先安装system-config-kickstart。

yum install system-config-kickstart
system-config-kickstart #要有桌面环境

修改默认ks文件执行system-config-kickstart启用图形界面进行配置(使用xmanager之类的连接程序)

cd /var/lib/cobbler/kickstarts/
上传自定义ks文件 CentOS-7-x86_64.cfg
cobbler profile edit --name=CentOS-7-x86_64 --kickstart=/var/lib/cobbler/kickstarts/CentOS-7-x86_64.cfg #上传完成后修改成我们自己的ks文件
cobbler profile edit --name=CentOS-7-x86_64 --kopts='net.ifnames=0 biosdevname=0' #这里我们顺便修改一下内核文件参数,让centos7初始化网卡名为“eth”
cobbler sync #更改配置后都要执行

测试cobbler

web管理

https://192.168.100.132/cobbler_web

账号密码  cobbler cobbler

Cobbler 自动化部署系统的更多相关文章

  1. Cobbler自动化部署系统

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

  2. Cobbler自动化部署最佳实践

    第1章 Cobbler自动化部署最佳实践 运维自动化在生产环境中占据着举足轻重的地位,尤其是面对几百台,几千台甚至几万台的服务器时,仅仅是安装操作系统,如果不通过自动化来完成,根本是不可想象的. 面对 ...

  3. .NET持续集成与自动化部署之路第一篇——半天搭建你的Jenkins持续集成与自动化部署系统

    .NET持续集成与自动化部署之路第一篇(半天搭建你的Jenkins持续集成与自动化部署系统) 前言     相信每一位程序员都经历过深夜加班上线的痛苦!而作为一个加班上线如家常便饭的码农,更是深感其痛 ...

  4. centos7.2环境nginx+mysql+php-fpm+svn配置walle自动化部署系统详解

    centos7.2环境nginx+mysql+php-fpm+svn配置walle自动化部署系统详解 操作系统:centos 7.2 x86_64 安装walle系统服务端 1.以下安装,均在宿主机( ...

  5. Cobbler自动化部署

    一:PXE.Kickstart与Cobbler的概念: PXE(preboot execute environment,预启动执行环境)是由Intel公司开发的技术,需要网卡的硬件支持,工作于C/S的 ...

  6. cobbler自动化安装系统

    笔者Q:972581034 交流群:605799367.有任何疑问可与笔者或加群交流 在很久很久以前,使用kickstart实现自动化安装的时候,我一直认为装系统是多么高大上的活,直到cobbler的 ...

  7. .NET 半天搭建Jenkins持续集成与自动化部署系统

    前言 相信每一位程序员都经历过深夜加班上线的痛苦!而作为一个加班上线如家常便饭的码农,更是深感其痛.由于我们所做的系统业务复杂,系统庞大,设计到多个系统之间的合作,而核心系统更是采用分布式系统架构,由 ...

  8. 自动化运维之Cobbler自动化部署安装操作系统

    Cobbler概述: Cobbler可以用来快速建立 Linux 网络安装环境,它已将 Linux 网络安装的技术门槛,从大专以上文化水平,成功降低到初中以下,连补鞋匠都能学会. 在生产环境中,经常批 ...

  9. (转)Cobbler自动化部署最佳实践

    原文:http://www.xuliangwei.com/xubusi/446.html 运维自动化在生产环境中占据着举足轻重的地位,尤其是面对几百台,几千台甚至几万台的服务器时,仅仅是安装操作系统, ...

随机推荐

  1. 【github】添加 ssh 秘钥

    1 生成秘钥 打开shell 备注: 123@example.com 为邮箱地址 ssh-keygen -t rsa -C "123@example.com" 此处选Y ,其他都是 ...

  2. OAuth网络协议(转)

    一.应用场景 为了理解OAuth的适用场合,让我举一个假设的例子. 有一个"云冲印"的网站,可以将用户储存在Google的照片,冲印出来.用户为了使用该服务,必须让"云冲 ...

  3. 微信小程序插件内页面跳转和参数传递(转)

    在此以插件开发中文章列表跳传文章详情为例. 1.首先在插件中的文章列表页面wxml中绑定跳转事件. bindtap='url' data-id="{{item.article_id}}&qu ...

  4. Kafka+Storm+HDFS 整合示例

    消息通过各种方式进入到Kafka消息中间件,比如可以通过使用Flume来收集日志数据,然后在Kafka中路由暂存,然后再由实时计算程序Storm做实时分析,最后将结果保存在HDFS中,这时我们就需要将 ...

  5. node中非常重要的process对象,Child Process模块

    node中非常重要的process对象,Child Process模块Child Process模块http://javascript.ruanyifeng.com/nodejs/child-proc ...

  6. backBone.js初识

    一.单页面应用 1.单页面应用(single-page application :SPA),是指在浏览器中运行的应用,在使用期间不会重新加载页面. 2.它所有的活动局限于一个Web页面,仅在初始化加载 ...

  7. pandas 数据类型转换

    数据处理过程的数据类型 当利用pandas进行数据处理的时候,经常会遇到数据类型的问题,当拿到数据的时候,首先需要确定拿到的是正确类型的数据,一般通过数据类型的转化,这篇文章就介绍pandas里面的数 ...

  8. MongoDB 学习笔记2----条件操作符

    条件操作符:用于两个比较两个表达式并从mongdb中获取文档 mongodb常见的操作符及解析说明 $lt:小于 example:ago<20 $lte:小于等于 example:<=20 ...

  9. 2018牛客网暑期ACM多校训练营(第一场) J - Different Integers - [莫队算法]

    题目链接:https://www.nowcoder.com/acm/contest/139/J 题目描述  Given a sequence of integers a1, a2, ..., an a ...

  10. JavaScript学习12.1

    JavaScript弹窗可以创建3种消息框:警告框.确认框.提示框,可以不带window对象直接使用相应的方法警告框:保护用户可以得到某些信息,当出现警告框后需要用户点击确认按钮之后才能操作windo ...