CentOS 6上安装Cobbler及常见参数详解(2)

#使用yum-plugin-downloadonly插件yum install -y yum-plugin-downloadonly
yum install
--downloadonly
--downloaddir=/tmp/cobbler
cobbler
cobbler-web
httpd rsync
tftp-server
xinetd
dhcp
 python-ctypes
 debmirror
pykickstart
cman
fence-agents
 dnsmasq必要服务
(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配置,常见错误如下
cobbler check1 : 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 : change 'disable' to 'no' in /etc/xinetd.d/tftp4 : 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.5 : change 'disable' to 'no' in /etc/xinetd.d/rsync6 : file /etc/xinetd.d/rsync does not exist7 : debmirror package is not installed, it will be required to manage debian
deployments and repositories8 : ksvalidator was not found, install pykickstart9 : 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 one10 : fencing tools were not found, and are required to use the (optional)
power management features. install cman or fence-agents to use them1.编辑/etc/cobbler/settings文件,找到 server选项,修改为本机IP即可
2.编辑/etc/cobbler/settings文件,找到 next_server选项,修改为本机IP即可
3.SELinux的设置, 如果上面已经关闭了SELinux就不用管了
4.执行 cobbler get-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中的密码。生成密码命令:openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'其中“random-phrase-here”为任意字符
10.安装cman或者fence-agents
关闭selinux/iptables
sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
setenforce 0
chkconfig iptables off
service iptables stop
设置tftp服务和rsync服务
sed -i '/disable/c\tdisable\t\t\t= no' /etc/xinetd.d/tftp
sed -i -e 's/\=\ yes/\=\ no/g' /etc/xinetd.d/rsync
设置DHCP server的IP
sed -i 's/next_server: 127.0.0.1/next_server: 172.28.70.245/g' /etc/cobbler/settings
设置cobbler的IP
sed -i 's/server: 127.0.0.1/server: 172.28.70.245/g' /etc/cobbler/settings
设置Cobbler管理rsync
sed -i 's/manage_rsync: 0/manage_rsync: 1/g' /etc/cobbler/settings
设置Cobbler管理DHCP
sed -i 's/manage_dhcp: 0/manage_dhcp: 1/g' /etc/cobbler/settings
设置Cobbler一次安装开关(可选)
sed -i 's/pxe_just_once: 0/pxe_just_once: 1/g' /etc/cobbler/settings
设置Cobbler管理DNS(可选)
sed -i 's/manage_dns: 0/manage_dns: 1/g' /etc/cobbler/settings
开启动态更新(可选)
sed -i 's/allow_dynamic_settings: 0/allow_dynamic_settings: 1/g' /etc/cobbler/settings
设置debmirror
sed -i -e 's/@dists=/#@dists=/g' /etc/debmirror.conf
sed -i -e 's/@arches=/#@arches=/g' /etc/debmirror.conf
编辑dnsmasq.template中dhcp-range部分
#vi /etc/cobbler/dnsmasq.templatevi /etc/dnsmasq.conf# Cobbler generated configuration file for dnsmasq# $date## resolve.conf .. ?#no-poll#enable-dbusread-ethers
addn-hosts = /var/lib/cobbler/cobbler_hosts

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/14741.html