品运维自动化之cobbler的安装序
品运维自动化之cobbler的安装序
品茶提示:
1、安装如遇错误,请查看错误报告收集。
2、如遇文章出现错误之处请指出并回复以便帮助更多的朋友,或者发邮件至zwhset@163.com,我将定期回复。
2013/10/24更新内容:
1、添加ks.cfg文件 |
2012/11/2更新内容:
1、添加安装条件。 |
2012/11/3更新内容:
1、更新视平教程,建议全屏观看,挺清楚的。{注:声音哑了,不是太好。中间有一个卡顿是由于cobbler improt载入时间太长,将近半个小时。所以后期剪了一下。} |
使用前提:
1、你有一个DVD或ISO文件,您的操作系统的分布。 2、服务器有足够的本地磁盘的可用空间在/var/www/cobbler 解压缩DVD/ISO。 3、服务器和客户端都有一个共同的IP网络。 4、这个网络上的DHCP服务器的服务器是唯一的实例。 5、在此网络上的客户端是支持PXE网络启动。 |
Cobbler工作流程:
一、加载Fedor的Epel源
CentOS 5 x86_64 |
yum install cobbler httpd rsync tftp-server xinetd dhcp python-ctypes -y |
cobbler check |
vi /etc/cobbler/settings |
'next_server: 127.0.0.1' 替换成 'next_server:本机IP地址' {注:此为DHCP服务地址}
'server: 127.0.0.1' 替换成 'server: 192.168.0.28' {此为cobbler服务地址}
'manage_dhcp: 0' 替换成 'manage_dhcp: 1' {注:此为使cobbler管理dhcp也就是后面用于同步更新配置信息[cobbler sync]}
'manage_rsync: 0' 替换成 'manage_rsync: 1' {注:此为使cobbler管理rsync功能}
|
cobbler get-loaders |
vi /etc/xinetd.d/tftp |
vi /etc/xinetd.d/rsync |
openssl passwd -1 -salt 'random-phrase-here' 'your-password-here' |
vi /etc/cobbler/dhcp.template |
ddns-update-style interim;
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
#需要修改192.168.0.0为自己网段
subnet 192.168.0.0 netmask 255.255.255.0 {
#修改自己的路由
option routers 192.168.0.1;
#域名服务器地址
option domain-name-servers 202.106.0.20;
#子网掩码
option subnet-mask 255.255.255.0;
#分配IP地址段
range dynamic-bootp 192.168.0.100 192.168.0.254;
filename "/pxelinux.0";
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
}
|
mkdir -p /system/centos5.4-i686 |
mount -o loop ~/install/CentOS-5.5-x86-bin-DVD.iso /system/centos5.4-i686/ |
cobbler import --path=/system/centos5.4-i686/ --name=centos5.4-i686 --arch=x86_64 |
[root@cobbler ~]# du -sh /var/www/cobbler/ks_mirror/centos5.4-i686-x86_64/
3.9G/var/www/cobbler/ks_mirror/centos5.4-i686-x86_64/
[root@cobbler ~]# du -sh /system/centos5.4-i686/
4.1G/system/centos5.4-i686/
|
cobbler profile edit --name=centos5.4-i686-x86_64 --kickstart=??? |
Name : centos5.4-i686-x86_64
TFTP Boot Files : {}
Comment :
DHCP Tag : default
Distribution : centos5.4-i686-x86_64
Enable gPXE? : 0
Enable PXE Menu? : 1
Fetchable Files : {}
Kernel Options : {}
Kernel Options (Post Install) : {}
Kickstart : /var/lib/cobbler/kickstarts/sample.ks
Kickstart Metadata : {}
Management Classes : []
Management Parameters : <<inherit>>
Name Servers : []
Name Servers Search Path : []
Owners : ['admin']
Parent Profile :
Proxy :
Red Hat Management Key : <<inherit>>
Red Hat Management Server : <<inherit>>
Repos : []
Server Override : <<inherit>>
Template Files : {}
Virt Auto Boot : 1
Virt Bridge : xenbr0
Virt CPUs : 1
Virt Disk Driver Type : raw
Virt File Size(GB) : 5
Virt Path :
Virt RAM (MB) : 512
Virt Type : qemu
|
cobbler distro list |
cobbler sync |
10、正确安装后客户端启动出现图为如下:
The following are potential configuration items that you may want to fix:
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 : 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/.*"
4 : 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/.*"
5 : 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.
6 : change 'disable' to 'no' in /etc/xinetd.d/tftp
7 : change 'disable' to 'no' in /etc/xinetd.d/rsync
8 : debmirror package is not installed, it will be required to manage debian deployments and repositories
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
Restart cobblerd and then run 'cobbler sync' to apply changes.
|
2、什么是Rsync
rsync is an open source utility that provides fast incremental file transfer. rsync is freely available under the GNU General Public License and is currently being maintained by Wayne Davison.
Rsync是一个开源的 应用程序,提供快速增量文件传输。Rsync是免费提供根据GNU通用公共许可证,目前正在维护 韦恩·戴维森。 |
3、收集常用命令:
#重命名安装选项名字: cobbler profile rename --name='old name' –newname='new name' #册除选项: cobbler profile rename --name='old name' |
4、KickStart options详解:
引用:
kickstart是什么
许多系统管理员宁愿使用自动化的安装方法来安装红帽企业 Linux.为了满足这种需要,红帽创建了kickstart安装方法.使用kickstart,系统管理员可以创建一个文件,这个文件包含了在典型的安装过程中所遇 到的问题的答案. Kickstart文件可以存放于单一的服务器上,在安装过程中被独立的机器所读取.这个安装方法可以支持使用单一kickstart文件在多台机器上安装红帽企业Linux,这对于网络和系统管理员来说是个理想的选择. Kickstart给用户提供了一种自动化安装红帽企业Linux的方法. 如何执行kickstart安装 kickstart 安装可以使用本地光盘,本地硬盘驱动器,或通过 NFS,FTP,HTTP 来执行. 要使用 kickstart,必须: 1.创建一个kickstart文件. 2.创建有kickstart文件的引导介质或者使这个文件在网络上可用. 3.筹备安装树. 4.开始kickstart安装. http://blog.chinaunix.net/uid-17240700-id-2813881.html |
cobblerd does not appear to be running/accessible |
service cobblerd start
service httpd start
|
Starting httpd: Syntax error on line 10 of /etc/httpd/conf.d/cobbler.conf:
Invalid command 'WSGIScriptAliasMatch', perhaps misspelled or defined by a module not included in the server configuration
|
vi /etc/httpd/conf.d/wsgi.conf |
#LoadModule wsgi_module modules/mod_wsgi.so 去掉#号,使之成为:LoadModule wsgi_module modules/mod_wsgi.so。 |
httpd does not appear to be running and proxying cobbler, or SELinux is in the way. Original traceback:
Traceback (most recent call last):
|
service httpd start
vi /etc/sysconfig/selinux
SELINUX=enforcing更改为SELINUX=disabled,重启使之生效。
|
4、较验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: <Fault 1: "cobbler.cexceptions.CX:'login failed'">
|
service cobblerd restart
cobbler get-loaders
|
https://github.com/cobbler/cobbler/wiki/Start%20Here
http://dl528888.blog.51cto.com/2382721/1004298
#cobbler设置相关:
https://github.com/cobbler/cobbler/wiki/Using%20Cobbler%20Import
#KickStart配置: https://github.com/cobbler/cobbler/wiki/Kickstart%20snippets |
未完待续......
kickstart file:
注:这是从51CTO一网友搞过来的,忘了地址。
#set $swap= $getVar('$swap', '12000') autostep --autoscreenshot install url --url=$tree # If any cobbler repo definitions were referenced in the kickstart profile, include them here. $yum_repo_stanza text skipx lang en_US.UTF-8 keyboard us network --onboot yes --bootproto dhcp --noipv6 --nodns rootpw --iscrypted $1$xzY0mzCP$bBhzWwNV.ECfF.MV9PRkC1 firewall --disabled firstboot --disabled authconfig --enableshadow --passalgo=sha512 selinux --disabled #timezone --isUtc Asia/Shanghai timezone --utc Asia/Shanghai # The following is the partition information you requested # Note that any partitions you deleted are not expressed # here so unless you clear all partitions first, this is # not guaranteed to work logging --level=info #bootloader --append="nohz=off" --location=mbr bootloader --location=mbr #bootloader --location=mbr --driveorder=sda --append="biosdevname=0 nohz=off thash_entries=1048576 rhash_entries=1048576 selinux=0" zerombr yes # clearpart --all --initlabel --drives=sda clearpart --all --initlabel # ignoredisk --only-use=sda #part / --fstype=ext4 --asprimary --size=50000 --maxsize=50000 --label=/ #part swap --asprimary --size=$swap --maxsize=$swap --label=swap #part /data --fstype=xfs --grow --asprimary --size=12000 --label=/data part /boot --fstype="ext4" --size=200 part swap --fstype="swap" --size=1024 part / --fstype="ext4" --grow --size=1 %pre $SNIPPET('pre_install_network_config') # Add Pre-Installation Script here date %end %packages --excludedocs --ignoremissing @base @core @development @server-policy telnet -iptables %end $SNIPPET('services_disable_enable') %post $SNIPPET('post_install_network_config') $SNIPPET('env_init') $SNIPPET('kis_cobbler_api') $SNIPPET('cactirelease') $SNIPPET('kisyum_install') /usr/sbin/eject -rv /dev/sr* # eject P cdrom echo 'v1.3' > ~root/VERSION %end # finish reboot #reboot --eject |
煮酒品茶记于2012/11/1日
品运维自动化之cobbler的安装序相关推荐
- 运维自动化工具Cobbler之——安装实践
运维自动化工具--Cobbler实践 第1章 About Cobbler 1.1 Cobbler Introduction Cobbler是一个Linux服务器安装的服务,可以通过网络启动(PXE)的 ...
- 运维自动化之Cobbler安装配置
Cobbler是一个快速网络安装linux的服务,而且在经过调整也可以支持网络安装windows.该工具使用python开发,小巧轻便(才15k行代码),使用简单的命令即可完成PXE网络安装环境的配置 ...
- 运维自动化之 Cobbler 系统安装使用详解
一.简介 Cobbler是一个快速网络安装linux的服务,而且在经过调整也可以支持网络安装windows.该工具使用python开发,小巧轻便(才15k行python代码),使用简单的命令即可完成P ...
- Linux 运维自动化之Cobbler实战案例
大纲 一.前言 二.Cobbler 工作原理详解 三.Cobbler 常用命令汇总 四.Cobbler 各种目录说明 五.自定义Kickstart文件详解 六.Cobbler 实战案例安装CentOS ...
- 运维自动化工具-ansible的安装与ad-hoc模式场景应用
使用 yum 安装 yum install epel-release -y yum install ansible –y 无论是yum安装还是pip安装,都会遇到各种意外的错误,主要是安装的时候依赖比 ...
- 运维自动化之ansible playbook安装apache
上次介绍了如何使用ansible安装lnmp(地址是http://dl528888.blog.51cto.com/2382721/1440775),现在介绍如何使用ansible安装apache. 下 ...
- 自动化运维系列之Cobbler (资源)
2019独角兽企业重金招聘Python工程师标准>>> 下图为开源自动化运维体系链: 1.cobbler实现自动装机 2.saltstack实现工程自动化配置 3.kubernete ...
- 第19章,运维自动化之系统安装
更多内容请点击: Linux学习从入门到打死也不放弃,完全笔记整理(持续更新,求收藏,求点赞~~~~) https://blog.51cto.com/13683480/2095439 第19章,运维自 ...
- 运维自动化之ANSIBLE
成功不易,加倍努力! 运维自动化之ANSIBLE 本章内容 1 自动化运维应用场景 1.1 云计算运维工程师核心职能 1.2 运维职业发展路线 1.3 企业实际应用场景分析 1.3.1 Dev开发环境 ...
最新文章
- 2月国内搜索市场:360继续上升 百度下降0.62%
- DotNet 项目开发文档的自动生成和相关工具的使用
- spring事务(三)
- @所有人 Flink Forward Asia 2020 向您发出议题征集邀请!
- jQuery ajax - getScript() 方法
- 使用SAP云平台Portal service的前置条件
- 覆盖索引与联合索引_浅析MySQL的索引覆盖和索引下推
- mongodb mysql资源占用_如何限制mongodb启动时占用过多内存
- walle 2.0 上线部署
- linux qt 系统时间,QT在linux环境下读取和设置系统时间
- 当归饮(茶):治疗血虚
- 深度集成 Flink: Apache Iceberg 0.11.0 最新功能解读
- mac book 专用最新款win10镜像
- 机器视觉技术的应用领域
- IDEA价格对程序员来说九牛一毛,为啥这么多人用破解版?
- 程序人生 - BD 电影 HD 电影有什么区别啊?哪个好啊?
- CSAPP导读第3章 程序的机器级表示
- go-kit入门指南
- java erc 2.0_如何使用Web3j库管理Java中的ERC20令牌
- MatlabSimulink开发STM32F4
热门文章
- Git 存在多个漏洞,开发人员应及时更新
- 这款Linux 恶意软件正在劫持全球的超级计算机
- 30美元攻陷Intel SGX enclave,Intel 不打算修复
- [洛谷P1119]灾后重建
- EJB3.0高速入门项目开发步骤
- WampServer下开启curl
- Android4.0源码编译方法以及错误解决方案
- iPhone iPhoneSimulator.platform/Developer/usr/bin/clang++ failed with exit code 1 出现这种错误的原因是...
- 蓝桥杯 ADV-145 算法提高 铺地毯
- 蓝桥杯 ALGO-157 算法训练 阶乘末尾