Cobbler自动化安装配置实践Word格式文档下载.docx
- 文档编号:18472546
- 上传时间:2022-12-17
- 格式:DOCX
- 页数:16
- 大小:180.93KB
Cobbler自动化安装配置实践Word格式文档下载.docx
《Cobbler自动化安装配置实践Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《Cobbler自动化安装配置实践Word格式文档下载.docx(16页珍藏版)》请在冰豆网上搜索。
Client端
第一步,客户端以PXE模式启动
第二步,客户端获取IP地址
第三步,通过TFTP服务器获取启动文件
第四步,进入Cobbler安装选择界面
第五步,客户端确定加载信息
第六步,根据配置信息准备安装系统
第七步,加载Kickstart文件
第八步,传输系统安装的其它文件
第九步,进行安装系统
Cobbler部署实践
#设置YUM源
cd/etc/yum.repo.d/
viepel.repo
[epel]
name=ExtraPackagesforEnterpriseLinux6-$basearch
baseurl=http:
//download.fedoraproject.org/pub/epel/6/$basearch
#mirrorlist=https:
//mirrors.fedoraproject.org/metalink?
repo=epel-6&
arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:
///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
[epel-debuginfo]
name=ExtraPackagesforEnterpriseLinux6-$basearch-Debug
//download.fedoraproject.org/pub/epel/6/$basearch/debug
repo=epel-debug-6&
enabled=0
[epel-source]
name=ExtraPackagesforEnterpriseLinux6-$basearch-Source
//download.fedoraproject.org/pub/epel/6/SRPMS
repo=epel-source-6&
#导入GPGkey
sudorpm--import
#修改repo文件添加CentOS6.X的YUM源
cd/etc/yum.repos.d/
cprhel-source.reporhel-source.repo.bak
virhel-source.repo
[base]
name=CentOS-$releasever-Base
baseurl=
gpgkey=
[updates]
name=CentOS-$releasever-Updates
[extras]
name=CentOS-$releasever-Extras
[centosplus]
name=CentOS-$releasever-Plus
#清除缓存查看是否生效
yumcleanall
yummakecache
yumrepolist
#直接cobbler关联依赖包
yuminstallcobblercobbler-webhttpdrsynctftp-serverxinetddhcppython-ctypesdebmirrorpykickstartcmanfence-agentsdnsmasq
#使用yum-plugin-downloadonly插件
yuminstall-yyum-plugin-downloadonly
yuminstall--downloadonly--downloaddir=/tmp/cobblercobblercobbler-webhttpdrsynctftp-serverxinetddhcppython-ctypesdebmirrorpykickstartcmanfence-agentsdnsmasq
#必要服务
(1)cobbler(cobbler的核心)
(2)httpd(提供cobbler的web界面)
(3)dhcpd(为自动安装系统分配IP地址)
(4)epel-release(为之提供yum源)
(5)rsync(cobbler需要同步信息)
(6)cobbler-web(cobbler的一个web插件)
(7)xinetd(为rsync和tftp的守护进程)
(8)tftp(传送安装的一些文件的类似ftp)
#检查cobbler配置,常见错误如下
cobblercheck
1:
The'
server'
fieldin/etc/cobbler/settingsmustbesettosomethingotherthanlocalhost,orkickstartingfeatureswillnotwork.ThisshouldbearesolvablehostnameorIPforthebootserverasreachablebyallmachinesthatwilluseit.
2:
ForPXEtobefunctional,the'
next_server'
fieldin/etc/cobbler/settingsmustbesettosomethingotherthan127.0.0.1,andshouldmatchtheIPofthebootserveronthePXEnetwork.
3:
change'
disable'
to'
no'
in/etc/xinetd.d/tftp
4:
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'
commandistheeasiestwaytoresolvetheserequirements.
5:
in/etc/xinetd.d/rsync
6:
file/etc/xinetd.d/rsyncdoesnotexist
7:
debmirrorpackageisnotinstalled,itwillberequiredtomanagedebiandeploymentsandrepositories
8:
ksvalidatorwasnotfound,installpykickstart
9:
Thedefaultpasswordusedbythesampletemplatesfornewlyinstalledmachines(default_password_cryptedin/etc/cobbler/settings)isstillsetto'
cobbler'
andshouldbechanged,try:
"
opensslpasswd-1-salt'
random-phrase-here'
'
your-password-here'
"
togeneratenewone
10:
fencingtoolswerenotfound,andarerequiredtousethe(optional)powermanagementfeatures.installcmanorfence-agentstousethem
1.编辑/etc/cobbler/settings文件,找到server选项,修改为本机IP即可
2.编辑/etc/cobbler/settings文件,找到next_server选项,修改为本机IP即可
3.SELinux的设置,如果上面已经关闭了SELinux就不用管了
4.执行cobblerget-loaders,系统将自动下载loader程序,完成提示4的修复工作。
5.编辑/etc/xinetd.d/tftp文件,将文件中的disable字段的配置由yes改为no
6.编辑/etc/xinetd.d/rsync文件,将文件中的disable字段的配置由yes改为no
7.在iptables中将69,80,25151端口打开。
如果仅仅只是在内部环境中使用,建议直接将防火墙关掉
8.提示说debmirror没安装。
如果不是安装debian之类的系统,此提示可以忽略
9.修改cobbler用户的默认密码,可以使用如下命令生成密码,并使用生成后的密码替换/etc/cobbler/settings中的密码。
生成密码命令:
其中“random-phrase-here”为任意字符
10.安装cman或者fence-agents
#关闭selinux/iptables
sed-i'
/SELINUX/s/enforcing/disabled/'
/etc/selinux/config
setenforce0
chkconfigiptablesoff
serviceiptablesstop
#设置tftp服务和rsync服务
/disable/c\\tdisable\t\t\t=no'
/etc/xinetd.d/tftp
sed-i-e'
s/\=\yes/\=\no/g'
/etc/xinetd.d/rsync
#设置DHCPserver的IP
s/next_server:
127.0.0.1/next_server:
172.28.70.245/g'
/etc/cobbler/settings
#设置cobbler的IP
s/server:
127.0.0.1/server:
#设置Cobbler管理rsync
s/manage_rsync:
0/manage_rsync:
1/g'
#设置Cobbler管理DHCP
s/manage_dhcp:
0/manage_dhcp:
#设置Cobbler一次安装开关(可选)
s/pxe_just_once:
0/pxe_just_once:
/etc/cobbler/settings
#设置Cobbler管理DNS(可选)
s/manage_dns:
0/manage_dns:
#开启动态更新(可选)
s/allow_dynamic_settings:
0/allow_dynamic_settings:
#设置debmirror
s/@dists=/#@dists=/g'
/etc/debmirror.conf
s/@arches=/#@arches=/g'
#编辑dnsmasq.template中dhcp-range部分
#vi/etc/cobbler/dnsmasq.template
vi/etc/dnsmasq.conf
#Cobblergeneratedconfigurationfilefordnsmasq
#$date
#
#resolve.conf..?
#no-poll
#enable-dbus
read-ethers
addn-hosts=/var/lib/cobbler/cobbler_hosts
dhcp-range=172.28.70.246,172.28.70.250
dhcp-option=3,$next_server
dhcp-lease-max=1000
dhcp-authoritative
dhcp-boot=pxelinux.0
dhcp-boot=net:
normalarch,pxelinux.0
ia64,$elilo
#重启dnsmasq
/etc/init.d/dnsmasqrestart
#编辑dhcp.template
cp/etc/cobbler/dhcp.template/etc/cobbler/dhcp.template.bak
vi/etc/cobbler/dhcp.template
#******************************************************************
#Cobblermanageddhcpd.conffile
#generatedfromcobblerdhcp.conftemplate($date)
#DoNOTmakechangesto/etc/dhcpd.conf.Instead,makeyourchanges
#in/etc/cobbler/dhcp.template,as/etc/dhcpd.confwillbe
#overwritten.
ddns-update-styleinterim;
allowbooting;
allowbootp;
ignoreclient-updates;
setvendorclass=optionvendor-class-identifier;
optionpxe-system-typecode93=unsignedinteger16;
subnet172.28.70.0netmask255.255.255.0{
optionrouters172.28.70.254;
optiondomain-name-servers172.28.70.254;
optionsubnet-mask255.255.255.0;
rangedynamic-bootp172.28.70.246172.28.70.250;
default-lease-time21600;
max-lease-time43200;
next-server$next_server;
class"
pxeclients"
{
matchifsubstring(optionvendor-class-identifier,0,9)="
PXEClient"
;
ifoptionpxe-system-type=00:
02{
filename"
ia64/elilo.efi"
}elseifoptionpxe-system-type=00:
06{
grub/grub-x86.efi"
07{
grub/grub-x86_64.efi"
}else{
pxelinux.0"
}
}
#fordhcp_tagin$dhcp_tags.keys():
##groupcouldbesubnetifyourdhcptagslineupwithyoursubnets
##orreallyanyvaliddhcpd.confconstruct...ifyouonlyusethe
##defaultdhcptagincobbler,thegroupblockcanbedeletedfora
##flatconfiguration
#groupforCobblerDHCPtag:
$dhcp_tag
group{
#formacin$dhcp_tags[$dhcp_tag].keys():
#setiface=$dhcp_tags[$dhcp_tag][$mac]
host$iface.name{
hardwareethernet$mac;
#if$iface.ip_address:
fixed-address$iface.ip_address;
#endif
#if$iface.hostname:
optionhost-name"
$iface.hostname"
#if$mask:
optionsubnet-mask$mask;
#if$iface.gateway:
optionrouters$iface.gateway;
#if$iface.enable_gpxe:
ifexistsuser-classandoptionuser-class="
gPXE"
http:
//$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner"
}elseifexistsuser-classandoptionuser-class="
iPXE"
undionly.kpxe"
#else
$iface.filename"
#end
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Cobbler 自动化 安装 配置 实践