首页技术文章正文

-Cobbler自动化安装系统1【黑马大数据培训】

更新时间:2022年12月21日 18时25分07秒 来源:黑马程序员论坛

黑马中级程序员课程

Cobbler 安装
基础部署约定基本情况
名称
详情
关闭服务
selinux
程序版本及配置文件位置
应用名称
版本
安装方式
配置文件目录
Cobbler
2.8.2
YUM
/etc/cobbler/settings
DHCP
4.2.5
YUM
/etc/cobbler/dhcpd.conf.template
Apache
2.4.6
YUM
/etc/httpd/conf.d/(cobbler.conf & cobbler_web.conf)
Xinetd
2.3.15
YUM
/etc/xinetd.conf
TFTP
5.2-13
YUM
/etc/xinetd.d/tftp
pykickstart
1.99.66
YUM
-
备注:Centos 6 中,Cobbler版本为2.6了
YUM源配置
Centos 6
#clean OS default repo
mkdir /etc/yum.repos.d/old && mv /etc/yum.repos.d/C* /etc/yum.repos.d/old/yum clean all
#add extend repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
Centos 7
#clean OS default repomk
dir /etc/yum.repos.d/old && mv /etc/yum.repos.d/C* /etc/yum.repos.d/old/yum clean all
#add extend repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
Cobbler服务部署YUM安装服务 yum install cobbler cobbler web dhcp tftp-server pykickstart httpd xinetd -y 增加服务到自启动 Centos 6 命令 chkconfig httpd onchkconfig xinetd onchkconfig dhcpd onchkconfig tftp onchkconfig cobblerd on
Centos 7 命令
systemctl enable httpdsystemctl enable xinetdsystemctl enable rsyncdsystemctl enable tftpsystemctl enable cobblerd 启动相关服务
Centos 6 命令
/etc/init.d/httpd restart/etc/init.d/xinetd restart/etc/init.d/cobblerd restart/etc/init.d/dhcpd restart
Centos 7 命令
systemctl start httpdsystemctl start xinetdsystemctl start tftpsystemctl start cobblerd 执行cobbler check [root@cobbler yum.repos.d# cobbler checkThe 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 themRestart cobblerd and then run 'cobbler sync' to apply changes. 先解决问题1、2、7 生成新的默认密码 openssl passwd -1 -salt `openssl rand 15 -base64` '123qwe!@#'$1$V0M16k3j$XMyrGlBjyCk1q.MZxQlBl. 修改setting配置文件 #sed -i 's%server: 127.0.0.1%server: 192.168.0.238%g' /etc/cobbler/settingssed -i 's%^server: 127.0.0.1%server: 192.168.0.238%g' /etc/cobbler/settingssed -i 's%^next_server: 127.0.0.1%next_server: 192.168.0.238%g' /etc/cobbler/settingssed -i 's%manage_dhcp: 0%manage_dhcp: 1%g' /etc/cobbler/settingssed -i 's%^default_password_crypted.*%default_password_crypted: "$1$V0M16k3j$XMyrGlBjyCk1q.MZxQlBl."%g' /etc/cobbler/settings
备注:cobbler为系统安装后设置的密码,请配置强密码!
配置DHCP(根据需求更改) dhcp_conf=`grep -n "subnet 192" /etc/cobbler/dhcp.template|awk -F':' '{print $1}'`sed -i '/192.168/d' /etc/cobbler/dhcp.templatesed -i '/255.255.255.0/d' /etc/cobbler/dhcp.templatesed -i "21 i\subnet 192.168.0.0 netmask 255.255.255.0 { " /etc/cobbler/dhcp.templatesed -i "22 i\ option routers 192.168.0.1; " /etc/cobbler/dhcp.templatesed -i "23 i\ option domain-name-servers 114.114.114.114; " /etc/cobbler/dhcp.templatesed -i "24 i\ option subnet-mask 255.255.255.0; " /etc/cobbler/dhcp.templatesed -i "25 i\ range 192.168.0.100 192.168.0.200; " /etc/cobbler/dhcp.template
注释:
option routers:路由地址option domain-name-servers:DNS服务器地址option subnet-mask:子网掩码range:DHCP地址范围range dynamic-bootp:为无盘工作站准备的 解决问题3,启动tftp服务 配置TFTP tftp_disable_conf=`grep -n disable /etc/xinetd.d/tftp|awk -F':' '{print $1}'`sed -i '/disable/d' /etc/xinetd.d/tftpsed -i "$tftp_disable_conf i\ disable = no" /etc/xinetd.d/tftp 解决问题5
Centos 6
rsync_disable_conf=`grep -n disable /etc/xinetd.d/rsync|awk -F':' '{print $1}'`sed -i '/disable/d' /etc/xinetd.d/rsyncsed -i "$rsync_disable_conf i\ disable = no" /etc/xinetd.d/rsync
备注:这个问题可以忽略,在Centos 6下未解决
Centos 7
systemctl enable rsyncd.service 解决问题4,可能解析失败,重新执行 cobbler get-loaders 问题8,待补充(真机电源管理) 问题6为deban包,不需要处理 重启cobbler服务并同步改变 systemctl restart cobblerd cobbler check

推荐了解热门学科

java培训 Python人工智能 Web前端培训 PHP培训
区块链培训 影视制作培训 C++培训 产品经理培训
UI设计培训 新媒体培训 软件测试培训 Linux运维
大数据培训 智能机器人软件开发




传智播客是一家致力于培养高素质软件开发人才的科技公司“黑马程序员”是传智播客旗下高端IT教育品牌。自“黑马程序员”成立以来,教学研发团队一直致力于打造精品课程资源,不断在产、学、研3个层面创新自己的执教理念与教学方针,并集中“黑马程序员”的优势力量,针对性地出版了计算机系列教材50多册,制作教学视频数+套,发表各类技术文章数百篇。

传智播客从未停止思考

传智播客副总裁毕向东在2019IT培训行业变革大会提到,“传智播客意识到企业的用人需求已经从初级程序员升级到中高级程序员,具备多领域、多行业项目经验的人才成为企业用人的首选。”

中级程序员和初级程序员的差别在哪里?
项目经验。毕向东表示,“中级程序员和初级程序员最大的差别在于中级程序员比初级程序员多了三四年的工作经验,从而多出了更多的项目经验。“为此,传智播客研究院引进曾在知名IT企业如阿里、IBM就职的高级技术专家,集中研发面向中高级程序员的课程,用以满足企业用人需求,尽快补全IT行业所需的人才缺口。

何为中高级程序员课程?

传智播客进行了定义。中高级程序员课程,是在当前主流的初级程序员课程的基础上,增加多领域多行业的含金量项目,从技术的广度和深度上进行拓展“我们希望用5年的时间,打造上百个高含金量的项目,覆盖主流的32个行业。”传智播客课程研发总监于洋表示。




黑马程序员热门视频教程

Python入门教程完整版(懂中文就能学会) 零起点打开Java世界的大门
C++| 匠心之作 从0到1入门学编程 PHP|零基础入门开发者编程核心技术
Web前端入门教程_Web前端html+css+JavaScript 软件测试入门到精通


分享到:
在线咨询 我要报名
和我们在线交谈!