云计算Linux运维——基础服务应用——cobbler批量部署系统(6)

点关注不迷路

目录

点关注不迷路

cobbler批量部署系统

一、cobbler介绍

1、cobbler特性:

二、cobbler服务安装部署

1、关闭防火墙、SELinux;确保正常访问互联网

2、安装cobbler相关软件

3、配置cobbler参数

4、配置DHCP服务

5、启动tftp服务

6、导入centos76镜像

7、测试centos7安装正常

8、添加centos66安装源

三、系统绑定


cobbler批量部署系统

一、cobbler介绍

由RedHat公司基于python语言开发

作用:快速批量部署Linux系统

1、cobbler特性:

  • 部署简单
  • 默认适用http共享系统安装文件
  • 支持系统定制
  • 提供API接口
  • 提供web管理界面

二、cobbler服务安装部署

1、关闭防火墙、SELinux;确保正常访问互联网

2、安装cobbler相关软件

[root@cobbler ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
[root@cobbler ~]# yum install -y cobbler cobbler-web dhcp tftp-server xinetd httpd 
[root@cobbler ~]# systemctl start cobblerd.service httpd 
[root@cobbler ~]# systemctl enable cobblerd.service httpd 

3、配置cobbler参数

[root@cobbler ~]# 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 : ksvalidator was not found, install pykickstart
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.

cobbler get-loaders失败解决方案:

# yum install -y syslinux
# cp /usr/share/syslinux/pxelinux.0 /var/lib/cobbler/loaders/
# cp /usr/share/syslinux/menu.c32 /var/lib/cobbler/loaders/

4、配置DHCP服务

[root@cobbler ~]# vim /etc/cobbler/settings 
manage_dhcp: 1
[root@cobbler ~]# vim /etc/cobbler/dhcp.template 
subnet 192.168.183.0 netmask 255.255.255.0 {
     option routers             192.168.183.2;
     option domain-name-servers 114.114.114.114,202.106.0.20;
     range dynamic-bootp        192.168.183.100 192.168.183.200;
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                $next_server;
[root@cobbler ~]# systemctl restart cobblerd
[root@cobbler ~]# cobbler sync 
[root@cobbler ~]# netstat -anup | grep dhcp
udp        0      0 0.0.0.0:67              0.0.0.0:*                           2065/dhcpd          
[root@cobbler ~]# 

5、启动tftp服务

[root@cobbler ~]# systemctl restart xinetd
[root@cobbler ~]# systemctl enable xinetd
[root@cobbler ~]# 
[root@cobbler ~]# netstat -anup | grep 69
udp        0      0 0.0.0.0:69              0.0.0.0:*                           2076/xinetd         
[root@cobbler ~]# 

6、导入centos76镜像

[root@cobbler ~]# mount /dev/sr0 /mnt/
[root@cobbler ~]# cobbler import --path=/mnt --name=CentOS74 --arch=x86_64 
[root@cobbler ~]# cobbler profile list
   CentOS74-x86_64
[root@cobbler ~]# cobbler profile report --name=CentOS7.6-x86_64
Name                           : CentOS7.6-x86_64
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : CentOS7.6-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
Kernel Options                 : {}
Kernel Options (Post Install)  : {}
Kickstart                      : /var/lib/cobbler/kickstarts/sample_end.ks

7、测试centos7安装正常

8、添加centos66安装源

替换centos6安装光盘

[root@cobbler ~]# mount /dev/sr0 /mnt/
[root@cobbler ~]# cobbler import --path=/mnt --name=CentOS66 --arch=x86_64

三、系统绑定

[root@cobbler ~]# cobbler system add --name=vm01_centos7 --profile=CentOS74-x86_64 --mac-address=00:50:56:21:AD:B1 --interface=eth0
[root@cobbler ~]# cobbler system list
   vm01_centos7

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

¥阿拉伯王子¥

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值