author:JevonWei

版权声明:原创作品


cobbler 配置目录

配置文件目录 /etc/cobbler
/etc/cobbler/settings : cobbler 主配置文件
/etc/cobbler/iso/: iso 模板配置文件
/etc/cobbler/pxe: pxe 模板文件
/etc/cobbler/power: 电源配置文件
/etc/cobbler/user.conf: web 服务授权配置文件
/etc/cobbler/users.digest: web 访问的用户名密码配置文件
/etc/cobbler/dhcp.template : dhcp 服务器的的配置末班
/etc/cobbler/dnsmasq.template : dns 服务器的配置模板
/etc/cobbler/tftpd.template : tftp 服务的配置模板
/etc/cobbler/modules.conf : 模块的配置文件
数据目录
/var/lib/cobbler/config/: 用于存放distros,system,profiles 等信息配置文件
/var/lib/cobbler/triggers/: 用于存放用户定义的cobbler 命令
/var/lib/cobbler/kickstart/: 默认存放kickstart 文件
/var/lib/cobbler/loaders/: 存放各种引导程序
镜像目录
/var/www/cobbler/ks_mirror/: 导入的发行版系统的所有数据
/var/www/cobbler/images/ : 导入发行版的kernel 和initrd 镜像用于远程网络启动
/var/www/cobbler/repo_mirror/: yum 仓库存储目录
日志目录
/var/log/cobbler/installing: 客户端安装日志
/var/log/cobbler/cobbler.log : cobbler

配置cobbler

一、配置epel源yum仓库文件

cat service.repo
[base]
name=danran
baseurl=file:///mnt
enable=1
gpgcheck=0 [epel]
name=epel
baseurl=http://dl.fedoraproject.org/pub/epel/7/x86_64/
gpgcheck=0

二、安装程序包并启动服务

yum -y install cobbler
yum -y install dhcp
yum -y install httpd
systemctl enable cobblerd.service
systemctl start cobblerd.service
systemctl enable dhcpd
systemctl enable tftp
systemctl start tftp
systemctl enable httpd
systemctl start httpd
systemctl enable tftp
systemctl start tftp
firewall-cmd --add-service=http --permanent
firewall-cmd --add-service=dhcp --permanent
firewall-cmd --reload \\ 打开httpd的防火墙
setenforce 0
vim /etc/sysconfig/selinux ss -ntlp | grep cobbler \\查看cobbler服务的端口号
firewall-cmd --add-port=25151/tcp --permanent \\打开cobbler服务的端口号
firewall-cmd --reload

三、cobbler环境检查和配置

cobbler check  \\报错信息如下
httpd does not appear to be running and proxying cobbler, or SELinux is in the way. Original traceback:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cobbler/cli.py", line 251, in check_setup s.ping()
File "/usr/lib64/python2.7/xmlrpclib.py", line 1233, in __call__
return self.__send(self.__name, args)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1587, in __request
verbose=self.__verbose
File "/usr/lib64/python2.7/xmlrpclib.py", line 1273, in request return
self.single_request(host, handler, request_body, verbose)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1301, in single_request
self.send_content(h, request_body)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1448, in send_content
connection.endheaders(request_body)
File "/usr/lib64/python2.7/httplib.py", line 1013, in endheaders
self._send_output(message_body)
File "/usr/lib64/python2.7/httplib.py", line 864, in _send_output
self.send(msg)
File "/usr/lib64/python2.7/httplib.py", line 826, in send
self.connect()
File "/usr/lib64/python2.7/httplib.py", line 807, in connect
self.timeout, self.source_address)
File "/usr/lib64/python2.7/socket.py", line 571, in create_connection
raise err
error: [Errno 111] Connection refused systemctl restart cobblerd.service \\重新启动cobblerd.service
cobbler get-loaders cobbler check \\再次检查cobbler环境
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:SELinux is enabled. Please review the following wiki page for details on ensuring cobbler works correctly in your SELinux environment:
https://github.com/cobbler/cobbler/wiki/Selinux
4:change 'disable' to 'no' in /etc/xinetd.d/tftp
5: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.
6:enable and start rsyncd.service with systemctl
7:debmirror package is not installed, it will be required to manage debian deployments and repositories
8: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
9: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. 解决报错1
vim /etc/cobbler/settings
server: 192.168.198.131 \\383行左右
systemctl restart cobblerd.service

解决报错2(TFTP服务器)
vim /etc/cobbler/settings \\272行左右
next_server:192.168.198.131

解决报错3(禁用selinux)
setenforce 0
vim /etc/sysconfig/selinux
SELINUX=permissive

