Linux装机利器Cobbler安装配置.doc_第1页
Linux装机利器Cobbler安装配置.doc_第2页
Linux装机利器Cobbler安装配置.doc_第3页
Linux装机利器Cobbler安装配置.doc_第4页
Linux装机利器Cobbler安装配置.doc_第5页
免费预览已结束,剩余1页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Linux装机利器Cobbler安装配置一、安装环境centos 5.4_64关掉iptables 关掉 selinux selinux可能导致tftp的目录无法访问 pxe停止在引导界面。二、cobbler使用目录及文件cobbler相关配置文件 /etc/cobblercobbler数据存储目录 /var/www/cobblerdhcp配置文件 /etc/dhcpd.confdhcp租期缓存文件 /var/lib/dhcpd/dhcpd.leasespxe配置文件 /tftpboot/pxelinux.cfg/default三、安装cobbler:安装epel yum库,# rpm -ivh /pub/epel/5/x86_64/epel-release-5-4.noarch.rpm#yum clean all# yum -y install PyYAML cobbler tftp-server httpd dhcp yum-utils cman xinetd注意:/var/www/cobbler 目录必须具有足够容纳 Linux 安装文件的空间!四、修改后配置文件:1.修改cobbler配置文件# vi /etc/cobbler/settingsserver: 37 #cobbler服务器地址next_server: 37manage_dhcp: 1或者# sed -i s//37/g /etc/cobbler/settings # sed -i s/ manage_dhcp: 0/ manage_dhcp: 1/g /etc/cobbler/settings2.更改tftp启动方式# vi /etc/xinetd.d/tftpdisable = no #默认开启tftp或运行#sed -i s/disable.*$/disable = no/g /etc/xinetd.d/tftp3.修改dhcp配置文件#vi /etc/cobbler/dhcp.template #除原来的所有内容,添加如下内容:ddns-update-style interim;allow booting;allow bootp;ignore client-updates;set vendorclass = option vendor-class-identifier;subnet netmask option routers ; option domain-name-servers 37; option subnet-mask ; range dynamic-bootp 00 50; filename /pxelinux.0; default-lease-time 21600; max-lease-time 43200; next-server $server;4.更该sync的配置文件:#vi /etc/xinetd.d/rsyncdisable = no #默认开启sync或运行#sed -i s/disable.*$/disable = no/g /etc/xinetd.d/rsync五、启动cobbler服务#service httpd start#service xinetd start#service cobblerd start设置开机自启动:#chkconfig -level 345 dhcpd on#chkconfig -level 345 httpd on#chkconfig -level 345 xinetd on#chkconfig -level 345 cobblerd on六、使用cobbler check检测cobbler存在的错误,根据提示解决问题,例如:如果错误如下:httpd does not appear to be running and proxying cobbler解决办法:检查http是否启动,端口是否被占用,Selinux与Iptables设置等。The following are potential configuration items that you may want to fix:1 : service dhcpd is not running2 : some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run cobbler get-loaders to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely. Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The cobbler get-loaders command is the easiest way to resolve these requirements.3 : debmirror package is not installed, it will be required to manage debian deployments and repositories4 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to cobbler and should be changed, try: openssl passwd -1 -salt random-phrase-here your-password-here to generate new oneRestart cobblerd and then run cobbler sync to apply changes.修复上述错误,步骤如下:(1) Dhcpd不用理会它。(2) 运行cobbler get-loaders看到* TASK COMPLETE *则成功,若看不到,请检查你的网络是否通畅。(3) Debmirror 不存在,不用理会。(4) 修改系统初始密码:使用openssl生成新密码:openssl passwd -1 -salt 经过md5加密后的为:$1$TBGNZfxETBpFOKfAdAV.U0修改/etc/cobbler/setings文件中“default_password_crypted”字段为$1$TBGNZfxETBpFOKfAdAV.U0重新启动cobblerd,再次运行cobbler check 与cobbler sync看到* TASK COMPLETE *即为成功。七、导入CentOS 光盘映像文件# mkdir /mnt/CentOS# mount /home/src/CentOS-5.4-i386-bin-DVD.iso /mnt/CentOS/ -o loop# cobbler import -path=/mnt/CentOS/ -name=CentOS-5.4 #有点慢,大约需要10分钟。# cobbler distro list 查看导入结果八、kickstart配置文件实例# vi /var/lib/cobbler/kickstarts/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 -disable# Run the Setup Agent on first bootfirstboot -disable# System keyboardkeyboard us# System languagelang zh_CN# 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 -iscrypted $1$TBGNZfxETBpFOKfAdAV.U0#rootpw # SELinux configurationselinux -disabled# Do not configure the X Window Systemskipx# System timezonetimezone Asia/Shanghai# Install OS instead of upgradeinstall# Clear the Master Boot Recordzerombr# Magically figure out how to partition this thingclearpart -all -drives=sdapart /boot -fstype ext3 -size=100 -ondisk=sdapart pv.2 -size=0 -grow -ondisk=sdavolgroup VolGroup00 -pesize=32768 pv.2logvol / -fstype ext3 -name=LV00l -vgname=VG001 -size=1024 -growlogvol swap -fstype swap -name=LV002 -vgname=VG001 -size=256 -grow %packages #定制安装的组件development-toolsbasedevelopment-libssystem-toolsadmin-tools editorslvm2%post# Add service httpd/sbin/chkconfig -level 345 httpd on/sbin/service httpd start为了使上面的设置生效,需要应用配置模板# cobbler sync 看到以下内容即成功:running shell triggers from /var/lib/cobbler/triggers/change/* TASK COMPLETE *若看到以下内容:dhcpd -t failedException occured: cobbler.cexceptions.CXException value: cobbler trigger failed: cobbler.modules.sync_post_restart_services.去查看下/var/log/messages这里一定有你需要的信息。九、设置profile和system1profile可以理解为按角色进行分类,下面是几个添加删除修改profile配置的例子:添加profile配置,名称为:DB,指定镜像为:CentOS-5.4-x86_64,kickstart文件为/var/lib/cobbler/kickstarts/db.ks#cobbler profile add -name=DB -distro=CentOS-5.4-x86_64 -kickstart=/var/lib/cobbler/kickstarts/db.ks修改profile文件,名称为:DB,指定镜像由CentOS-5.4-x86_64修改为CentOS5.4-i386#cobbler profile edit -name= DB -distro=CentOS5.4-i386变更profile配置名称,名称由DB修改为Web#cobbler profile rename -name= DB -newname=Web删除profile配置,需要删除的profile名称为DB#cobbler profile remove -name= DB注意:修改删除名为DB的profile,profile中必须存在。十、利用cobbler重装系统1、在客户端上安装koan# rpm -ihv koan-1.2.5-1.el5.noarch.rpm或#rpm -ivh /pub/epel/5/i386/epel-release-5-4.noarch.rpm#yum -y install koan2、查看cobbler server上的配置文件# koan -server=37 -list=profiles3、重新安装客户端系统# koan -replace-self -server=37 -profile= CentOS-5.4-x86_64#reboot4、reboot重启服务器后,客户端服务器会自动重新安装操作系统十一、图形化管理cobbler:Cobbler web界面是一个很好的前端,非常容易管理很多Cobbler操作。可以用它列出和编辑distros, profiles, subprofiles, systems, repos and kickstart文件。安装Cobbler web:yum install -y cobbler-web设置用户名密码:为已存在的用户cobbler重置密码:htdigest /etc/cobbler/users.digest Cobbler cobbler添加新用户chow:htdigest /etc/cobbler/users.digest Cobbler chow设置/etc/cobbler/modules.conf如下:authenticationmodule = authn_configfile #将原来的module = authn_denyall注释掉。或#sed -i s/module = authn_denyall/ module = authn_configfile /g /etc/cobbler/modules.conf重启Cobbler服务:#service cobblerd restarCobbler web界面访问地址:37/cobbler_web/(37为Cobbler web server地址)如下:附录:错误1:#cobbler sync错误如下:Traceback (most recent call last): File /u

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论