cobbler批量装机系统centos 6.4下安装配置

最近笔者研究cobbler批量装机系统。
cobbler装机系统是较早前kickstart的升级版,优点比较容易配置,还自带web界面比较易于管理,不足在于中文资料较少。
这里就详细的介绍下笔者亲自经历的一次安装过程。
开始的时候笔者用的是centos 5.8系统,但是在安装cpbbler-web的时候报错,于是这次采用了centos6.4系统进行安装配置。

二:配置环境

2>启用tfpt 和 rsync
vim /etc/xinetd.d/tftp
vim /etc/xinetd.d/rsync
将disable的值修改成no
启动服务
/etc/init.d/xinetd restart
3>修改dhcp的配置文件


图形界面操作点击Importer DVD (先挂载镜像ISO),然后再Importer,点击run


导入完成后可以看到

选择左侧profile配置ks文件

输入你所需要的ks文件路径

Centos6.ks文件如下,这里只是个比较简单的ks文件,大家可以根据自己的需求配置。

#platform=x86, AMD64, or Intel EM64T

# System authorization information

auth  --useshadow  --enablemd5

# System bootloader configuration

bootloader --location=mbr

# Partition clearing information

clearpart --all --initlabel

# Use text mode install

text

# Firewall configuration

firewall --disable

# Run the Setup Agent on first boot

firstboot --disable

# System keyboard

keyboard us

# System language

lang en_US

# Use network installation

url --url=$tree

# If any cobbler repo definitions were referenced in the kickstart profile, include them here.

$yum_repo_stanza

# Network information

$SNIPPET('network_config')

# Reboot after installation

reboot

#Root password

rootpw --iscrypted $default_password_crypted

# SELinux configuration

selinux --disabled

# Do not configure the X Window System

skipx

# System timezone

timezone  --utc Asia/Shanghai

# Install OS instead of upgrade

install

# Clear the Master Boot Record

zerombr

# Allow anaconda to partition the system as needed

autopart

clearpart --all --drives=sda --initlabel

part /boot --fstype ext3 --size=200

part / --fstype ext3 --size=8000

part swap --size=2048

 

%pre

$SNIPPET('log_ks_pre')

$kickstart_start

$SNIPPET('pre_install_network_config')

# Enable installation monitoring

$SNIPPET('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

puppet

 

%pre

$SNIPPET('log_ks_pre')

$SNIPPET('kickstart_start')

$SNIPPET('pre_install_network_config')

# Enable installation monitoring

$SNIPPET('pre_anamon')

%packages

$SNIPPET('func_install_if_enabled')

$SNIPPET('puppet_install_if_enabled')

%post

$SNIPPET('log_ks_post')

# Start yum configuration

$yum_config_stanza

# End yum configuration

$SNIPPET('post_install_kernel_options')

$SNIPPET('post_install_network_config')

$SNIPPET('func_register_if_enabled')

$SNIPPET('puppet_register_if_enabled')

$SNIPPET('download_config_files')

$SNIPPET('koan_environment')

$SNIPPET('redhat_register')

$SNIPPET('cobbler_register')

# Enable post-install boot notification

$SNIPPET('post_anamon')

# Start final steps

$SNIPPET('kickstart_done')

# End final steps

 

 

5:客户端从网络启动后选择对应的工程文件开始自动部署


选择配置好的选项开始自动安装

完成后自动重启,可以用先前定义好的密码("123456")登陆了.

附:错误排除
# cobbler check
The following are potential configuration items that you may want to fix:
1 : Must enable a selinux boolean to enable vital web services components, run: setsebool -P httpd_can_network_connect true
2 : you need to set some SELinux content rules to ensure cobbler serves content correctly in your SELinux environment, run the following: /usr/sbin/semanage fcontext -a -t public_content_t "/tftpboot/.*" && /usr/sbin/semanage fcontext -a -t public_content_t "/var/www/cobbler"/images/.*
3 : you need to set some SELinux rules if you want to use cobbler-web (an optional package), run the following: /usr/sbin/semanage fcontext -a -t httpd_sys_content_rw_t "/var/lib/cobbler/webui_sessions/.*"
解决:关闭selinux
# vim /etc/sysconfig/selinux
SELINUX=disabled
4 : change 'disable' to 'no' in /etc/xinetd.d/tftp
解决:编辑/etc/xinetd.d/tftp文件,将文件中的disable字段的配置由yes改为no
5 : change 'disable' to 'no' in /etc/xinetd.d/rsync
解决:编辑/etc/xinetd.d/rsync文件,将文件中的disable字段的配置由yes改为no
6 : since iptables may be running, ensure 69, 80, and 25151 are unblocked
解决:在iptables中将698025151端口打开。如果仅仅只是在内部环境中使用,建议直接将防火墙关掉
7 : debmirror package is not installed, it will be required to manage debian deployments and repositories
解决:yum install debmirror
或:rpm -Uvh ftp://rpmfind.net/linux/epel/5/i386/debmirror-20090807-1.el5.noarch.rpm –nodeps –force
8 : ksvalidator was not found, install pykickstart
解决:yum install pykickstart
9 : 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
解决: 修改默认密码就OK了,然后把密码写入到/etc/cobbler/settings
# openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'
10 : comment 'dists' on /etc/debmirror.conf for proper debian support
11 : comment 'arches' on /etc/debmirror.conf for proper debian support
解决:注释/etc/debmirror.conf 下面两行
#@dists="sid";
@sections="main,main/debian-installer,contrib,non-free";
#@arches="i386";
12fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
解决: yum install cman
修复完成,再用 cobbler check 检查一下,确认没问题后用 cobbler sync 做同步操作:
# cobbler check
No configuration problems found. All systems go.

13. comment out 'dists' on /etc/debmirror.conf for proper debian support

comment out 'arches' on /etc/debmirror.conf for proper debian supportvim              vi /etc/debmirror.conf

#注释掉@dists="sid"@arches="i386即可

#@dists="sid";

#@arches="i386";

14. 较验cobbler check出错

Traceback (most recent call last):

 File "/usr/bin/cobbler", line 35, in ?

 sys.exit(app.main())

 File "/usr/lib/python2.4/site-packages/cobbler/cli.py", line 558, in main

 rc = cli.run(sys.argv)

 File "/usr/lib/python2.4/site-packages/cobbler/cli.py", line 202, in run

 self.token = self.remote.login("", self.shared_secret)

 File "/usr/lib64/python2.4/xmlrpclib.py", line 1096, in __call__

 return self.__send(self.__name, args)

 File "/usr/lib64/python2.4/xmlrpclib.py", line 1383, in __request

 verbose=self.__verbose

 File "/usr/lib64/python2.4/xmlrpclib.py", line 1147, in request

 return self._parse_response(h.getfile(), sock)

 File "/usr/lib64/python2.4/xmlrpclib.py", line 1286, in _parse_response

 return u.close()

 File "/usr/lib64/python2.4/xmlrpclib.py", line 744, in close

 raise Fault(**self._stack[0])

xmlrpclib.Fault:

解决方法:此为BUG,按下方操作执行即

service cobblerd restart

cobbler get-loaders


返回这个结果就OK



<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
阅读(5609) | 评论(2) | 转发(5) |
给主人留下些什么吧!~~

shouyu9242015-11-22 00:06:49

ks.cfg文件出错,想不明白你怎么装上的,ks.cfg文件中已有一个autopart命令,紧接着又进行分区,重复操作,安装报错

CU博客助理2014-06-12 10:31:03

专家点评:有步骤、有排障的图文并茂的好文,实践性很强,很好的参考。

评论热议

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值