51学通信论坛2017新版
标题:
cobbler自动安装上百台不是梦
[打印本页]
作者:
admin
时间:
2017-11-15 21:45
标题:
cobbler自动安装上百台不是梦
运维自动化在企业生产环境中越来越重要,当需要批量部署上百台甚至上千台服务器时,如果不通过自动化完成,根本不可想象;而 Cobbler 便可满足这一需求,批量机器。
简介
Cobbler 是一个免费开源系统安装部署软件,用于自动化网络安装操作系统;基于Python开发,是对 PXE 的二次封装,提供了 CLI 和 Web 的管理形式,也提供了API接口,方便二次开发使用。
它不仅可以安装物理机,同时也支持虚拟化、GuestOS的安装。另外,Cobbler还能结合 Puppet 等集中化管理软件,实现自动化管理。
Cobbler各组件关系:
安装过程:
安装Cobbler:
cobbler由epel源提供,故此需要事先配置指向 epel 的 yum 源;cobbler 会把依赖的服务一并安装,如 tftp-server、httpd;还需要安装 dncp、rsync 等。[root@node0 ~]# yum install cobbler pykickstart debmirror dhcp rsync cman fence-agents
[root@node0 ~]# service httpd start
[root@node0 ~]# chkconfig tftp on
[root@node0 ~]# chkconfig rsync on
配置Cobbler:[root@node0 ~]# vim /etc/cobbler/settings
server: 192.168.1.4
next_server: 192.168.1.4
[root@node0 ~]# cobbler get-loaders
[root@node0 ~]# vim /etc/debmirror.conf
#@dists="sid";
#@arches="i386";
[root@node0 ~]# openssl passwd -1 -salt `openssl rand -hex 4`
$1$ca6a7d72$KDte4ZK00OCLiK4PLE4tp0
[root@node0 ~]# vim /etc/cobbler/settings
default_password_crypted: "$1$ca6a7d72$KDte4ZK00OCLiK4PLE4tp0"
[root@node0 ~]# service cobblerd start
[root@node0 ~]# chkconfig cobblerd on
[root@node0 ~]# cobbler sync
配置DHCP:[root@node0 ~]# cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf
[root@node0 ~]# vim /etc/dhcp/dhcpd.conf
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.1 192.168.1.100;
option routers 192.168.1.1;
next-server 192.168.1.4;
filename "pxelinux.0";
}
[root@node0 ~]# service dhcpd start
[root@node0 ~]# chkconfig dhcpd on
添加distro:挂载镜像,添加到cobbler;[root@node0 ~]# mount /mnt/hgfs/lin/CentOS-6.7-x86_64-bin-DVD1.iso /mnt/cdrom/
[root@node0 ~]# cobbler import --name=CentOS-6.7-x86_64 --path=/mnt/cdrom/ --kickstart=/root/anaconda-ks.cfg
task started: 2016-03-08_203724_import
task started (id=Media import, time=Tue Mar 8 20:37:24 2016)
Found a candidate signature: breed=redhat, version=rhel6
Found a matching signature: breed=redhat, version=rhel6
Adding distros from path /var/www/cobbler/ks_mirror/CentOS-6.7-x86_64:
skipping import, as distro name already exists: CentOS-6.7-x86_64
No distros imported, bailing out
!!! TASK FAILED !!!
查看当前distro:
[root@node0 ~]# cobbler distro list
CentOS-6.7-x86_64
测试安装:
[attach]5445[/attach]
声明:本文转载自网络。版权归原作者所有,如有侵权请联系删除。
欢迎光临 51学通信论坛2017新版 (http://bbs.51xuetongxin.com/)
Powered by Discuz! X3