Cobbler是一个快速安装Linux系统的网络安装服务套件,集成了PXE、DHCP、DNS/Kickstart服务管理和yum仓库管理工具,通过PXE网络引导安装,配置简单。
部署准备:
关闭防火墙:service iptablesstop
关闭selinux:setenforce 0
安装epel源:rpm -ivh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
1、安装相关软件
[root@localhost ~]# yum install -y cobbler tftp dhcp httpdcman pykickstart
2、配置tftp-server和rsync
[root@localhost ~]# vi /etc/xinetd.d/tftp
disable = no #开启
[root@localhost ~]# vi /etc/xinetd.d/rsync
disable = no
[root@localhost ~]# /etc/init.d/xinetd restart
3、配置DHCP
[root@localhost ~]# vi /etc/dhcp/dhcpd.conf ddns-update-style interim; ignore client-updates; subnet 192.168.0.0 netmask 255.255.255.0 { range dynamic-bootp192.168.0.200 192.168.0.210; optionbroadcast-address 192.168.0.254; option routers192.168.0.1; optiondomain-name-servers 192.168.0.1; default-lease-time600; max-lease-time 7200; filename "pxelinux.0"; next-server192.168.0.202; }
[root@localhost ~]# /etc/init.d/dhcpd restart
4、执行检查,修改提示问题
1>.修改/etc/cobbler/settings里cobbler server地址
2>.修改/etc/cobbler/settings里next_server地址
3>.执行cobbler get-loaders,下载loader程序
4>.提示没有安装debmirror,如果不是debian类的系统可忽略
5>.修改cobbler用户默认密码,然后替换/etc/cobbler/settings中的密码
生成密码:openssl passwd -1-salt '1234.com' '123.com'
#1234.com是干扰码,用于加在密文中。123.com是安装新系统root密码
替换密文:default_password_crypted:"$1$1234.com$P8CiR10xiKXSQKJwofdsh0"
6>.执行cobbler sync命令,让cobbler接管服务,应用配置
[root@localhost ~]# /etc/init.d/cobblerd restart
5、修改cobbler配置文件让cobbler来管理相关服务
[root@localhost ~]# vi /etc/cobbler/settings
manage_dhcp: 1
manage_tftpd: 1
manage_rsync: 1
pxe_just_once: 1
6、导入CentOS系统
先可以挂载iso镜像,从光驱中导入cobbler:
[root@localhost ~]# mount -o loop RHEL-server-6.0-i386-dvd.iso /media
[root@localhost ~]# cobbler import -path=/media --name=rhel6
7、通过cobbler list查看现在的镜像,通过测试机开机设置网络启动,实现无人值守安装