cobbler自动化安装详解
Cobbler介紹
? ?cobbler是一個快速網(wǎng)絡(luò)安裝linux的服務(wù),而且在經(jīng)過調(diào)整也可以支持網(wǎng)絡(luò)安裝windows.改工具使用python開發(fā),小巧輕便,使用簡單的命令即可完成PXE網(wǎng)絡(luò)安裝環(huán)境的配置,同時還可以管理DHCP,DNS,以及yum包鏡像。
? ?Cobbler支持命令行管理,web界面管理,還提供了API接口,可以方便二次開發(fā)使用。
1、安裝Cobbler
需要EPEL的YUM源,否則就需要下載源碼安裝
2、yum安裝Cobbler組件?????????????????????????????????????????????????????????????????????
安裝后cobbler的配置文件
[root@test?cobbler]#?ls auth.conf?????????completions???????named.template??tftpd.template cheetah_macros????dhcp.template?????power???????????users.conf cobbler_bash??????dnsmasq.template??pxe?????????????users.digest cobbler.conf??????iso???????????????reporting???????version cobblerd_rotate???ldap??????????????rsync.exclude???zone.template cobblerd.service??modules.conf??????rsync.template??zone_templates cobbler_web.conf??mongodb.conf??????settings3、啟動cobbler服務(wù)
4、檢查cobbler的配置
首先要啟動httpd服務(wù) service?httpd?start cobbler?check The?following?are?potential?configuration?items?that?you?may?want?to?fix:1?:?The?'server'?field?in?/etc/cobbler/settings?must?be?set?to?something?other?than?localhost,?or?kickstarting?features?will?not?work.??This?should?be?a?resolvable?hostname?or?IP?for?the?boot?server?as?reachable?by?all?machines?that?will?use?it. 2?:?For?PXE?to?be?functional,?the?'next_server'?field?in?/etc/cobbler/settings?must?be?set?to?something?other?than?127.0.0.1,?and?should?match?the?IP?of?the?boot?server?on?the?PXE?network. 3?:?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. 4?:?change?'disable'?to?'no'?in?/etc/xinetd.d/rsync 5?:?debmirror?package?is?not?installed,?it?will?be?required?to?manage?debian?deployments?and?repositories 6?:?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?one 7?:?fencing?tools?were?not?found,?and?are?required?to?use?the?(optional)?power?management?features.?install?cman?or?fence-agents?to?use?themRestart?cobblerd?and?then?run?'cobbler?sync'?to?apply?changes.錯誤解釋
1:/etc/cobbler/settings/中的server必須要與外部指令交互的地址。?
2:PXE的服務(wù)必須要啟動,/etc/cobbler/settings必須要指定web主機(jī)通信的地址。
3:pxe和cobbler等所需要的驅(qū)動文件。需要安裝syslinux等插件
4:需要啟動rsync服務(wù)
5:debmirror安裝包還沒有安裝。如果不是安裝debin系統(tǒng)可以忽略
6:需要定義密碼
7:電源管理,需要安裝cman,可以忽略
解決錯誤
最后重啟服務(wù),同步數(shù)據(jù)
[root@test?cobbler]#?service?cobblerd?restart? Stopping?cobbler?daemon:?[??OK??] Starting?cobbler?daemon:?[??OK??] cobbler?check cobbler?sync5、啟動dhcp服務(wù)
service?dhcpd?startDHCP的配置在此文中不描述
6、啟動tftp服務(wù)
二、導(dǎo)入安裝光盤鏡像文件
先用光盤去加載安裝鏡像
mount?-r?/dev/cdrom?/var/ftp/pub/centos-6.4-x86_64 cobbler?import?--name="centos-6.4-x86_64"?--path=/var/ftp/pub/centos-6.4-x86_64/ 加載后可以查看distro [root@test?~]#?cobbler?distro?listcentos-6.4-x86_64制作一份kickstart.cfg文件。此文不再描述
創(chuàng)建一份profile,profile中需用到profile?name?distro(加載過的鏡像文件)?kickstart的文件路徑cobbler?profile?add?--name=centos-6.4-x86_64-basic?--distro=centos-6.4-x86_64?--kickstart=/root/centos6.cfg [root@test?~]#?cobbler?list distros:centos-6.4-x86_64profiles:centos-6.4-x86_64???????????自動生成的profile可以刪除centos-6.4-x86_64-basic [root@test?~]#?cobbler?sync task?started:?2014-12-11_164024_sync task?started?(id=Sync,?time=Thu?Dec?11?16:40:24?2014) running?pre-sync?triggers cleaning?trees removing:?/var/www/cobbler/p_w_picpaths/centos-6.4-x86_64 removing:?/tftpboot/pxelinux.cfg/default removing:?/tftpboot/grub/efidefault removing:?/tftpboot/grub/p_w_picpaths removing:?/tftpboot/p_w_picpaths/centos-6.4-x86_64 removing:?/tftpboot/s390x/profile_list copying?bootloaders trying?hardlink?/var/lib/cobbler/loaders/pxelinux.0?->?/tftpboot/pxelinux.0 copying:?/var/lib/cobbler/loaders/pxelinux.0?->?/tftpboot/pxelinux.0 trying?hardlink?/var/lib/cobbler/loaders/menu.c32?->?/tftpboot/menu.c32 copying:?/var/lib/cobbler/loaders/menu.c32?->?/tftpboot/menu.c32 trying?hardlink?/var/lib/cobbler/loaders/yaboot?->?/tftpboot/yaboot copying:?/var/lib/cobbler/loaders/yaboot?->?/tftpboot/yaboot copying?distros?to?tftpboot copying?files?for?distro:?centos-6.4-x86_64 trying?hardlink?/var/www/cobbler/ks_mirror/centos-6.4-x86_64/p_w_picpaths/pxeboot/vmlinuz?->?/tftpboot/p_w_picpaths/centos-6.4-x86_64/vmlinuz trying?hardlink?/var/www/cobbler/ks_mirror/centos-6.4-x86_64/p_w_picpaths/pxeboot/initrd.img?->?/tftpboot/p_w_picpaths/centos-6.4-x86_64/initrd.img copying?p_w_picpaths generating?PXE?configuration?files generating?PXE?menu?structure copying?files?for?distro:?centos-6.4-x86_64 trying?hardlink?/var/www/cobbler/ks_mirror/centos-6.4-x86_64/p_w_picpaths/pxeboot/vmlinuz?->?/var/www/cobbler/p_w_picpaths/centos-6.4-x86_64/vmlinuz trying?hardlink?/var/www/cobbler/ks_mirror/centos-6.4-x86_64/p_w_picpaths/pxeboot/initrd.img?->?/var/www/cobbler/p_w_picpaths/centos-6.4-x86_64/initrd.img rendering?TFTPD?files generating?/etc/xinetd.d/tftp cleaning?link?caches running?post-sync?triggers running?python?triggers?from?/var/lib/cobbler/triggers/sync/post/* running?python?trigger?cobbler.modules.sync_post_restart_services running?shell?triggers?from?/var/lib/cobbler/triggers/sync/post/* running?python?triggers?from?/var/lib/cobbler/triggers/change/* running?python?trigger?cobbler.modules.scm_track running?shell?triggers?from?/var/lib/cobbler/triggers/change/* ***?TASK?COMPLETE?***查看加載后的配置選項
[root@test?tftpboot]#?cat?/tftpboot/pxelinux.cfg/default?LABEL?centos-6.4-x86_64-basickernel?/p_w_picpaths/centos-6.4-x86_64/vmlinuzMENU?LABEL?centos-6.4-x86_64-basicappend?initrd=/p_w_picpaths/centos-6.4-x86_64/initrd.img?ksdevice=bootif?lang=??kssendmac?text??ks=http://192.168.254.2/cblr/svc/op/ks/profile/centos-6.4-x86_64-basicipappend?2至此,cobbler已經(jīng)配置完成,可以啟動物理機(jī)或者虛擬機(jī)PXE引導(dǎo)自動安裝。
附加選項
三、cobbler_web配置
核心配置文件
[root@test?web]#?cat?/etc/cobbler/cobbler_web.conf? #?This?configuration?file?enables?the?cobbler?web #?interface?(django?version)<VirtualHost?*:80>#?Do?not?log?the?requests?generated?from?the?event?notification?system SetEnvIf?Request_URI?".*/op/events/user/.*"?dontlog #?Log?only?what?remains CustomLog?logs/access_log?combined?env=!dontlogWSGIScriptAlias?/cobbler_web?/usr/share/cobbler/web/cobbler.wsgi</VirtualHost>創(chuàng)建用戶名和密碼
vim?/etc/cobbler/modules.conf[authentication] module?=?authn_configfile?????#修改成authn_config用戶配置模式[root@test?cobbler]#?htdigest?/etc/cobbler/users.digest?"Cobbler"?bjia Changing?password?for?user?bjia?in?realm?Cobbler New?password:? Re-type?new?password:? 重啟cobblerd、httpd服務(wù) [root@test?cobbler]#?service?cobblerd?restart [root@test?cobbler]#?service?httpd?restart出現(xiàn)如上圖界面。既可以用圖形化操作來完成cobblerd服務(wù)配置了。
轉(zhuǎn)載于:https://blog.51cto.com/jiaxu201/1588841
總結(jié)
以上是生活随笔為你收集整理的cobbler自动化安装详解的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 2.Knockout.Js(监控属性Ob
- 下一篇: 《MFC dialog中加入OpenGL