设为首页 收藏本站
查看: 690|回复: 0

[经验分享] cobbler配置要基于PXE 环境,cobbler是pxe环境的二次封装

[复制链接]

尚未签到

发表于 2017-11-22 23:44:27 | 显示全部楼层 |阅读模式
一:安装cobbler、httpd
yum install -y cobbler httpd
二:启动cobbler、httpd
systemctl start cobblerd.service
systemctl start httpd.service
三:创建cobbler的配置环境
cobbler check

四:解决报错信息
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

五:解决错误( 注意每一个问题解决要查看效果,需要重启cobblerd服务)

(1)解决第一个问题
这里需要将/etc/cobbler/settings这个文件中的server这一项的主机地址改为 server: 192.168.10.10

(2)解决第二个问题
这里需要将/etc/cobbler/settings这个文件中的next_server这一项的主机地址改为 next_server: 192.168.10.10

(3)解决第三个问题
启动rsync, 让其开机自启: systemctl start rsyncd.service,systemctl enable rsyncd.service

(4)解决第四个问题
在/etc/xinetd.d/tftp配置文件中修改 disable = no ,让tftp服务开机自启动 , 再重启tftp服务,systemctl start tftp.socket ,systemctl enable tftp.socket

(5)解决第五个问题
在/etc/cobbler/settings这个文件中的default_password_crypted: 后面的密码改掉,先创建一个用户,给这个用户设定密码,然后就将这个用户的密码贴在这个选项的后面就是

(6)解决第六个问题
yum install -y debmirror
将/etc/debmirror.conf文件的dists和arches那两行注释掉

(7)解决第七个问题
运行cobbler命令,下载对于的安装包
cobbler get-loaders

(8)解决第八个问题
yum install -y fence-agents

六:解决全部的cobbler配置问题之后,最后再重启cobbler,检查
systemctl restart cobblerd.service
cobbler check
No configuration problems found. All systems go

七:配置好dhcp、tftp之后,开始配置cobbler,(dhcp、tftp、服务的配置与PXE环境一样)
确保dhcp、tftp、httpd服务都已经启动

八:准备创建distro
(1)挂载centos 7的光盘镜像到/media/cdrom目录下
mount -r /dev/cdrom /media/cdrom/

(2)使用cobbler import 命令生成一个distro
cobbler import --name="CentOS-7_x86_64-1611" --path=/media/cdrom

(3)查看生成的cobbler distro
[iyunv@7 ks_mirror]# cobbler distro list
CentOS-7-1611-x86_64

(4)查看生成的cobbler profile
[iyunv@7 ks_mirror]# cobbler profile list
CentOS-7-1611-x86_64

(5)同步cobbler 或 重启
cobbler sync 或 systemctl restart cobblerd

(6)此时cobbler已经简单部署完毕,在内网192.168.10.0网段启动一个虚拟机,选择网卡启动,可以像PXE环境一样,可以直接安装系统了。

九:可以给安装的引导选项改名,就是给profile改名
cobbler profile rename --name=CentOS-7-1611-x86_64 --newname=RedHat-minimal

十:在/var/lib/cobbler/kickstarts/目录下拷贝sample_end.ks文件,命名为self.ks
cd /var/lib/cobbler/kickstarts/
cp sample_end.ks self.ks
修改一下self.ks文件,可以在里面修改自己自定义的设置,比如说:添加安装的包组

十一:基于现有的kickstart文件创建一个profile
cobbler profile add --name=RedHad-self --distro=CentOS-7-1611-x86_64 --kickstart=/var/lib/cobbler/kickstarts/self.ks

十二:查看profile
[iyunv@7 ~]# cobbler profile list
RedHad-minimal-self
RedHad-self

十三:同步一下,每一次修改完成都要做一次同步
cobbler sync

十四:启动一台机器,然后安装F12进入boot sequence选项,按 l 键选择LAN启动

十五:如果想删除一个profile
cobbler profile remove --name=RedHad-minimal-self
cobbler sync

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-409694-1-1.html 上篇帖子: Linux系统概述 下篇帖子: zabbix的数据库和服务的安装
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表