cobbler

pex的二次封装,由Python开发,提供CLI和Web管理,cobbler在epel源中,安装时需要配置epel源。

工作原理:

1、client裸机配置了从网络启动后,开机后会广播包请求DHCP服务器(cobbler server)发送其分配好的一个IP

2、DHCP服务器(cobbler server)收到请求后发送responese,包括其ip地址

3、client裸机拿到ip后再向cobbler server发送请求OS引导文件的请求

4、cobbler server告诉裸机OS引导文件的名字和TFTP server的ip和port

5、client裸机通过上面告知的TFTP server地址通信,下载引导文件

6、client裸机执行执行该引导文件,确定加载信息,选择要安装的os,期间会再向cobbler server请求kickstart文件和os image

7、cobbler server发送请求的kickstart和os iamge

8、client裸机加载kickstart文件

9、client裸机接收os image,安装该os image

配置文件:

/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常用命令:

cobbler check 核对当前设置是否有问题

cobbler list 列出所有的cobbler元素

cobbler report 列出元素的详细信息

cobbler sync 同步配置到数据目录,更改配置最好都要执行下

cobbler reposync 同步yum仓库

cobbler distro 查看导入的发行版系统信息

cobbler system 查看添加的系统信息

cobbler profile 查看配置信息

cobbler profile report --name=xxxx 查看ks文件的详细信息

例:配置cobbler服务器

环境:主机IP:192.168.2.3  ,epel 源

一、安装前需要的服务

[root@centos7 ~]# yum install cobbler dhcp
[root@centos7 ~]# systemctl enable cobblerd dhcpd httpd tftp
[root@centos7 ~]# systemctl start cobblerd httpd tftp

二、检查环境,按照提示的错误修改对应 文件

