龙空技术网

Cobbler是否比kickstart好用一些,快来试试

兰亭溪山 177

前言:

现在兄弟们对“centoskickstart”大约比较珍视,咱们都想要了解一些“centoskickstart”的相关知识。那么小编也在网摘上收集了一些有关“centoskickstart””的相关资讯,希望姐妹们能喜欢,同学们快快来了解一下吧!

对比Kickstart复杂配置Cobbler能做到什么?

Welcome to Cobbler!

Cobbler is a Linux installation server that allows for rapid setup of network installation environments. It glues together and automates many associated Linux tasks so you do not have to hop between many various commands and applications when deploying new systems, and, in some cases, changing existing ones. Cobbler can help with provisioning, managing DNS and DHCP, package updates, power management, configuration management orchestration, and much more.

总体的意思是说我可以帮助提供、管理DNS和DHCP、包更新、电源管理、配置管理编排等等,看起来很强大于是就试试。

思路1,ks 文件2,Cobbler托管DHCP服务器 3,TFTP服务器 4,Http服务器 5,Cobbler导入镜像6,从网络启动安装系统安装准备

1,安装前需要安装yum源

[root@localhost ~]# wget -O /etc/yum.repos.d/epel.repo 

2,安装必要服务

[root@localhost ~]# yum install cobbler cobbler-web dhcp xinetd tftp-server pykickstart httpd -y 

3,配置DHCP

[root@localhost ~]# vim /etc/dhcp/dhcpd.conf [root@localhost ~]# cd /usr/share/doc/dhcp-4.2.5/[root@localhost dhcp-4.2.5]# cp dhcpd.conf.example /etc/dhcp/dhcpd.conf cp: overwrite ‘/etc/dhcp/dhcpd.conf’? yes[root@localhost dhcp-4.2.5]# vim /etc/dhcp/dhcpd.confsubnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.220 192.168.0.230; option subnet-mask 255.255.255.0; next-server 192.168.0.30; filename "pxelinux.0";}
启动必要服务
[root@localhost ~]# systemctl start httpd[root@localhost ~]# systemctl enable httpd[root@localhost ~]# systemctl start cobblerd[root@localhost ~]# systemctl enable cobblerd[root@localhost ~]# systemctl status cobberd[root@localhost ~]# systemctl restart httpd[root@localhost ~]#systemctl start xinetd[root@localhost ~]#systemctl enable xinetd
启动Cobbler并排查问题
[root@localhost ~]# 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.

解决问题

修改/etc/cobbler/settings可以解决第一和第二步

[root@localhost ~]# vim /etc/cobbler/settings

修改内容如下:

101 default_password_crypted: "$1$Pa55w.rd$kLcAYzCCb/3wjad9QI17l0"

242 manage_dhcp: 1

272 next_server: 192.168.0.30

384 server: 192.168.0.30

生成密码使用openssl加密

[root@localhost ~]# openssl passwd -1 -salt 'Pa55w.rd' 'Pa55w.rd'

$1$Pa55w.rd$kLcAYzCCb/3wjad9QI17l0

解决第三步:

[root@localhost ~]# vim /etc/xinetd.d/tftp

disable = no

解决第四步:使用cobbler get-loaders。

[root@localhost ~]#cobbler get-loaders

配置DHCP服务并开启同步服务

[root@localhost ~]# systemctl start rsyncd.service[root@localhost ~]# systemctl enable rsyncd.service[root@localhost ~]# cd /etc/cobbler/[root@localhost cobbler]# vim /etc/cobbler/dhcp.templatesubnet 192.168.0.0 netmask 255.255.255.0 { option routers 192.168.0.1; option domain-name-servers 192.168.0.1; option subnet-mask 255.255.255.0; range dynamic-bootp 192.168.0.200 192.168.0.220;[root@localhost cobbler]# cobbler sync
导入镜像

[root@localhost cobbler]# cobbler import --path=/mnt/ --name=CentOS-7.5-x86_64 --arch=x86_64

上传cfg文件

[root@localhost cobbler]#cd /var/lib/cobbler/kickstarts/

[root@localhost cobbler]#rz #使用rz工具上传

查看cobbler list

[root@localhost cobbler]# cobbler list

[root@localhost cobbler]# cobbler profile report

修改默认参数,启动文件、内核、网卡参数

[root@localhost ~]# cobbler profile edit --name=CentOS-7.5-x86_64 --kickstart=/var/lib/cobbler/kickstarts/CentOS-7.5-x86_64.cfg

该内核参数

[root@localhost ~]# cobbler profile edit --name=CentOS-7.5-x86_64 --kopts='net.ifnames=0 biost.ifnames=0 biosdevname=0

最后同步cobbler文件

[root@localhost cobbler]# cobbler sync

开启另外一台虚拟机准备开始网络安装

准备虚拟机经过如下图:

总结

1,安装cobbler 将文件CentOS-7.5-x86_64.cfg上传至/var/lib/cobbler/kickstarts目录下。

2,DHCP配置后还需要在Cobbler来配置托管DHCP服务。

3,Cobbler导入镜像时文件名不能有空格,如:CentOS 7-5,这样是不可以的,可以是CentOS-7.5-x86_64.cfg。

4,CentOS-7.5-x86_64.cfg可以参考anaconda-ks.cfg ,如果你不想该该这个文件,你可以关注我,然后私信我“CentOS-7.5-x86_64.cfg”,我会把这个文件发给各位。

5,最后欢迎您的留言评论,谢谢!

标签: #centoskickstart