一、安装
系统环境是centos6.3,采用yum安装:
rpm -Uvh http://mirrors.hustunique.com/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum -y install cobbler cobbler-web httpd rsync tftp-server xinetd dhcp python-ctypes debmirror pykickstart
二、配置
1、关闭防火墙和SELinux 后重启系统:
/etc/init.d/iptables stop #关闭防火墙
chkconfig iptables off
sed -i ‘/SELINUX=/d‘ /etc/selinux/config && echo "SELINUX=disabled">> /etc/selinux/config #关闭SELINUX
2、修改cobbler配置文件:
‘next_server: 127.0.0.1‘ 替换成 ‘next_server:172.28.26.188‘ #DHCP服务地址
‘server: 127.0.0.1‘ 替换成 ‘server: 172.28.26.188‘ #cobbler服务地址
‘manage_dhcp: 0‘ 替换成 ‘manage_dhcp: 1‘ #cobbler管理dhcp
‘manage_rsync: 0‘ 替换成 ‘manage_rsync: 1‘ #cobbler管理rsync功能
?
sed -i ‘s/next_server: 127.0.0.1/next_server: 172.28.26.188/g‘ /etc/cobbler/settings
sed -i ‘s/server: 127.0.0.1/server: 172.28.26.188/g‘ /etc/cobbler/settings
sed -i ‘s/manage_dhcp: 0/manage_dhcp: 1/g‘ /etc/cobbler/settings
sed -i ‘s/manage_rsync: 0/manage_rsync: 1/g‘ /etc/cobbler/settings
?
修改cobbler用户的默认密码,可以使用如下命令生成密码,并使用生成后的密码替换/etc/cobbler/settings中的密码
openssl passwd -1 -salt "cobber" "123456"
把生成的密码填到/etc/cobbler/settings配置里default_password_crypted:生成的新密码,这个密码就是装完系统后的root密码。
?
3、修改tftp服务和rsync服务配置 :
sed -i ‘/disable/c disable = no‘ /etc/xinetd.d/tftp #设置 ‘disable‘ 为 ‘no‘
sed -i -e ‘s/= yes/= no/g‘ /etc/xinetd.d/rsync #设置 ‘disable‘ 为 ‘no‘
4、修改dhcp模板 :
vim /etc/dhcp/dhcpd.conf
subnet 192.168.66.0 netmask 255.255.255.0 {
option routers 192.168.66.87;
option domain-name-servers 202.106.0.20;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.66.100 192.168.66.102;
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
}
?
5、修改cobbler-web配置
sed -i ‘s/module = authn_denyall/module = authn_configfile/g‘ /etc/cobbler/modules.conf #修改认证
htdigest /etc/cobbler/users.digest "Cobbler" cobbler #修改cobbler WEB页面管理密码
6、启动相关的服务
/etc/init.d/httpd start
/etc/init.d/xinetd start
/etc/init.d/dhcpd start
/etc/init.d/cobblerd start
chkconfig --level 35 httpd on
chkconfig --level 35 xinetd on
chkconfig --level 35 dhcpd on
chkconfig --level 35 cobblerd on
7、效验cobbler安装条件:
service cobblerd restart
cobbler get-loaders #修复cobbler check时出现的错误信息
cobbler check
三、导入镜配置:
1:使用光盘镜像
挂载ISO镜像到/mnt目录
mount -o loop /data/CentOS_6.4_vm.iso /mnt/
导入ISO,并设置为"x86_64",并将其命名为Centos6.4
cobbler import --path=/mnt/ --name=CentOS_6.4 --arch=x86_64
?
2:挂载linux光盘:
mount /dev/cdrom /media/
cobbler import --path=/media/CentOS_6.4_Final --name=Centos6.4
查看导入结果
cobbler distro list
完成后同步所有配置
cobbler sync
这时,我们就可以访问cobbler的web界面了:
四、需要装系统的机器从网卡启动:
至此,linux 系统安装成功.