关闭 selinux
安装
rpm -ivh https://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm
yum makecache
yum -y install httpd tftp dhcp cobbler cobbler-web pykickstart xinetd
(如果执行不了,就手动敲一下,因为复制的有格式,可能识别不了)
开启服务并配置
启动apache
systemctl start httpd
systemctl enable httpd
启动cobbler
systemctl start cobblerd
systemctl enable cobblerd
关闭防火墙
systemctl stop firewalld
systemctl enable firewalld
检查cobbler
cobbler check
现在只需把上面的提示的几点做修改即可
修改 vim /etc/cobbler/settings
第一个
把这个IP修改成本机IP
第二个
把这个IP修改成本机IP
vim /etc/xinetd.d/tftp
将disable设置为no
开启tftp
systemctl start tftp
systemctl enable tftp
执行 cobbler get-loaders 命令
启动rsyncd服务
systemctl start rsyncd.service
systemctl enable rsyncd.service
生成加密密码(这个密码是客户机自动安装系统之后的登录密码)
openssl passwd -1 -salt 'cobbler' 'cobbler'
复制生成的密码
vim /etc/cobbler/settings
将生成的密码写入default_password_crypted
yum -y install cman fence-agents pykickstart
systemctl restart cobblerd
配置dhcp
vim /etc/cobbler/settings
将manage_dhcp的值改成1
修改dhcp的模板文件
vim /etc/cobbler/dhcp.template
同步cobbler
cobbler sync
管理cobbler
mount /dev/cdrom /mnt/ #挂在ISO光盘至服务器
导入镜像文件
cobbler import --path=/mnt/ --name=CentOS-7.6-x86_64 --arch=x86_64
# --path 镜像路径
# --name 为安装源定义一个名字
# --arch 指定安装源是32位、64位、ia64, 目前支持的选项有: x86│x86_64│ia64
镜像存放目录,cobbler会将镜像中的所有安装文件拷贝到本地一份,放在/var/www/cobbler/ks_mirror下的CentOS-7.1-x86_64-distro-x86_64目录下。因此/var/www/cobbler目录必须具有足够容纳安装文件的空间。
管理profile
cobbler profile
列出导入的镜像
cobbler profile list
cobbler profile report 查看profile的内容
每次添加镜像后都要同步一下
cobbler sync
systemctl restart cobblerd
cobbler部署操作系统
客户机开机从pxe启动
选择镜像,回车,等一会就安装好了,密码是你设置加密的那个cobbler
备注:在cobbler主机上查看日志,可以通过messages看到需要安装主机的信息
tail -f /var/log/messages
kickstart文件制作
原文链接:centos7.6上部署cobbler搭建pxe服务端,转载请注明来源!