cobbler网络装机

cobbler网络装机

Cobbler是一个Linux服务器安装的服务,可以通过网络启动(PXE)的方式来快速安装、重装物理服务器和虚拟机,同时还可以管理DHCPDNS等。

Cobbler可以使用命令行方式管理,也提供了基于Web的界面管理工具(cobbler-web),还提供了API接口,可以方便二次开发使用。
3、Cobbler是较早前的kickstart的升级版,优点是比较容易配置,还自带web界面比较易于管理。
4、Cobbler内置了一个轻量级配置管理系统,但它也支持和其它配置管理系统集成,如Puppet

img

设置CentOS 7.6 服务端

[root@localhost opt]# yum -y install epel*	安装软件源[root@localhost ~]# yum -y install cobbler	安装需要用到的软件[root@localhost ~]# yum -y install cobbler-web dhcp tftp-server pykickstart httpd rsync xinetd	            安装所需软件[root@localhost ~]# cd /etc/cobbler	===>进入该目录[root@localhost ~]# vim settings	===>主配置文件(包含dhcp,tftp等等)......next_server: 192.168.136.10	===>指向自己......server:  192.168.136.10 ===>指向自己......manage_dhcp: 1	===>开启dhcp......[root@localhost cobbler]# systemctl start httpd	===>启动服务[root@localhost cobbler]# systemctl start cobblerd.service 	===>启动服务[root@localhost cobbler]# systemctl stop firewalld	===>关闭防火墙[root@localhost cobbler]# setenforce 0	===>关闭核心防护[root@localhost cobbler]# cobbler check	===>检测一下(下面的1-3项可以忽略不处理)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[root@localhost cobbler]# vim /etc/xinetd.d/tftp	===>修改tftp配置文件......disable                 = no.....[root@localhost cobbler]# systemctl enable rsyncd.service	===>启用服务[root@localhost cobbler]# systemctl restart cobblerd.service 	===>重启一下服务[root@localhost cobbler]# cobbler check	===>可以在检查一下还需要做哪些操作[root@localhost cobbler]# openssl passwd -1 -salt '123456' '123456'	===>设置密码$1$123456$wOSEtcyiP2N/IfIl15W6Z0[root@localhost cobbler]# vim /etc/cobbler/settings	===>修改主配置文件......default_password_crypted: "$1$123456$wOSEtcyiP2N/IfIl15W6Z0"	===>管理员密码......[root@localhost cobbler]# systemctl start rsyncd	===>启动服务[root@localhost cobbler]# systemctl start xinetd	===>启动服务[root@localhost cobbler]# cd /etc/cobbler/	===>进入该目录[root@localhost cobbler]# ls
auth.conf               ldap            secondary.template
cheetah_macros          modules.conf    settings
cobbler_bash            mongodb.conf    tftpd.template
completions             named.template  users.conf
dhcp.template           power           users.digest
dnsmasq.template        pxe             version
genders.template        reporting       zone.template
import_rsync_whitelist  rsync.exclude   zone_templates
iso                     rsync.template[root@localhost cobbler]# vim dhcp.template	===>修改配置文件......subnet  192.168.136.10 netmask 255.255.255.0 {......​     option routers              192.168.136.1;​     option domain-name-servers  192.168.136.2;......​     range dynamic-bootp        20.0.0.100 20.0.0.200;......[root@localhost cobbler]# cobbler sync	===>进行同步[root@localhost cobbler]# cobbler get-loaders	===>下载软件(需要联网)[root@localhost cobbler]# systemctl restart dhcpd	===>开启服务[root@localhost cobbler]# systemctl restart cobblerd.service 	===>开启服务[root@localhost cobbler]# systemctl restart xinetd.service 	===>开启服务[root@localhost cobbler]# cobbler check	===>重新在检测看一下
The following are potential configuration items that you may want to fix: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 themRestart cobblerd and then run 'cobbler sync' to apply changes.[root@localhost cobbler]# vim /var/log/cobbler/cobbler.log	===>日志文件所在位置[root@localhost cobbler]# mount /dev/cdrom /mnt	===>挂载镜像文件mount: /dev/sr0 写保护,将以只读方式挂载[root@localhost cobbler]# cobbler import --path=/mnt/ --name=CentOS-7-x86_64 --arch=x86_64	===>定义路径名字   将镜像文件导入[root@localhost cobbler]# cobbler list	===>查看列表
distros:CentOS-7-x86_64profiles:CentOS-7-x86_64systems:repos:images:mgmtclasses:packages:files:[root@localhost cobbler]# yum -y install tree	===>安装一下软件[root@localhost cobbler]# tree /var/lib/tftpboot/images	===>查看内核文件跟引导程序[root@localhost cobbler]# systemctl restart cobblerd.service 	===>重新启动下服务[root@localhost cobbler]# systemctl restart dhcpd.service  	===>重新启动下服务[root@localhost cobbler]# systemctl restart xinetd.service  	===>重新启动下服务[root@localhost cobbler]# systemctl restart httpd.service 	===>重新启动下服务

在同一网段开始装机

添加管理用户用web访问

[root@localhost cobbler]# htdigest -c /etc/cobbler/users.digest Cobbler binbin
Adding password for binbin in realm Cobbler.
New password:          输入你的密码
Re-type new password:   输入你的密码
[root@localhost cobbler]# systemctl restart cobblerd.service 	===>重启启动服务
[root@localhost cobbler]# systemctl restart httpd.service 	===>重启服务
你的密码
Re-type new password:   输入你的密码
[root@localhost cobbler]# systemctl restart cobblerd.service 	===>重启启动服务
[root@localhost cobbler]# systemctl restart httpd.service 	===>重启服务

``

image-20200720093619659


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部