解决报错4(tftp服务开启)
systemctl enable tftp
systemctl start tftp
ss -utln \\查看tftp服务的端口是否打开

解决报错5(下载boot-loaders)
cobbler get-loaders
cobbler sync

解决报错8(增加用户口令)
openssl passwd -1 \\成为md5加密的口令

vim /etc/cobbler/settings
default_password_crypted: "$1$wzkQF.fE$CHpWUkntQxo3XHZ5bRsDI." \\将openssl passwd -1生成的密码口令粘贴到此处

systemctl restart cobblerd
cobbler check

四、配置dhcp

vim /etc/cobbler/settings
manage_dhcp: 1 \\1表示由cobbers自动配置dhcp配置文件

systemctl restart cobblerd
vim /etc/cobbler/dhcp.template\\配置相应的网段和IP范围
subnet 192.168.198.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.198.10 192.168.198.100;
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;

systemctl restart cobblerd
cobbler sync \\同步cobber数据
cat /etc/dhcp/dhcpd.conf \\查看dhcp的配置文件是否更改
systemctl restart dhcpd \\重启dhcp服务

五、导入系统光盘文件到cobbler

cobbler import --path=/mnt --name=centos7.3  \\centos7的光盘挂载在/mnt目录下,-name为指定光盘文件导入/vae/www/cobbler/ks_mirror后的名称
cobbler import --path=/mnt --name=centos6.9 \\将centos6.9的系统光盘文件导入到cobbler中,并存放在/vae/www/cobbler/ks_mirror

六、制作kickstart应答文件(/var/lib/cobbler/kickstarts/)

system-config-kickstart   \\制作kickstart应答文件
cp /root/centos7.cfg /var/lib/cobbler/kickstarts/ \\或复制应答文件到指定目录下
vim /var/lib/cobbler/kickstarts/ centos7.cfg
url --url==$tree \\$tree意为使用cobbler本身定义的根文件路径变量

cobbler distro list   \\显示导入系统版本信息
cobbler profile list \\显示导入系统时自动生成的应答文件
cobbler distro report --name=centos7.3-x86_64 显示指定版本的具体设置信息

cobbler profile add --name=centos7.3-custom --kickstart=/var/lib/cobbler/kickstarts/centos7.cfg --distro=centos7.3-x86_64 \\将*.cfg应答文件与系统版本关联起来,--name为关联后的ks应答文件名称,--distro指定操作系统版本
cobbler profile add --name=centos6.9-custom --kickstart=/var/lib/cobbler/kickstarts/centos7.cfg --distro=centos6.9-x86_64
cobbler profile del --name=centos6.9-custom \\删除centos6.9-custom的应答文件关联 cobbler profile report \\显示版本与cfg应答文件的详细信息
cobbler distro list
cobbler profile list

cat /var/lib/tftpboot/pxelinux.cfg/default   \\查看启动菜单是否自动更新

七、显示目录文件

pree /var/lib/tftpboot

八、客户端安装测试

cobbler的web管理

定义认证方法的配置文件:

/etc/cobbler/modules.conf  \\默认使用模块验证
module = authn_configfile \\默认配置文件验证
module = authn_pam \\使用pam模块认证

一、安装程序包

yum -y install cobbler-web.noarch
systemctl restart httpd
systemctl restart cobblerd

二、使用配置文件认证

创建cobbler用户
htdigest -c /etc/cobbler/users.digest Cobbler danran \\新建用户danran,添加第一个用户时,使用'-c'选项,后续添加其他用户时不需要再使用,cobbler-web的realm只能为Cobbler cat /etc/cobbler/users.digest \\记录了用户的账号

三、使用pam模块认证(读取的为linux系统本身的账号)

vim /etc/cobbler/users.conf
[admins]
admin = "jevon"
systemctl restart cobblerd.service

四、登录管理

https://192.168.198.131/cobbler_web
键入用户名和密码登录

