@mrz1
2018-01-16T09:33:58.000000Z
字数 4372
阅读 965
自动化
cobbler 介绍
安装包(dhcp httpd tftp-server 开机启动)
yum install cobbler cobbler-web (基于EPEL源)
cobbler 服务集成
PXE
DHCP
rsync(不需要可以不安装)
Http
DNS(不需要可以不安装)
Kickstart(不需要可以不安装)
IPMI 电源管理(不需要可以不安装)
检查cobbler环境
cobbler check
光盘需要取消挂载(之后再挂上)
[root@centos7 ~]#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): //这种重启httpd服务
[root@centos7 ~]#systemctl restart httpd
[root@centos7 ~]#systemctl status httpd
[root@centos7 ~]#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
8 : 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.
执行Cobbler check报错解决方式
1. 修改/etc/cobbler/settings文件中的server参数的值为提供cobbler服务的主机相应的IP地址或主机名(自己的ip 384行)
2. 修改/etc/cobbler/settings文件中的next_server参数的值为提供PXE服务的主机相应的IP地址(自己的ip 272行)
3.change 'disable' to 'no' in /etc/xinetd.d/tftp centos7不用管
4. 如果当前节点可以访问互联网,执行“cobbler get-loaders”命令即可;否则,需要安装syslinux程序包,而后复制/usr/share/syslinux/{pxelinux.0,memu.c32}等文件至/var/lib/cobbler/loaders/目录中
5 enable and start rsyncd.service with systemctl 用不到不用管
6 debian系统 不用管
7. 执行"openssl passwd -1"生成密码,
并用其替换/etc/cobbler/settings文件中default_password_crypted参数的值
8.也不用管 集群相关
修改 /etc/cobbler/dhcp.tempplate 网段地址范围等 变量不用动执行cobbler sync 同步一下就行 默认dhcp启动
生成yum源 先挂载两张centos6、7盘在复制两张盘
cobbler import --path=/mnt/centos7/ --name=Centos-7.4
cobbler import --path=/mnt/centos6/ --name=Centos-6.9
复制完成就可以安装了
之后自己修改根据自己的需求配置应答文件
url --url=$tree 这里使用变量
执行此命令把启动把自己弄得菜单加入
cobbler profile add --name=Centos-6.9-x86_64_desktop --distro=Centos-6.9-x86_64 --kickstart=/var/lib/cobbler/kickstarts/ks6-desktop.cfg
简析:--name 列表的名字
--distroy yum源
--kickstart 你自己写的应答文件路径
--arch=x86_64 架构 可加可不加
cobbler commands介绍
cobbler check 核对当前设置是否有问题
cobbler list 列出所有的cobbler元素
cobbler report 列出元素的详细信息
cobbler sync 同步配置到数据目录,更改配置最好都要执行下
cobbler reposync 同步yum仓库
cobbler distro 查看导入的发行版系统信息
cobbler system 查看添加的系统信息
cobbler profile 查看配置信息
[root@centos7 kickstarts]#cobbler profile list (启动菜单列表)
Centos-6.9-x86_64
Centos-6.9-x86_64_desktop
Centos-7.4-x86_64
Centos-7.4-x86_64_desktop
[root@centos7 kickstarts]#cobbler distro list(查看yum源)
Centos-6.9-x86_64
Centos-7.4-x86_64
/etc/cobbler/settings中重要的参数设置
default_password_crypted: "$1$gEc7ilpP$pg5iSOj/mlxTxEslhRvyp/"
manage_dhcp:1
manage_tftpd:1
pxe_just_once:1 下次在重装默认不会安装(怕覆盖你系统)
next_server:< tftp服务器的IP 地址>
server:<cobbler服务器的IP 地址>
[root@centos7 tftpboot]#cd /var/lib/tftpboot/ |tree
.
├── boot
│ └── grub
│ └── menu.lst
├── etc
├── grub
│ ├── efidefault
│ ├── grub-x86_64.efi
│ ├── grub-x86.efi
│ └── images -> ../images
├── images
│ ├── Centos-6.9-x86_64
│ │ ├── initrd.img
│ │ └── vmlinuz
│ └── Centos-7.4-x86_64
│ ├── initrd.img
│ └── vmlinuz
├── images2
├── memdisk
├── menu.c32
├── ppc
├── pxelinux.0
├── pxelinux.cfg
│ └── default
├── s390x
│ └── profile_list
└── yaboot
[root@centos7 kickstarts]#cd /var/lib/cobbler/kickstarts|tree
.
├── default.ks
├── esxi4-ks.cfg
├── esxi5-ks.cfg
├── install_profiles
│ ├── machine.AA00FFCC1100-example
│ └── README
├── ks6-desktop.cfg //自己后来添加进来的
├── ks7-desktop.cfg //自己后来添加进来的
├── legacy.ks
├── pxerescue.ks
├── sample_autoyast.xml
├── sample_end.ks
├── sample_esx4.ks
├── sample_esxi4.ks
├── sample_esxi5.ks
├── sample_esxi6.ks
├── sample.ks
├── sample_old.seed
└── sample.seed