Linux 运维自动化之Cobbler全自动安装Centos管理与使用详解

从事网游运维的兄弟们应该深有感触,往往在开新服的时候需要大批量的布署新的服务器,时间紧迫而且量大,装系统、初始化,枯燥而又乏味,有时还容易出错,为了解放我们的双手,所以要实现自动化,Red Hat 最新发布了网络安装服务器套件 Cobbler(补鞋匠)集成了PXE、DHCP、DNS、Kickstart服务管理和yum仓库管理工具,相对之前的 Kickstart 更加快捷、方便的批量布署red hat、centos类系统

一、安装软件

1、安装cobbler

[root@node1~]#yuminstallcobblerpykickstartdebmirror

2、 其他服务的安装

额外需要的服务还有dhcp tftp,rsync,xinetd,httpd,syslinux。所以如果安装系统的时候如果这几个包没装上,请手动安装。

二、启动服务并检测cobbler

1、启动httpd和cobblerd服务

[root@node1~]#/etc/init.d/httpdstartStartinghttpd:httpd:apr_sockaddr_info_get()failedfornode1[OK][root@node1~]#/etc/init.d/cobblerdstartStartingcobblerdaemon:[OK]

2、执行“cobbler check命令检查存的问题,逐一按提示解决:

[root@node1~]#cobblercheckThefollowingarepotentialconfigurationitemsthatyoumaywanttofix:1:The’server’fieldin/etc/cobbler/settingsmustbesettosomethingotherthanlocalhost,orkickstartingfeatureswillnotwork.ThisshouldbearesolvablehostnameorIPforthebootserverasreachablebyallmachinesthatwilluseit.2:ForPXEtobefunctional,the’next_server’fieldin/etc/cobbler/settingsmustbesettosomethingotherthan127.0.0.1,andshouldmatchtheIPofthebootserveronthePXEnetwork.3:somenetworkboot-loadersaremissingfrom/var/lib/cobbler/loaders,youmayrun’cobblerget-loaders’todownloadthem,or,ifyouonlywanttohandlex86/x86_64netbooting,youmayensurethatyouhaveinstalleda*recent*versionofthesyslinuxpackageinstalledandcanignorethismessageentirely.Filesinthisdirectory,shouldyouwanttosupportallarchitectures,shouldincludepxelinux.0,menu.c32,elilo.efi,andyaboot.The’cobblerget-loaders’commandistheeasiestwaytoresolvetheserequirements.4:change’disable’to’no’in/etc/xinetd.d/rsync5:commentout’dists’on/etc/debmirror.confforproperdebiansupport6:commentout’arches’on/etc/debmirror.confforproperdebiansupport7:Thedefaultpasswordusedbythesampletemplatesfornewlyinstalledmachines(default_password_cryptedin/etc/cobbler/settings)isstillsetto’cobbler’andshouldbechanged,try:”opensslpasswd-1-salt’random-phrase-here”your-password-here'”togeneratenewone8:fencingtoolswerenotfound,andarerequiredtousethe(optional)powermanagementfeatures.installcmanorfence-agentstousethemRestartcobblerdandthenrun’cobblersync’toapplychanges.如上各问题的解决方法如下所示:1、修改/etc/cobbler/settings文件中,server:172.16.22.6;2、修改/etc/cobbler/settings文件中,next_server:172.16.22.6;3、如果当前节点可以访问互联网,执行“cobblerget-loaders”命令即可;否则,需要安装syslinux程序包,执行:[root@node1~]#cp/usr/share/syslinux/{pxelinux.0,menu.c32}/var/lib/cobbler/loaders/4、执行[root@node1~]#chkconfigrsyncon5、注释/etc/debmirror.conf文件中的“@dists=”sid”;”一行;6、注释/etc/debmirror.conf文件中的“@arches=”i386″;”一行;7、执行“opensslpasswd-1-salt’random-phrase-here”your-password-here’”生成密码,并用替换/etc/cobbler/settings文件中default_password_crypted参数的值,如default_password_crypted:”$1$random-p$AOw9RDIWQm6tfUo9Ediu/0″;8、执行“yum-yinstallcmanfence-agents”命令安装相应的程序包即可;莫找借口失败,只找理由成功。(不为失败找理由,要为成功找方法)

Linux 运维自动化之Cobbler全自动安装Centos管理与使用详解

相关文章:

你感兴趣的文章:

标签云: