cobbler部署安装CentOS6.8
Linux运维:cobbler
: Ago linux运维群:93324526
学习cobbler的话,必须先搞懂kickstart,原理不是,不懂如何排错。
kickstart部署请点击这里
1. Cobbler介绍
Cobbler是一个Linux服务器安装的服务,可以通过网络启动(PXE)的方式来快速安装、重装物理服务器和虚拟机,同时还可以管理DHCP,DNS等。
Cobbler可以使用命令行方式管理,也提供了基于Web的界面管理工具(cobbler-web),还提供了API接口,可以方便二次开发使用。
Cobbler是较早前的kickstart的升级版,优点是比较容易配置,还自带web界面比较易于管理。
Cobbler内置了一个轻量级配置管理系统,但它也支持和其它配置管理系统集成,如Puppet,暂时不支持SaltStack。
cobbler官网
1.1 Cobbler集成的服务
- PXE服务支持
- DHCP服务管理
- DNS服务管理(可选bind,dnsmasq)
- 电源管理
- Kickstart服务支持
- YUM仓库管理
- TFTP(PXE启动时需要)
- Apache(提供kickstart的安装源,并提供定制化的kickstart配置)
1.2 系统环境准备
[root@CentOS6 ~]# cat /etc/redhat-release
CentOS release 6.8 (Final)
[root@CentOS6 ~]# uname -r
2.6.32-642.el6.x86_64
[root@CentOS6 ~]# getenforce
Disabled
[root@CentOS6 ~]# /etc/init.d/iptables status
iptables: Firewall is not running.
[root@CentOS6 ~]# ifconfig eth0|awk -F "[ :]+" 'NR==2 {print $4}'
10.0.0.101
[root@CentOS6 ~]# hostname
CentOS6
[root@CentOS6 ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
注意:
- 虚拟机网卡采用NAT模式,不要使用桥接模式,因为稍后我们会搭建DHCP服务器,在同一局域网多个DHCP服务会有冲突。
- VMware的NAT模式的dhcp服务也关闭,避免干扰。
2.1 安装Cobbler
需要epel源
[root@CentOS6 ~]# yum -y install cobbler cobbler-web dhcp tftp-server pykickstart httpd
[root@CentOS6 ~]# rpm -ql cobbler # 查看安装的文件,下面列出部分。
/etc/cobbler # 配置文件目录
/etc/cobbler/settings # cobbler主配置文件,这个文件是YAML格式,Cobbler是python写的程序。
/etc/cobbler/dhcp.template # DHCP服务的配置模板
/etc/cobbler/tftpd.template # tftp服务的配置模板
/etc/cobbler/rsync.template # rsync服务的配置模板
/etc/cobbler/iso # iso模板配置文件目录
/etc/cobbler/pxe # pxe模板文件目录
/etc/cobbler/power # 电源的配置文件目录
/etc/cobbler/users.conf # Web服务授权配置文件
/etc/cobbler/users.digest # 用于web访问的用户名密码配置文件
/etc/cobbler/dnsmasq.template # DNS服务的配置模板
/etc/cobbler/modules.conf # Cobbler模块配置文件
/var/lib/cobbler # Cobbler数据目录
/var/lib/cobbler/config # 配置文件
/var/lib/cobbler/kickstarts # 默认存放kickstart文件
/var/lib/cobbler/loaders # 存放的各种引导程序
/var/www/cobbler # 系统安装镜像目录
/var/www/cobbler/ks_mirror # 导入的系统镜像列表
/var/www/cobbler/images # 导入的系统镜像启动文件
/var/www/cobbler/repo_mirror # yum源存储目录
/var/log/cobbler # 日志目录
/var/log/cobbler/install.log # 客户端系统安装日志
/var/log/cobbler/cobbler.log # cobbler日志
2.2 配置Cobbler
cobbler check
[root@CentOS6 ~]# cobbler check
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 : change 'disable' to 'no' in /etc/xinetd.d/tftp
4 : 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/rsync
6 : file /etc/xinetd.d/rsync does not exist
7 : debmirror package is not installed, it will be required to manage debian deployments and repositories
8 : 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
9 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
Restart cobblerd and then run 'cobbler sync' to apply changes.
解释一下9条内容
1.改变server的主机名
2.第二是DHCP的next_server改成172.16.1.101
3.改xined的tftp disable等于no
4.
5./etc/xinetd.d/rsync 也改成no
6.bug,已经存在
7.debin系统的源
8.生成密码并设置openssl passwd -1 -salt
9.fencing tools 高可用的硬件设备。
修改配置文件
命令直接复制粘贴即可
cp /etc/cobbler/settings{,.ori} #备份
sed -i 's/server: 127.0.0.1/server: 172.16.1.101/' /etc/cobbler/settings #服务端IP
sed -i 's/next_server: 127.0.0.1/next_server: 172.16.1.101/' /etc/cobbler/settings #服务端IP
sed -i 's/manage_dhcp: 0/manage_dhcp: 1/' /etc/cobbler/settings #dhcp只获取一次
sed -i 's/pxe_just_once: 0/pxe_just_once: 1/' /etc/cobbler/settings #cobbler只执行一遍
sed -ri "/default_password_crypted/s#(.*: ).*#\1\"`openssl passwd -1 -salt 'oldboy' '123456'`\"#" /etc/cobbler/settings #设置密码为123456
sed -i 's#yes#no#' /etc/xinetd.d/rsync #xinet 管理rsync
sed -i 's#yes#no#' /etc/xinetd.d/tftp #xinet 管理tftp
cobbler get-loaders #下载
sed -i 's#192.168.1#172.16.1#g;22d;23d' /etc/cobbler/dhcp.template # 修改dhcp配置文件
cobbler sync #写入磁盘
/etc/init.d/xinetd restart #启动三个必须启动的服务。详情请看kickstart
/etc/init.d/cobblerd restart
/etc/init.d/httpd restart
cobbler sync # 修改配置文件等,没事就来一次。保证没事
CentOS-6.8-x86_64.cfg
# Cobbler for Kickstart Configurator for CentOS 6.8 by yao zhang
install
url --url=$tree
text
lang en_US.UTF-8
keyboard us
zerombr
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
$SNIPPET('network_config')
timezone --utc Asia/Shanghai
authconfig --enableshadow --passalgo=sha512
rootpw --iscrypted $default_password_crypted
clearpart --all --initlabel
part /boot --fstype=ext4 --asprimary --size=200
part swap --size=1024
part / --fstype=ext4 --grow --asprimary --size=200
firstboot --disable
selinux --disabled
firewall --disabled
logging --level=info
reboot
%pre
$SNIPPET('log_ks_pre')
$SNIPPET('kickstart_start')
$SNIPPET('pre_install_network_config')
# Enable installation monitoring
$SNIPPET('pre_anamon')
%end
%packages
@base
@compat-libraries
@debugging
@development
tree
nmap
sysstat
lrzsz
dos2unix
telnet
%end
%post --nochroot
$SNIPPET('log_ks_post_nochroot')
%end
%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('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
图片详解,ks配置文件请看上方
1.登录界面
2.导入镜像,记得挂载光盘或者镜像文件
镜像位置/var/www/cobbler/ks_mirror/
3.自定义KS配置文件。请看上方
4.创建一个全局变量
5.制作yum仓库
6.导入yum仓库并创建全局变量
7.创建system
7.1.global
7.2.创建网卡
7.3.制作第二张网卡
7.4.拷贝和查看ks配置文件
8.注意事项
cobbler部署安装CentOS6.8的更多相关文章
- 使用Cobbler无人值守安装CentOS6.5(一)
Cobbler是一个快速网络安装linux的服务,而且在经过调整也可以支持网络安装windows.该工具使用python开发,小巧轻便(才15k行代码),使用简单的命令即可完成PXE网络安装环境的配置 ...
- cobbler部署安装
挂载光驱 # mount /dev/cdrom /mnt/ 安装cobbler所需软件 # yum install cobbler cobbler-web dhcp tftp-server pykic ...
- Cobbler自动化安装部署系统
自动化安装部署 https://www.cnblogs.com/nulige/p/6796593.html PXE+Kickstart工作原理 pxe+kickstart工作流程 网卡上的pxe芯片有 ...
- cobbler部署centos6与centos7系列
cobbler部署centos6与centos7系列 转载自:http://www.jianshu.com/p/a4bed77bf40d 版权声明:完全抄自 http://www.jianshu.co ...
- 自动化运维之Cobbler自动化部署安装操作系统
Cobbler概述: Cobbler可以用来快速建立 Linux 网络安装环境,它已将 Linux 网络安装的技术门槛,从大专以上文化水平,成功降低到初中以下,连补鞋匠都能学会. 在生产环境中,经常批 ...
- 末学者笔记--Centos7系统部署cobbler批量安装系统
[前言]: cobbler是一个可以实现批量安装系统的Linux应用程序.它有别于pxe+kickstart,cobbler可以实现同个服务器批量安装不同操作系统版本. 系统环境准备及其下载cob ...
- 006-(成功环境记录)基于Centos7系统部署cobbler批量安装系统
1.1 cobbler简介 Cobbler是一个Linux服务器安装的服务,可以通过网络启动(PXE)的方式来快速安装.重装物理服务器和虚拟机,同时还可以管理DHCP,DNS等. Cobbler可以使 ...
- 基于CentOS7系统部署cobbler批量安装系统(week3_day5_part1)-技术流ken
前言 cobbler是一个可以实现批量安装系统的Linux应用程序.它有别于pxe+kickstart,cobbler可以实现同个服务器批量安装不同操作系统版本. 系统环境准备及其下载cobbler ...
- centos7系统部署cobbler批量安装系统
系统环境: 一.开启两个网卡.一个仅主机模式,一个桥接模式,主机模式对内提供cobbler服务 [root@localhost ~]# ip a 1: lo: <LOOPBACK,UP,LOWE ...
随机推荐
- Alluxio 1.5集群搭建
一.依赖文件安装 1.1 JDK 参见博文:http://www.cnblogs.com/liugh/p/6623530.html 二.文件准备 2.1 文件名称 alluxio-1.5.0-hado ...
- HTML <hr>标签
HTML的<hr>标签用来插入一个水平分割线以把文档分成几部分. 水平线通常显示为一条突出的或者凹下去的线条. 在页面中特定的位置插入水平线,既能使页面的结构清晰,又能使整个页面显得美观, ...
- BPM与OA的区别及联系
BPM与OA的区别及联系 近年来,在企业管理信息系统一些名词反复被提及,然而外行人对于这些名词则是一头雾水,网上的解释又鱼龙混杂,没有绝对权威的文献可供参考,因此也就让我们对这些名词的认识越来越模糊. ...
- angular学习(三)-- $scope
1.3 视图数据模型:$scope $scope 是用来视图和数据之间的胶水.粘合剂 视图和控制器之间的数据桥梁 用于在视图和控制器之间传递数据 用来暴露数据模型(数据.行为) 监视模型数据的变化,做 ...
- 切换Ubuntu系统python默认版本的方法
另附切换系统python默认版本的方法: 先使用命令: update-alternatives --list python 查看python命令的各种可能结果, 例如我的结果: /usr/bin/py ...
- 微信小程序结合后台数据管理实现商品数据的动态展示、维护
微信小程序给我们提供了一个很好的开发平台,可以用于展现各种数据和实现丰富的功能,本篇随笔介绍微信小程序结合后台数据管理实现商品数据的动态展示.维护,介绍如何实现商品数据在后台管理系统中的维护管理,并通 ...
- 004-谈一谈lock和synchronized
这两个关键字都是用来对线程进行同步操作的. 参考疯狂java讲义16.5节 线程的同步. (完全答反了...)
- 关于request、response转发与重定向的简述
在做页面的请求与响应的时候我们多用request与response进行操作,而我们大家也知道,request是表示用户发向服务器的请求,而response是对用户请求的一个响应. 关于转发和重定向,通 ...
- Django创建博客
拜读http://www.cnblogs.com/fnng/p/3737964.html 后自操作步骤,mark一下 我的想法: modles.py中只负责添加类,定义数据结构,至于将该类添加到adm ...
- [2014-02-19]如何移除响应头中的.net framework 版本信息 以及mvc版本信息?
先来看一个简单mvc3网站的响应头 修改Global.asax文件 在Application_Start方法中添加如下代码 MvcHandler.DisableMvcResponseHeader = ...