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

[经验分享] Centos7.4下安装cobbler详解

[复制链接]

尚未签到

发表于 2019-2-16 10:58:08 | 显示全部楼层 |阅读模式
  官方源下:
yum install epel-release -y  //安装epel源


-------------------正式部署--------------------------------------------
安装相关服务:
yum install cobbler cobbler-web dhcp tftp-server pykickstart httpd rsync xinetd -y
示例:
vi /etc/cobbler/settings       //修改主配置文件
next_server: 127.0.0.1   //指定PXE位置
server: 127.0.0.1        //声明服务器地址
manage_dhcp: 1                 //管理dhcp启动
在下面统一修改:
-----
systemctl start httpd.service
systemctl start cobblerd.service
systemctl stop firewalld.service      //关闭防火墙
setenforce 0                          //关闭增强安全功能
-----
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 : 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
4 : change 'disable' to 'no' in /etc/xinetd.d/tftp
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文件
server:192.168.80.18
next_server:192.168.80.18
manage_dhcp:1
第二步:
cobbler get-loaders                //下载引导操作系统文件
第三步:
vi /etc/xinetd.d/tftp
disable   = no     //启用
第四步:
openssl passwd -1 -salt 'abc123' 'abc123'    //盐值加密
$1$abner$kDle2KnwbPHdm1UZEE79V.        //加密结果
继续回settings文件中
default_password_crypted: "$1$abner$kDle2KnwbPHdm1UZEE79V."    //粘贴
保存退出settings文件
-----
systemctl start rsyncd.service      
systemctl start xinetd.service     
systemctl restart cobblerd.service
-----
vi /etc/cobbler/dhcp.template       //cobbler控制的dhcp服务模板
subnet 192.168.80.0 netmask 255.255.255.0 {
option routers             192.168.80.1;     //修改网关
option domain-name-servers 192.168.80.2;     //修改DNS
option subnet-mask         255.255.255.0;
range dynamic-bootp        192.168.235.100 192.168.235.200;   //修改地址池
cobbler sync       //帮助同步生成DHCP配置文件
systemctl restart dhcpd.service    //启动dhcpd服务
使用cobbler check 再次检查:
再次检查---------------------------------------------------------------------------------------------------
下面三条可以忽略不去处理
1 : 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
2 : debmirror package is not installed, it will be required to manage debian deployments and repositories
3 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
-----
/var/log/cobbler/cobbler.log   //日志文件所在位置
cobbler import --path=/mnt/ --name=CentOS-7-x86_64 --arch=x86_64  //导入iso镜像
/var/www/cobbler/ks_mirror/CentOS-7-x86_64        //默认导入存放位置
cobbler list     //查看导入结果
cobbler distro list   //查看发行版本
-----
cobbler profile report         //查看所有镜像文件参数信息
编辑profile文件,修改参数:
** cobbler profile edit --CentOS-7-x86_64 --跟上需要改的参数名称=内容  **               
/var/lib/cobbler/kickstarts/sample_end.ks    //ks默认文件存放位置
vi /etc/cobbler/pxe/pxedefault.template    //修改装机界面提示
-----
重启所有服务:
systemctl restart cobblerd.service
systemctl restart httpd.service
systemctl restart dhcpd.service
systemctl restart xinetd.service
systemctl restart rsyncd.service
-----
可新建一个空虚拟机,网卡与服务器绑同一块,直接开机安装
注意:内存2G,硬盘40G  否则会报错!
客户端安装完成后只具备字符界面  登录账户  root   密码abc123
个性化定制安装:
cobbler system add --help查看可加选项
--name=centos7-1
--mac=(查看新机网卡mac地址)
--profile=CentOS-7-x86_64
--ip-address=192.168.80.10
--subnet=255.255.255.0
--gateway=192.168.80.1
--interface=ens33
--static=1
--hostname=www.aa.com
--name-servers=2.2.2.2 3.3.3.3



运维网声明 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-673063-1-1.html 上篇帖子: centos7 清除root密码 下篇帖子: 使用KickStart进行CentOS7.4 的自动部署安装
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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

扫描微信二维码查看详情

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


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


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


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



合作伙伴: 青云cloud

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