cobbler实现自动安装的更多相关文章

  1. 基于 cobbler 实现自动安装 linux 系统

    使用 cobbler 实现自动安装 centos 6.7系统 1.yum install cobbler -y 安装 cobbler ,有依赖关系,会自动把 TFTP .HTTP 服务安装上:cobb ...

  2. cobbler无人值守自动安装

      无人值守安装(自动按定制的需求来批量安装linux系统) kickstart cobbler linux安装系统的方法: 1,光盘 把iso镜像刻录(windows下有类似nero这类软件)到光盘 ...

  3. cobbler自动安装系统

    一.简介 Cobbler是一个快速网络安装linux的服务,而且在经过调整也可以支持网络安装windows.该工具使用python开发,小巧轻便(才15k行python代码),使用简单的命令即可完成P ...

  4. PXE与cobbler实现系统自动安装

    安装操作系统的流程事实上并不复杂,如果你要给三五台服务器安装系统那么我们手工去安装即可.但是当我们要部署的是大型机房的操作系统的时候显然手动安装去一台一台的点,是不现实的.尤其现在互联网行业高速发展, ...

  5. Cobbler 自动安装CentOS7

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

  6. cobbler自动安装linux

    1- cobbler简介   cobbler是一个系统启动服务boot server,可以通过pxe得方式用来快速安装.重装系统,支持安装不同linux发行版和windows.   基于python开 ...

  7. kvm cobbler无人值守批量安装操作系统

    kvm cobbler无人值守批量安装操作系统 cobbler:一个自动网络安装系统的工具,集成PEX.dhcp.dns.tftpd.sync等服务.可以供大家管理安装操作系统 kvm:Linux系统 ...

  8. cobbler无人值守批量安装Linux系统

    本文目录: 1.1 pxe安装系统 1.2 cobbler基本介绍 1.3 安装和配置cobbler 1.3.1 安装cobbler 1.3.2 配置dhcp和tftp 1.4 cobbler从本地光 ...

  9. Cobbler全自动批量安装部署Linux系统

    说明: Cobbler服务器系统:CentOS 5.10 64位 IP地址:192.168.21.128 需要安装部署的Linux系统: eth0(第一块网卡,用于外网)IP地址段:192.168.2 ...

随机推荐

  1. 如何在github制作一个网页

    1.首先得先注册一个github账号,官网:https://github.com/ 2.注册完,登录账号进入首页,点右上角的 ‘+’ 创建新的仓库 3. 点击setting,选择一个主题, 4. 选完 ...

  2. 深入浅出数据结构C语言版(12)——从二分查找到二叉树

    在很多有关数据结构和算法的书籍或文章中,作者往往是介绍完了什么是树后就直入主题的谈什么是二叉树balabala的.但我今天决定不按这个套路来.我个人觉得,一个东西或者说一种技术存在总该有一定的道理,不 ...

  3. XRD 数据处理:使用 Origin 进行多谱图对比

    如果一个实验制备了 4 种不同条件下的样品,并分别测得了它们的 XRD 衍射谱图,那么在数据处理中如何用 Origin 软件得到一张多谱图对比的图呢? 样品间的谱图对比 如果只是谱图样品间对比(以 4 ...

  4. Tornado session 插件 pycket 定制时间和时间续租

    功能描述:10分钟用户没有任何操作,跳转到登录页面. 分析:这个功能用session就能实现(由于pycket 的session内容是存储在memcached或者redis里面的.所以,session ...

  5. ABP+AdminLTE+Bootstrap Table权限管理系统第七节--登录逻辑及abp封装的Javascript函数库

    经过前几节,我们已经解决数据库,模型,DTO,控制器和注入等问题.那么再来看一下登录逻辑.这里算是前面几节的一个初次试水. 首先我们数据库已经有的相应的数据. 模型和DTO已经建好,所以我们直接在服务 ...

  6. getComputedStyle方法获取元素CSS值

    javascript的style属性只能获取内联样式,对于外部样式和嵌入式样式需要用currentStyle属性.但是,currentStyle在FIrefox和Chrome下不支持,需要用getCo ...

  7. 【有意思的BUG】需要停止的进程

    用户操作的目的:将某网站的歌曲分享到朋友圈 用户遇到的问题:在朋友圈内,有2个入口可以播放该第三方的歌曲.但是这两个入口可以同时播放,音乐重叠了. 操作步骤: [1] 将歌曲分享到朋友圈 [2] 在朋 ...

  8. CSS3 基础(1)——选择器详解

    CSS3选择器详解 一. 属性选择器 在CSS3中,追加了三个属性选择器分别为:[att*=val].[att^=val]和[att$=val],使得属性选择器有了通配符的概念. 选择器 示例 描述 ...

  9. python 中self理解

    python类的方法和普通函数的区别--python中类的方法必须有一个额外的参数:self 假如创建一个新的类Myclass,类中有一个方法method(arg1,arg2),b实例化Myclass ...

  10. Python 第四天

    高级特性 切片操作符 我们可以使用切片操作符获取 tuple 或者 list 中指定范围内的元素 list1 = [1,2,3,4,5,8,7,6,10] list2 = [1:3] #[2.3] l ...