cobbler安装配置(二)
安装环境:
操作系统:CentOS 6.5 x86_64
测试机器ip:192.168.0.1
关闭防火墙、selinux:
service iptables stop && chkconfig iptables off
setenforce 0
一、导入yum源,安装软件
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
[root@cobbler]# yum install cobbler httpd rsync tftp-server xinetd dhcp mkisofs python-ctypes mod_python createrepo python-cheetah python-simplejson yum-utils libyaml python-netaddr PyYAML -y
二、配置cobbler
1.修改cobbler 的配置文件
vim /etc/cobbler/settings
修改如下地方:
next_server: 192.168.0.1
server: 192.168.0.1
manage_dhcp: 1
manage_dhcp:1 cobbler管理dhcpd服务,通过cobbler rsync会将模板配置同步到dhcpd.conf。
2.生成密码串
[root@cobbler ~]# openssl passwd -1 -salt 'Noway11' 'Noway11'
$1$Noway11$NiYLjIVH3z8jGOOLmz2Il0
openssl passwd -1 -salt '任间字符' '密码'
(任意字符可以随便写,这个密码就是安装完系统root的密码,需要替换配置文件里的字符串)
vim /etc/cobbler/settings
default_password_crypted: "$1$Noway11$NiYLjIVH3z8jGOOLmz2Il0"
3.启用tfptd和rsync
vim /etc/xinetd.d/tftp
vim /etc/xinetd.d/rsync
将disable的值修改成no
启动xinetd服务
/etc/init.d/xinetd restart
4.修改dhcp的配置文件
[root@cobbler cobbler]# cat /etc/cobbler/dhcp.template
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;
range dynamic-bootp 192.168.0.100 192.168.0.200;
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
注释:
option routers:路由地址
option domain-name-servers:DNS服务器地址
option subnet-mask:子网掩码
range:DHCP地址范围
range dynamic-bootp:为pxe client分配地址范围
5.检查/同步配置
[root@cobbler ~]# cobbler check
[root@cobbler ~]# cobbler sync
注意:每次修改配置文件后用cobbler sync同步数据,过程中会重启dhcpd服务并重启cobbler。
6.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 : enable and start rsyncd.service with systemctl
6 : debmirror package is not installed, it will be required to manage debian deployments and repositories
7 : 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
8 : 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.
问题1、2、7可以通过修改cobbler、dhcp.template、xinetd配置解决;
问题4:cobbler get-loaders
解决问题5:
Centos 6 -- 这个问题可以忽略,在Centos 6下未解决
Centos 7 -- systemctl enable rsyncd.service
问题6:为deban包,不需要处理
问题8:待补充(真机电源管理)
三、导入镜像源
1.挂载本地镜像文件
[root@cobbler]# mount -t iso9660 -o loop CentOS-6.9-x86_64-bin-DVD1.iso /mnt
2.导入镜像源
[root@cobbler]# cobbler import --path=/mnt/ --name=centos6.9-x86_64 --arch=x86_64
task started: 2017-12-28_094624_import
task started (id=Media import, time=Thu Dec 28 09:46:24 2017)
Found a candidate signature: breed=redhat, version=rhel6
Found a matching signature: breed=redhat, version=rhel6
Adding distros from path /var/www/cobbler/ks_mirror/centos6.9-x86_64:
creating new distro: centos6.9-x86_64
trying symlink: /var/www/cobbler/ks_mirror/centos6.9-x86_64 -> /var/www/cobbler/links/centos6.9-x86_64
creating new profile: centos6.9-x86_64
associating repos
checking for rsync repo(s)
checking for rhn repo(s)
checking for yum repo(s)
starting descent into /var/www/cobbler/ks_mirror/centos6.9-x86_64 for centos6.9-x86_64
processing repo at : /var/www/cobbler/ks_mirror/centos6.9-x86_64
need to process repo/comps: /var/www/cobbler/ks_mirror/centos6.9-x86_64
looking for /var/www/cobbler/ks_mirror/centos6.9-x86_64/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/centos6.9-x86_64/repodata
*** TASK COMPLETE ***
这个时间比较长,需要等待。
四、修改ks文件
ks的默认生效文件是/var/lib/cobbler/kickstarts/sample.ks,而不是default.ks(/etc/cobbler/settings中有配置说明)。
可以通过命令修改kickstart配置文件:
[root@cobbler]# cobbler profile edit --name=CentOS-6.9-x86_64 --kickstart=/var/lib/cobbler/kickstarts/xxx.ks
[root@cobbler]# vim /var/lib/cobbler/kickstarts/sample.ks
auth --useshadow --enablemd5
bootloader --location=mbr
zerombr
clearpart --all --initlabel
#graphical
text
firewall --disabled
firstboot --disable
keyboard us
lang en_US
logging --level=info
url --url=http://192.168.0.1/cobbler/ks_mirror/CentOS-6.5-x86_64/
network --bootproto=dhcp --device=eth0 --onboot=on --noipv6
rootpw --iscrypted $1$Pw9b.hdj$VyKT.yOk/e2k4pbDslKKc.
selinux --disabled
timezone --isUtc Asia/Shanghai
install
clearpart --all --initlabel
part /boot --fstype ext3 --size=100
part / --fstype ext3 --size=2000
part swap --fstype swap --size=1000
part /opt --fstype ext3 --grow --size=1
%packages
@development-libs
@base
@development-tools
@legacy-software-development
@legacy-software-support
@editors
五、cobbler命令
1.查看distro配置
cobbler distro report
2.查看profile配置
cobbler profile report
ks文件放到/var/lib/cobbler/kickstarts/目录下,cbbler通过读取该文件,执行相关安装步骤
3. 查看system配置
cobbler system report
根据MAC地址零交互安装:
创建一个新的自定义安装
cobbler system add --name=odb01.prod.ding --mac=00:0c:29:34:58:f1 --profile=Centos-6.9-x86_64 --ip-address=192.168.0.20 --subnet=255.255.255.0 --gateway=192.168.0.1 --interface=eth1 --static=1 --hostname=odb01.prod.ding --name-servers="202.106.0.20"
修改自定义安装(name不可修改)
cobbler system edit --name=odb01.prod.ding --mac=00:0c:29:34:58:f1 --profile=Centos-6.9-x86_64 --ip-address=192.168.0.20 --subnet=255.255.255.0 --gateway=192.168.0.1 --interface=eth1 --static=1 --hostname=odb01.prod.ding --name-servers="202.106.0.20"
4.修改展示页面内容:
[root@cobbler]# cat /etc/cobbler/pxe/pxedefault.template
DEFAULT menu
PROMPT 0
MENU TITLE Cobbler | 系统自动化部署
TIMEOUT 200
TOTALTIMEOUT 6000
ONTIMEOUT $pxe_timeout_profile
LABEL local
MENU LABEL (local)
MENU DEFAULT
LOCALBOOT -1
$pxe_menu_items
MENU end
5.自动重装系统(注意:客户机配置)
问题:虽然可以重装系统,但是不能设置IP、DNS、主机名
解决:重装时候,生成专门为这台机器使用的一次性系统profile,网卡ip配置可以通过远程管理卡实现,应用配置可以通过自动化管理工具实现。
客户机安装koan:
yum install koan -y
获取Cobbler服务器上的可用系统列表:
[root@test ~]# koan --server=192.168.0.1 --list=profiles
- looking for Cobbler at http://192.168.0.1:80/cobbler_api
Centos-6.9-x86_64
选择要重装的系统,执行安装命令(重做系统执行):
koan --replace-self --server=192.168.0.1 --profile=Centos-6.9-x886_64
六、Cobbler WEB配置
https://192.168.0.1/cobbler_web
cobbler安装配置(二)的更多相关文章
- Linux装机利器Cobbler安装配置
Linux装机利器Cobbler安装配置 2011-05-27 15:31:05 分类: LINUX 一.安装环境 centos 5.4 关掉iptables 关掉 selinux selinux ...
- MYSQL + MHA +keepalive + VIP安装配置(二)--MHA的配置
一.总概 1.MHA介绍 MHA(Master High Availability)是自动的master故障转移和Slave提升的软件包.它是基于标准的MySQL复制(异步/半同步). MH ...
- RHEL7-openldap安装配置二(客户端安装配置)
LDAP用户登录流程: 当在客户端输入账号登录系统时,系统根据/etc/nsswitch.conf配置文件获取账号查找顺序,然后再根据PAM配置文件调用相关模块,对账号(/etc/passwd)及密码 ...
- cobbler安装配置.基本全了多看help和docs
env 系统环境配置,软件包安装 centos7 yum update -y sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/sysconfig/ ...
- Cobbler安装配置简单使用
安装Cobbler [root@linux-node3 ~]# yum -y install epel-release [root@linux-node3 ~]# yum -y install cob ...
- jenkins安装配置[二]
标签(linux): jenkins 笔者Q:972581034 交流群:605799367.有任何疑问可与笔者或加群交流 安装依赖,如果本机已有java环境可跳过 yum install java- ...
- redis主从+哨兵 安装配置二
实验环境: 192.168.2.201 centos7 master sentinel 192.168.2.202 centos7 slave sentinel 192.168.2.203 cen ...
- Centos7 下cobbler安装及配置
1.背景介绍 作为运维,在公司经常遇到一些机械性重复工作要做,例如:为新机器装系统,一台两台机器装系统,可以用光盘.U盘等介质安装,1小时也完成了,但是如果有成百台的服务器还要用光盘.U盘去安装,就显 ...
- Centos7.4 下cobbler安装及配置
1.背景介绍 作为运维,在公司经常遇到一些机械性重复工作要做,例如:为新机器装系统,一台两台机器装系统,可以用光盘.U盘等介质安装,1小时也完成了,但是如果有成百台的服务器还要用光盘.U盘去安装,就显 ...
随机推荐
- 一文带你读懂 Mysql 和 InnoDB存储引擎
作为一名开发人员,在日常的工作中会难以避免地接触到数据库,无论是基于文件的 sqlite 还是工程上使用非常广泛的 MySQL.PostgreSQL,但是一直以来也没有对数据库有一个非常清晰并且成体系 ...
- Spring AOP初步总结(二)
该篇为Spring AOP的一个应用案例:系统日志 需求:将任何删除,更改或新增数据库的操作汇总到数据库中 步骤1:编写切面 @Aspect @Component public class SysLo ...
- css3 变换、过渡效果、动画
1 CSS3 选择器 1.1 基本选择器 1.2 层级 空格 > + .item+li ~ .item~p 1.3 属性选择器 [attr] [attr=value] [attr^=value] ...
- python第一模块基础语法
一·python和各大高级语言的优缺点比较 1.c语言开发效率低 2.c++开发效率高于c语言,低于java,python. 3.java代码臃肿,设计复杂,库繁杂量多. 4.PHP应用领域单一,且运 ...
- 微信公众号与HTML 5混合模式揭秘5——JSSDK开发技巧1
微信公众号与HTML 5混合模式揭秘1——如何部署JSSDK 微信公众号与HTML 5混合模式揭秘2——分享手机相册中照片 微信公众号与HTML 5混合模式揭秘3——JSSDK获取地理位置 微信公众号 ...
- 倒计时器 CountDownTimer
使用介绍 开发中经常会遇到一些和倒计时有关的场景,比如发送验证码的按钮,会在点击发送后,显示倒计时间,倒计时结束后才能够刷新按钮,再次允许点击.为了不阻塞软件的运行,又要实时刷新界面,我们通常会用到 ...
- Python安装第三方库文件工具——pip
Python安装第三方库文件一般使用pip. 1.pip的安装 (1)下载pip 进入https://pypi.python.org/pypi/pip#downloads
- NBUT 1118 Marisa's Affair (排序统计,水)
题意: 每行给出一个人名和一个int值,人名可重复出现.要求对同一个人名统计int值,最大的先输出,若相同,则按照人名出现次数,若再相同,则按照人名字典序. 思路: 输入完全部进行排序,写个比较函数传 ...
- codevs 1992 聚会
时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题目描述 Description 小S 想要从某地出发去同学k的家中参加一个party,但要有去有回.他想让所用的 ...
- Mybatis Learning Notes 1
Mybatis Learning Notes 主要的参考是博客园竹山一叶的Blog,这里记录的是自己补充的内容 实体类属性名和数据库不一致的处理 如果是实体类的结果和真正的数据库的column的名称不 ...