cobbler自动化系统安装详细Word格式.docx
《cobbler自动化系统安装详细Word格式.docx》由会员分享,可在线阅读,更多相关《cobbler自动化系统安装详细Word格式.docx(15页珍藏版)》请在冰点文库上搜索。
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'
commandistheeasiestwaytoresolvetheserequirements.
4:
debmirrorpackageisnotinstalled,itwillberequiredtomanagedebiandeploymentsandrepositories
安装依赖包
yuminstalledpatchperlperl-Compress-Zlibperl-Cwdperl-Digest-MD5perl-Digest-SHA1perl-LockFile-Simpleperl-libwww-perl
rpm-ivhftp:
需要注销这两行
vim/etc/debmirror.conf
#@arches="
i386"
#@dists="
sid"
5:
ksvalidatorwasnotfound,installpykickstart
6:
Thedefaultpasswordusedbythesampletemplatesfornewlyinstalledmachines(default_password_cryptedin/etc/cobbler/settings)isstillsetto'
cobbler'
andshouldbechanged,try:
"
opensslpasswd-1-salt'
random-phrase-here'
'
your-password-here'
"
togeneratenewone
opensslpasswd-1-salt'
任意字母'
你的密码'
生成密码替换/etc/cobbler/settingsdefault_password_crypted:
$1$icifbsa$GlSk4KZPpIscQsOpLkZh0/"
默认密码
7:
fencingtoolswerenotfound,andarerequiredtousethe(optional)powermanagementfeatures.installcmanorfence-agentstousethem安装cman
1)vim/etc/cobbler/settings
server:
192.168.23.128设置cobblerserver的IP
next_server:
192.168.23.128设置PXEserver的IP
manage_dhcp:
1开启管理DHCP服务
default_kickstart:
/var/lib/cobbler/kickstarts/default.ks设置默认的kickstart配置文件
2)关闭防火墙和selinux
3)获取启动镜像
cobblerget-loaders
4)启动tftp和rsync
vim/etc/xinetd.d/tftp
将disable=yes改为disable=no
vim/etc/xinetd.d/rsync
然后重启xinetd
5)修改DHCP模板,确保DHCP分配的地址和cobbler在同一网段
注:
编辑/etc/cobbler/dhcp.template在后面执行cobblersync时会自动同步到/etc/dhcp.conf
subnet192.168.23.0netmask255.255.255.0{
optionrouters192.168.1.5;
#optiondomain-name-servers192.168.1.1;
optionsubnet-mask255.255.255.0;
rangedynamic-bootp192.168.23.100192.168.23.254;
filename"
/pxelinux.0"
;
default-lease-time21600;
max-lease-time43200;
next-server$next_server;
}
5、同步cobbler配置,使修改生效:
cobblersync
挂载linux光盘生成安装镜像
mount-oloop/dev/cdrom/mnt/
cobblerimport--path=/mnt/--name=Centos5.5-i386这个过程需要一定的时间
6、配置Cobbler_web
1)安装依赖组件Django和mod_ssl
yum-yinstallDjango
yum-yinstallmod_ssl
2)安装cobbler_web
yum-yinstallcobbler_web
3)重启httpd以让ssl服务生效
servicehttpdrestart
4)为Cobbler用户修改密码
htdigest/etc/cobbler/users.digest"
Cobbler"
cobbler
5)为CobblerWeb增加新用户
new_name
设置/etc/cobbler/modules如下:
[authentication]
module=authn_configfile
这里不设置web页面无法登陆
[authorization]
module=authz_allowall
重启Cobbler服务:
servicecobblerdrestart
7、然后使用http:
//ip/cobbler_web访问,登录后界面如下
8、编辑profile文件,修改kickstart启动文件名为CentOS5.5-i386.ks
cobblerprofileedit--name=CentOS6.2-i386--distro=CentOS6.2-i386--kickstart=/var/lib/cobbler/kickstarts/CentOS5.5-i386.ks
cobblersync执行同步配置文件
9、配置kickstart脚本,根据需求添加所需参数。
下面ks配置文件是我测试时候使用的,自动安装测试通过.
#platform=x86,AMD64,orIntelEM64T
#Systemauthorizationinformation
auth--useshadow--enablemd5
#Systembootloaderconfiguration
bootloader--location=mbr
#Partitionclearinginformation
clearpart--all--initlabel
#Usetextmodeinstall
text
#Firewallconfiguration
firewall--disable
#RuntheSetupAgentonfirstboot
firstboot--disable
#Systemkeyboard
keyboardus
#Systemlanguage
langen_US
#Usenetworkinstallation
url--url=$tree
#Ifanycobblerrepodefinitionswerereferencedinthekickstartprofile,includethemhere.
$yum_repo_stanza
#Networkinformation
$SNIPPET('
network_config'
)
#Rebootafterinstallation
Reboot
#Rootpassword
rootpw--iscrypted$default_password_crypted
#SELinuxconfiguration
selinux--disabled
#DonotconfiguretheXWindowSystem
skipx
#Systemtimezone
timezone--utcAsia/Shanghai
#InstallOSinsteadofupgrade
install
#CleartheMasterBootRecord
zerombr
#Allowanacondatopartitionthesystemasneeded
autopart
clearpart--all--drives=sda--initlabel
%pre
log_ks_pre'
$kickstart_start
pre_install_network_config'
#Enableinstallationmonitoring
pre_anamon'
%packages
@admin-tools
@base
@chinese-support
@core
@development-libs
@development-tools
@editors
@system-tools
@text-internet
OpenIPMI-tools
hardlink
kernel-PAE
kernel-PAE-devel
kernel-devel
libpng-devel
lrzsz
minicom
net-snmp-utils
pcre-devel
sysstat
x86info
func_install_if_enabled'
%post
log_ks_post'
#Setdefaultlanguage
[-f/etc/sysconfig/i18n]&
&
cp/etc/sysconfig/i18n/etc/sysconfig/i18n.ksbak
cat<
<
EOF>
/etc/sysconfig/i18n
LANG="
en_US"
SUPPORTED="
en_US.UTF-8:
en_US:
en"
SYSFONT="
latarcyrheb-sun16"
EOF
#Setnameserver
/etc/resolv.conf
nameserver8.8.8.8
#Setdefaultrunlevelto3
echo"
Setdefaultrunlevelto3"
pushd/etc&
>
/dev/null
mvinittabinittab.bak
catinittab.bak|sed'
s/^id\:
[0-5]\:
init/id\:
3\:
init/'
>
inittab
popd&
cat/etc/inittab|grep'
^id:
'
#stopunusefulservices
#nsrvsisthelistforstop
nsrvs="
\
kudzu
isdn
pcmcia
portmap
nfslock
rpcidmapd
rpcgssd
netfs
apmd
autofs
cups
xinetd
sendmail
smartd
gpm
xfs
rhnsd
avahi-daemon
avahi-dnsconfd
acpid
anacron
atd
auditd
cpuspeed
crond
haldaemon
ip6tables
irqbalance
lm_sensors
lvm2-monitor
mcstrans
messagebus
microcode_ctl
pcscd
bluetooth
hidd
mdmonitor
rawdevices
readahead_early
restorecond
setroubleshoot
yum-updatesd
cups-config-daemon"
foritemin$nsrvs
do
if[!
-f/etc/init.d/$item];
then
echo"
Thereisno$itemexist!
else
chkconfig$itemoff
fi
done
#kerneloptimize
EOF>
/etc/sysctl.conf
net.ipv4.tcp_fin_timeout=30
net.ipv4.tcp_keepalive_time=1200
net.ipv4.tcp_syncookies=1
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_tw_recycle=1
net.ipv4.tcp_max_syn_backlog=8192
net.ipv4.tcp_max_tw_buckets=100000
/etc/rc.d/rc.tune
echo0>
/proc/sys/net/ipv4/tcp_sack
/proc/sys/net/ipv4/tcp_timestamps
/proc/sys/net/ipv4/tcp_window_scaling
102465000"
/proc/sys/net/ipv4/ip_local_port_range
echo1>
/proc/sys/net/ipv4/tcp_syncookies
4096655368388608"
/proc/sys/net/ipv4/tcp_wmem
4096873808388608"
/proc/sys/net/ipv4/tcp_rmem
echo5>
/proc/sys/kernel/panic
echo8192>
/proc/sys/net/ipv4/tcp_max_syn_backlog
echo8388608>
/proc/sys/net/core/rmem_max
/proc/sys/net/core/wmem_max
409600"
/proc/sys/net/ipv4/ip_conntrack_max
3600"
/proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_established
#somethingin/etc/sysctl.conf
net.ipv4.tcp_retrans_collapse=0"
/etc/sysctl.conf
UseDNSno"
/etc/ssh/sshd_config
[-d/etc/snmp]||mkdir/etc/snmp
if[-f/etc/snmp/snmpd.conf];
cp/etc/snmp/snmpd.conf/etc/snmp/snmpd.conf.ksbak
/etc/snmp/snmpd.conf
smuxsocket127.0.0.1
com2seclocallocalhostpublic
com2secmynet10.88.1.77public
groupmygroupv1mynet
groupmygroupv2cmynet
viewallincluded.180
viewsystemviewincluded.1.3.6.1.2.1.1
viewsystemviewincluded.1.3.6.1.2.1.25.1.1
accessmygroup"
anynoauthexactallnonenone
viewmib2included.iso.org.dod.internet.mgmt.mib-2fc
syslocationUnknown(edit/etc/snmp/snmpd.conf)
syscontactRoot<
root@localhost>
(configure/etc/snmp/snmp.local.conf)
pass.1.3.6.1.4.1.4413.4.1/usr/bin/ucd5820stat
proxy-v2c-cpublic127.0.0.1:
3401.1.3.6.1.4.1.3495.1
chkconfigsnmpdon
#Startyumconfiguration
$yum_config_stanza
#Endyumconfiguration
post_install_kernel_options'
post_install_network_config'
func_register_if_enabled'
download_config_files'
koan_environment'
redhat_register'