Linux网络----Cobbler自动装机

本文详细介绍了Cobbler自动装机的步骤,包括环境设置、安装与配置Cobbler服务、导入系统镜像、测试装机及cobbler-web认证管理。Cobbler是一个用Python开发的开源项目,用于快速批量部署Linux系统。

Cobbler自动装机(装机步骤,优化内容详解,导入系统镜像步骤,cobbler-web管理认证方式)

前言

  • Cobbler是一个使用Python开发的开源项目,通过将部署系统所涉及的所有服务集中在一起,来提供一个全自动批量快速建立Linux系统的网络安装环境

  • Cobbler最初支持Fedora,RedHat和衍生版(如CentOS和Scientific Linux),限制还支持Debian,Ubuntu,SuSE以及FreeBSD,ESXI等

  • Cobbler中文译名:补鞋匠

  • Cobbler提供了DHCP管理,YUM源管理,电源管理等功能,除此之外还支持命令行管理,WEB界面管理,并且提供了API接口,方便进行二次开发

一:环境设置与安装 步骤

1.1:环境设置

  • 使用VMware软件演示
  • 安装CentOS 7操作系统当做服务端
  • 新建CentOS 7虚拟机当做客户端,留作安装系统

1.2:安装信息库软件包

  • yum 安装信息库软件包

  • [root@shell lpf]# yum install -y epel-release
    

    1.3:安装Cobbler环境

  • [root@shell ~]# mount /dev/sr0 /mnt		'需要保证虚拟机已经连接镜像'
    mount: /dev/sr0 is write-protected, mounting read-only
    [root@shell ~]# df -hT
    Filesystem     Type      Size  Used Avail Use% Mounted on
    /dev/sda2      xfs        20G  3.5G   17G  18% /
    ...省略内容
    /dev/sr0       iso9660   4.3G  4.3G     0 100% /mnt
    [root@shell ~]# yum install cobbler cobbler-web dhcp tftp-server pykickstart httpd rsync xinetd -y	'这些服务环境软件包都要安装'
    

1.4:安装步骤

1.4.1:大致方向
  • cobbler服务:自动部署装机

  • dhcp:自动分配IP地址使新机器和服务器在同一个段落互联互通

  • tftp:压缩内核,引导程序(速度快)

  • ftp:iso镜像文件

  • CentOS 7设置

    systemctl start network.service

    systemctl enable httpd

1.4.2:cobbler工具配置(有工具可以忽略)
  • ifconfig工具

    yum install net-tools -y
    nslookup 127.0.0.1 | grep server '//查看本机自动获取IP中的DNS地址'
    
  • mount.cifs工具

    yum install cifs-utils -y	'//挂载宿主机共享文件夹'
    
1.4.3:正式部署安装
yum install cobbler cobbler-web dhcp tftp-server pykickstart httpd rsync xinetd -y
systemctl restart httpd.service
systemctl start cobblerd.service
cobbler check
  • 接下来开始搞配置文件
vim /etc/cobbler/settings     '//修改配置文件'
next_server:192.168.197.175    '//指定PXE位置'
server:192.168.197.175          '//指定cobbler服务地址'
manage_dhcp:1   '//管理dhcp启动'
systemctl stop firewalld.service   '//关闭防火墙'
setenforce 0	'//关闭增强安全性功能'
  • cobbler check 检查需要优化的内容
'cobbler check 检查的结果进行优化'
wq设置密码
openssl passwd -1 -salt 'abner' 'abner' '//盐值加密'
'//加密结果'
继续回settings文件中
default_password_crypted:“加密结果”
保存退出settings文件
cobbler get-loaders		'//下载引导操作系统文件'
systemctl start rsyncd.service 	'//启动服务'
vim /etc/xinete.d/tftp
disable = no 	'//启动'
systemctl restart xinetd.service 	'//重启服务'
vim /etc/cobbler/dhcp.template		'//cobbler控制的dhcp服务模板'
subnet 192.168.197.0 netmask 255.255.255.0 {
   
   
    option routers			    192.168.197.1;	'//修改网关'
    option domain-name-servers   192.168.197.2;	 '//修改DNS'
    option subnet-mask			255.255.255.0;
    range dynamic-bootp			192.168.197.100 192.168.197.200; 	'//修改地址池'
cobbler sync	'//帮助同步生成DHCP配置文件'
systemctl restart dhcpd.service 	'//启动dhcpd服务'
'//以下三条可以忽略不去处理'
1:SELinux is enabled. Please review the following wiki page for details on ensuring cobbler works correctly in your SELinux environment: https://github.com/cobbler/cobbler/wiki/Selinux
2 : debmirror package is not installed, it will be required to manage debian deployments and repositories
3 : fencing tools were not found, and are required to use the (optional) power
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值