Cobbler安装配置手册
更新时间:2024-05-29 05:31:01 阅读量: 综合文库 文档下载
目录
1. 2. 3. 4. 5. 6.
Cobbler的安装 ................................................................................................................. 2 Cobbler的配置 ................................................................................................................. 2 配置Cobbler_web ............................................................................................................ 4 导入光盘及建立Profile ................................................................................................... 5 配置Kickstart的启动文件 .............................................................................................. 5 安装系统 ........................................................................................................................... 7
1. Cobbler的安装
1. 下载rpmforge的repository RPM
# wgethttp://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-\\ 2.el6.rf.i686.rpm
2. 安装rpmforge-release-0.5.2-2.el6.rf.i686.rpm
# rpm-ivhrpmforge-release-0.5.2-2.el6.rf.i686.rpm 3. 安装semanage命令的包policycoreutils-python
# yum-y installpolicycoreutils-python 4. 安装pykickstart
#yum -y installpykickstart 5. 执行cobbler check
# cobbler check
6. 如果报下面错误,则先择selinux关闭
# cobbler check
httpd does not appear to be running and proxying cobbler # setenforce 0
7. 再执行cobbler check,并按照提示下的项进行配置
# cobbler check
2. Cobbler的配置
执行cobbler check,并按照提示下的项进行配置,通常的配置项如下: # cobbler check
1. 启动cobbler,httpd,xinetd,dhcpd服务
# servicehttpd start # servicexinetd start # servicecobblerd start
2. 执行cobbler check并按照提示下的项进行配置,通常的配置项如下从第3项开始:
# cobbler check
1 : 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 : Must enable a selinuxboolean to enable vital web services components, run: setsebool -P httpd_can_network_connect true
4 : you need to set some SELinux content rules to ensure cobbler serves content correctly in your SELinux environment, run the following: /usr/sbin/semanagefcontext -a -t public_content_t \&& /usr/sbin/semanagefcontext -a -t public_content_t \
5 : you need to set some SELinux rules if you want to use cobbler-web (an optional
package), run the following: /usr/sbin/semanagefcontext -a -t httpd_sys_content_rw_t \
6 : 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.
7 : change 'disable' to 'no' in /etc/xinetd.d/rsync
8 : since iptables may be running, ensure 69, 80, and 25151 are unblocked
9 :debmirror package is not installed, it will be required to manage debian deployments and repositories
10 :ksvalidator was not found, install pykickstart
11 : 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: \new one
Restart cobblerd and then run 'cobbler sync' to apply changes.
3. 编辑/etc/cobbler/settings,修改如下项:
server: 172.16.3.1 此处IP改为cobbler服务器的本机IP next_server: 172.16.3.1 此处IP改为cobbler服务器的本机IP manage_dhcp: 1 此处原本为0,修改为1打开DHCP服务 4. 编辑/etc/xinetd.d/tftp,修改
disable = no 此处原本为“yes”,修改为“no” 5. 编辑/etc/xinetd.d/rsync,修改
disable = no 此处原本为“yes”,修改为“no” 6. 编辑/etc/cobbler/dhcp.template,修改subnet部分如下:
配置两个subnet 172.16.3.0/24和172.16.1.0/24,如有其它subnet的主机需要使用cobbler安装OS,则增加此subnet。 subnet 172.16.3.0 netmask 255.255.255.0 { option routers 172.16.3.254; option domain-name-servers 172.16.3.1;
option subnet-mask 255.255.255.0;
range dynamic-bootp 172.16.3.100 172.16.3.120; filename \default-lease-time 21600; max-lease-time 43200; next-server 172.16.3.1; }
subnet 172.16.1.0 netmask 255.255.255.0 {
option routers 172.16.1.254; option domain-name-servers 172.16.3.1;
option subnet-mask 255.255.255.0;
range dynamic-bootp 172.16.1.100 172.16.1.120; filename \default-lease-time 21600; max-lease-time 43200; next-server 172.16.3.1;
}
7. 把上面的配置复制到/etc/dhcp/dhcpd.conf中。
8. 编辑/etc/sysconfig/iptables,添加下面几行以打开端口80,69和25151
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 69 -j ACCEPT -A INPUT -m state --state NEW -m udp -p udp --dport 69 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 25151 -j ACCEPT 然后再重启iptables # serviceiptables restart
9. 如果selinux开启,则根据cobbler check的提示,执行相应的命令以开启selinux相
关权限。
10. 执行cobbler get-loaders以下载OS的加载工具
# cobbler get-loaders
11. 所有项配置完毕后,执行cobbler sync。
# cobbler sync
3. 配置Cobbler_web
1. 安装依赖组件Django和mod_ssl
# yum-y installDjango # yum-y installmod_ssl 2. 安装cobbler_web
# yum-y installcobbler_web 3. 重启httpd以让ssl服务生效
# servicehttpd restart
4. 为Cobbler用户修改密码
# htdigest /etc/cobbler/users.digest \5. 为Cobbler Web增加新用户
# htdigest /etc/cobbler/users.digest \
6. 然后使用http://your_cobbler_ip/cobbler_web访问,登录后界面如下:
4. 导入光盘及建立Profile
1. 如果是ISO,先挂载到/mnt
# mount-t iso9660 CentOS-6.2-i386-bin-DVD1.iso /mnt-o loop 2. 如果是光盘,先挂载到/mnt
# mount /dev/cdrom /mnt 3. 使用cobbler命令导入镜像
# cobbler import --path=/mnt--name=CentOS6.2 --arch=i386 4. 编辑profile,修改kickstart启动文件为CentOS6.2-i386.ks
# cobbler profile edit --name=CentOS6.2-i386 --distro=CentOS6.2-i386 --kickstart=/var/lib/cobbler/kickstarts/CentOS6.2-i386.ks 5. 执行cobbler sync
# cobbler sync
5. 配置Kickstart的启动文件
模板如下,根据实际情况修改,后面红色字样为注释。 #platform=x86, AMD64, or Intel EM64T #version=DEVEL
# Firewall configuration firewall --enabled --ssh --开启firewall,并启用ssh端口 # Install OS instead of upgrade install
##### Use CDROM installation media #####cdrom
# Use network installation url --url=$tree #Root password
rootpw --iscrypted $default_password_crypted --使用default_password_crypted为新 # System authorization information --装OS的root密码,在settings中修改
auth --useshadow --passalgo=sha512 # Use text mode install text --文字安装模式 # System keyboard keyboard us --美式键盘 # System language langen_US --默认语方为英文 # SELinux configuration selinux --enforcing --开启selinux # Do not configure the X Window System skipx
# Installation logging level logging --level=info
# Reboot after installation reboot
# Clear the Master Boot Record zerombr
# System timezone
timezone Asia/Shanghai
# If any cobbler repo definitions were referenced in the kickstart profile, include them here. $yum_repo_stanza # Network information
$SNIPPET('network_config')
# System bootloader configuration bootloader --location=mbr
# Partition clearing information clearpart --all --initlabel
# Run the Setup Agent on first boot firstboot --disable
# Disk partitioning information --配置partition part /boot --fstype=\part swap --fstype=\part pv.01 --fstype=\volgroupvg_root pv.01
logvol / --vgname=vg_root --name=lv_root --fstype=\logvol /home --vgname=vg_root --name=lv_home --fstype=\logvol /var --vgname=vg_root --name=lv_var --fstype=\logvol /usr --vgname=vg_root --name=lv_usr --fstype=\logvol /tmp --vgname=vg_root --name=lv_tmp --fstype=\logvol /opt --vgname=vg_root --name=lv_opt --fstype=\part pv.02 --fstype=\volgroupvg_data pv.02
%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') @chinese-support @emacs @fonts
@system-management-snmp @x11
%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 %end
--需要安装的包
6. 安装系统
6.1安装操作系统
1. 把需要安装操作系统的机器连到内网,保证此机器与cobbler服务器之间连通性正常。
如经过防火墙,必须保证能访问80,69端口。 2. 修改BIOS为PXE启动,重启。之后就可以看到启动界面如下,选择相应的OS profile
(这里为CentOS6.2-i386)就可以开始安装了。
6.2重装操作系统
1. 在需要重装操作系统的服务器上安装koan
# wgethttp://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.\\ el6.rf.i686.rpm
# rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm # yum-y installkoan
2. 执行下面命令以拿到所有的profiles
# koan --server=172.16.3.1 --list=profiles
- looking for Cobbler at http://172.16.3.1:80/cobbler_api RHEL6.0-i386 CentOS6.2-i386
3. 执行下面命令以初始化重装
# koan--server=172.16.3.1 --profile= CentOS6.2-i386--replace-self 4. 然后执行reboot重启当前机器以重装
# reboot
正在阅读:
Cobbler安装配置手册05-29
2021年医保个人述职报告三篇04-27
我学会了坚持作文06-21
窗外的星空作文600字06-21
赛迪顾问-日本大地震后我国承接日本电子信息产业国际转移的机会03-30
校车及雷锋精神英语作文04-23
沪教版一年级语文上册教案全集04-23
《汽车运行材料》复习资料10-13
- 多层物业服务方案
- (审判实务)习惯法与少数民族地区民间纠纷解决问题(孙 潋)
- 人教版新课标六年级下册语文全册教案
- 词语打卡
- photoshop实习报告
- 钢结构设计原理综合测试2
- 2014年期末练习题
- 高中数学中的逆向思维解题方法探讨
- 名师原创 全国通用2014-2015学年高二寒假作业 政治(一)Word版
- 北航《建筑结构检测鉴定与加固》在线作业三
- XX县卫生监督所工程建设项目可行性研究报告
- 小学四年级观察作文经典评语
- 浅谈110KV变电站电气一次设计-程泉焱(1)
- 安全员考试题库
- 国家电网公司变电运维管理规定(试行)
- 义务教育课程标准稿征求意见提纲
- 教学秘书面试技巧
- 钢结构工程施工组织设计
- 水利工程概论论文
- 09届九年级数学第四次模拟试卷
- 配置
- Cobbler
- 手册
- 安装