[root@centos7 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. #修改配置文件中server参数为自己的主机IP
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. #修改配置文件中next_server指向tftp服务器,这里我也指向自己的IP
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 #将selinux关闭
4 : change 'disable' to 'no' in /etc/xinetd.d/tftp #将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. #执行cobbler get-loaders下载启动引导的文件
6 : enable and start rsyncd.service with systemctl #启动rsync服务
7 : debmirror package is not installed, it will be required to manage debian deployments and repositories #安装支持deb包的组件,现在安装CentOS不需要此组件
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 #修改配置文件中password的参数为自己指定的安装完系统后的root密码
9 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them #fencing设备的配置Restart cobblerd and then run 'cobbler sync' to apply changes.

具体修改情况如下

将配置文件中的server服务器IP改为本机IP   line384

vim /etc/cobbler/settings

修改配置文件中的net_server 指向tftp 服务器,这里我指向自己的IP,因为自己是tftp服务器   line272

运行下图中划红色下划线标注的命令,下载引导启动文件

重新用MD5生成一个口令,替换原来的cobbler口令    nine 101

利用cobbler自动 设置dhcp服务    line 242

接下来重启cobbler 服务

[root@centos7 cobbler]#systemctl restart cobblerd

这时我们来观察一下dhcp 的配置文件并没有生成

[root@centos7 tftpboot]#ls /etc/dhcp/dhcpd.conf

三、在/etc/cobbler/下有个 dhcp.templlte模板文件 我们用vim编辑它,就会自动生成一个dhcp配置文件

[root@centos7 tftpboot]#vim /etc/cobbler/dhcp.template 

四、cobbler  sync 同步一下设置, 查看dhcp端口有没有开启

五、在mnt目录下 创建cdrom 和 cdrom2 文件夹  将 centos7 和 centos6 挂载上去

六、我们需要将发行版的源和ks文件导入发行版,过程较慢,要确保硬盘有足够的空间

查看一下大小(由于之前做了PXE安装,已经有7的系统,所以文件较大)

[root@centos7 ~]#du -sh /var/www
12G    /var/www[root@centos7 tftpboot]#cobbler distro listCentos-6.9-x86_64

七、再次确认好所有服务启动以后开始安装系统,添加一台干净的虚拟机,开始安装

转载于:https://www.cnblogs.com/huxiaojun/p/9093506.html

Linux九阴真经之九阴白骨爪残卷4(cobbler)相关推荐

  1. Linux九阴真经之九阴白骨爪残卷2(SSH)

    SSH ssh:安全的远程登录 两种方式的用户登录认证 基于passwork 基于key 客户端 常见的客户端工具有:Windows版的putty.securecrt.xshell:linux中有ss ...

  2. Linux九阴真经之九阴白骨爪残卷3(自动化运维之系统安装)

    安装程序 CentOS系统安装 系统启动流程: bootloader-->kernel(initramfs)-->rootfs-->/sbin/init anaconda: 系统安装 ...

  3. Linux九阴真经之九阴白骨爪残卷5(ansible用法二之Playbook和YAML语法)

    playbook是由一个或多个"play"组成的列表 play的主要功能在于将事先归并为一组的主机装扮成事先通过ansible中的task定义好的角色.从根本上来讲,所谓task无 ...

  4. Linux九阴真经之九阴白骨爪残卷3(DHCP、TFTP服务的安装与启动以及PXE安装Centos7)...

    DHCP实现 一.首先准备两台linux,一台做dhcp服务器,另一台做客户端(将服务器的桥接网卡禁用),并取消虚拟机的HPC服务 二.将服务器端的IP设置为静态IP,取消DHCP服务(不写默认为取消 ...

  5. Linux九阴真经之九阴白骨爪残卷12(日志功能)

    一.事务日志 transaction log:事务型存储引擎自行管理和使用 在一个事务提交后还没有存到磁盘的情况下会记录到事务日志,这个时候如果系统断电,再次开机后会自动将已提交的事务重做(redo ...

  6. Linux九阴真经之九阴白骨爪残卷13(LVM的备份还原,恢复最新状态)

    一.备份策略 1.备份的类型 类型1: 热备份:读写不受影响(MyISAM不支持热备,InnoDB支持热备) 温备份:仅可以执行读操作 冷备份:离线备份,读写操作均中止 类型2: 物理备份:复制数据文 ...

  7. Linux九阴真经之九阴白骨爪残卷15

    一.MySQL复制相关概念 1.主从复制:主节点将数据同步到多个从节点 2.级联复制:主节点将数据同步到一个从节点,其他的从节点在向从节点复制数据 3.同步复制:将数据从主节点全部同步到从节点时才返回 ...

  8. Linux九阴真经之九阴白骨爪残卷16

    一.加密传输复制的实现 在默认的主从复制过程或远程连接到MySQL/MariaDB所有的链接通信中的数据都是明文的,外网里访问数据或则复制,存在安全隐患.通过SSL/TLS加密的方式进行复制的方法,来 ...

  9. Linux九阴真经之九阴白骨爪残卷14(备份和恢复)

    备份还原案例 前提:log_bin=ON 一.早上上班后误删数据库,如何恢复最新状态 1.假设早上已经完成备份 (开启二进制),然后在students表里新增了一条数据 [root@centos7 ~ ...

最新文章

  1. 关于计算机网络传输介质 下列叙述正确的是,《计算机基础》习题1-7
  2. SVN Access Manager 0.5.5.14 发布 - SVN 管理工具
  3. php四则运算出题器_四则运算出题器3
  4. linux虚拟地址被大量占用,《Linux中为什么要使用虚拟地址》
  5. Nginx常见配置:负载均衡、限流、缓存、黑名单和灰度发布
  6. java it_关于 Java Iterator(迭代器)学习笔记
  7. 6 PP配置-生产主数据-工作中心相关-工作中心标准值参数
  8. Qt4_使用窗体编辑记录
  9. 設置Linux保留物理內存並使用 (1)
  10. java asm methodvisitor 定义局部变量_Java ASM3学习(3)
  11. B站又出事了,遭几大平台联合谴责
  12. AutoItLibrary
  13. 全桥逆变电路MOS管的关断尖峰怎么解决
  14. 关于RIGOL可编程电源连接说明(网口连接)
  15. 【crossbeam系列】3 crossbeam-deque:work-stealing算法
  16. c语言输出n转义字符串,C语言转义字符介绍和示例
  17. webaudio_WebAudio Deep Note,第5部分:增益节点
  18. java为什么计算时间从1970年1月1日开始
  19. WMI使用小工具——WMI代码生成器(转)
  20. 棋牌开发需要注意哪些事项

热门文章

  1. ps笔刷:肮脏污渍photoshop笔刷集
  2. 最重要的技术深入学习
  3. 如何有效学习通过PMP考试?
  4. 计算机语言翻译的情诗,经典唯美爱情诗句的英文翻译
  5. 木门工厂老板诉说木门行业痛点!厂家必看
  6. 20135115臧文君---实验3
  7. springboot怎么获取token
  8. 如何写简历?写简历需要注意什么?
  9. 算法之牛顿法求平方根+立方根
  10. 读书笔记(八)--货币战争金权天下