RHEL5.5 cobbler的配置

本文发布时间: 2019-Mar-22
先言:人们对于安装操作系统往往的理解是在电脑光驱里安一张光驱 然后狂按下一步 直到提示电脑重启安装完成,或是通过高级一点的U盘安装,但是有没有想过在一个教室 或者是当一个公司开业购买电脑,光驱安装和U盘这种普通的安装方式已经不再适合,管理员们耗不起这时间,这时就需要一种批量安装操作系统的方式来解放管理员的时间,批量部署操作系统的好处在于省时省力,可以多台机器同时安装操作系统环境:RHEL5.5 vmware9.0安装前准备:关闭SElinux 配置IP地址 配置yum源实验注意事项:网卡必须支持PXE启动(vmware默认支持)服务器能上网 从网上下载cobbler等软件实验拓扑图:IP地址配置在这里我用了两块网卡 eth0用于从网上下载安装软件为NAT模式eth1用于部署操作系统 为单独的局域网VMnet21 #wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm#rpm -ivh rpmforge-release-0.5.1-1.el5.rf.i386.rpm///////#64位:///#wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm/////#rpm -ivh rpmforge-release-0.5.1-1.el5.rf.x86_64.rpmmount /dev/cdrom /mnt/2 yum install cobbler httpd rsync tftp-server xinetd dhcp手动开启wsgi模块vim /etc/httpd/conf.d/wsgi.conf#LoadModule wsgi_module modules/mod_wsgi.so 前面#去掉即可service cobblerd restartservice httpd restartcobbler import --path=/mnt/ --name=RedHat-5-i386cobbler list4 xinet.d配置文件修改#vi /etc/xinetd.d/rsyncdisable = yes 改成no#vi /etc/xinetd.d/tftpdisable = yes 改成novi /etc/cobbler/settingsnext_server: '127.0.0.1' //改成本机IP:192.168.1.1server: '127.0.0.1' //改成本机IP:192.168.1.1manage_dhcp: 0 // 改成1 //开启管理DHCP服务5 dhcp的配置#vi /etc/cobbler/dhcp.templateddns-update-style interim;allow booting;allow bootp;ignore client-updates;set vendorclass = option vendor-class-identifier;subnet 192.168.1.0 netmask 255.255.255.0 {#option routers 192.168.1.1;#option domain-name-server 192.168.0.100;option subnet-mask 255.255.255.0;range dynamic-bootp 192.168.1.2 192.168.1.200;filename "/pxelinux.0";default-lease-time 21600;max-lease-time 43200;next-server $next_server;6 编辑ks文件 模板文件位置位于/var/lib/cobbler/kickstarts/目录下vi /etc/cobbler/default.ks#platform=x86, AMD64, or Intel EM64T# System authorization informationauth --useshadow --enablemd5# System bootloader configurationbootloader --location=mbr# Partition clearing informationclearpart --all --initlabel# Use text mode installtext# Firewall configurationfirewall --disabled# Run the Setup Agent on first bootfirstboot --disable# System keyboardkeyboard us# System languagelang en_US# Use network installationurl --url=$tree# If any cobbler repo definitions were referenced in the kickstart profile, include them here.$yum_repo_stanza# Network informationnetwork --bootproto=dhcp --device=eth0 --onboot=on# Reboot after installationreboot#Root passwordrootpw 123456# SELinux configurationselinux –disabled#disabled servercesservices --disabled acpid,anacron,apmd,atd,auditd,autofs,avahi-daemon,bluetooth,cups,firstboot,hidd,ip6tables,lvm2-monitor,mcstrans,mdmonitor,microcode_ctl,netfs,nfslock,pcscd,portmap,rawdevices,readahead_early,restorecond,rpcgssd,rpcidmapd,sendmail,setroubleshoot,xfs,xinetd,yum-updatesd#enabled servicesservices --enabled cpuspeed,crond,gpm,haldaemon,irqbalance,kudzu,messagebus,network,smartd,sshd,syslog# Do not configure the X Window Systemskipx# System timezonetimezone --utc Asia/Shanghai# Install OS instead of upgradeinstall# Clear the Master Boot Recordzerombr# Magically figure out how to partition this thing%include /tmp/partinfo%pre# Determine how many drives we haveset \$(list-harddrives)#let numd=\$#/2#d1=\$1#d2=\$3cat << EOF >> /tmp/partinfoclearpart --all --drives=sda --initlabelpart / --fstype ext3 --size=20000part /usr/local --fstype ext3 --size=50000part swap --size=1024part /home --fstype ext3 --size=1000 --grow#EOF##%[email protected]@[email protected]@[email protected]@[email protected]%post$yum_config_stanza$kickstart_done6 同步cobbler配置使之生效service cobblerd restartservice httpd restartservice xinetd restartcobbler syncservice dhcpd restart7 至此服务器的配置工作完成 客户端开机开机选择第二项到这一步就是选择红帽的key了 由于在ks文件里面没有设置好需要选择跳过才能一路安装可以看到安装进度 OK 实验成功!


(以上内容不代表本站观点。)
---------------------------------
本网站以及域名有仲裁协议。
本網站以及域名有仲裁協議。

2020-Jul-13 01:14am
栏目列表