在大批量安装Linux服务器系统时,如果手动安装,则需要花费大量的时间,而使用PXE安装时,会相对轻松很多。
Cobbler是一个将PXE整套流程合在一起的工具,可以帮我们快速的搭建好PXE安装所需的各种工具,并且在配置中也更方便。
本文将介绍如何部署Cobbler环境,并且安装CentOS7、Ubuntu18作为测试。
文章结构
安装并配置Cobbler
安装Ubuntu18、CentOS7测试
常用的操作及报错处理
部署前的准备
一台CentOS8的系统,作为cobbler服务端
待安装的测试机
建议使用VMWare的虚机,启动比较快,测试方便
详细步骤
Cobbler安装与配置
在准备好的CentOS8中,按如下步骤操作:
系统的相关优化配置
– 关闭selinux
vim /etc/selinux/config
SELINUX=disabled
调整后重启一下系统
– 关闭firewalld
systemctl stop firewalld && systemctl disable firewalld
安装Cobbler及相关的软件包
dnf install epel-release -y && dnf module enable cobbler -y && dnf install cobbler tftp dhcp-server cobbler-web yum-utils pykickstart debmirror fence-agents vim wget -y
生成一个加密密码,安装后的系统会将其作为root密码使用
# 按照提示输入两次想要设置的密码,并将生成的加密密码保存好
# 以下命令生成的加密密码的明文是 “password”
openssl passwd -1
Password:
Verifying – Password:
$1$rLza5zNH$xLKFqWoK32/IA/zslG3Up0
修改cobbler的主配置文件 /etc/cobbler/setting
# 将 server 和 next_server 修改为本机的IP地址
server: 10.1.1.1
next_server: 10.1.1.1
manage_tftpd: 1
manage_dhcp: 1
# 这里填写上一步生成的加密密码
default_password_crypted: $1$rLza5zNH$xLKFqWoK32/IA/zslG3Up0
修改DHCP的配置模板 /etc/cobbler/dhcp.template
dhcp的模板内容较多,仅修改下面设置中的部分内容即可
# 仅修改以下部分配置即可,根据自己的测试环境修改 网关与待分配的IP
subnet 10.1.1.0 netmask 255.255.255.0 {
option routers 10.1.1.254;
option domain-name-servers 223.5.5.5;
option subnet-mask 255.255.255.0;
range dynamic-bootp 10.1.1.100 10.1.1.200;
filename "/pxelinux.0";
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
编辑 /etc/cobbler/tftpd.template
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = $user
server = $binary
server_args = -B 1380 -v -s $args
per_source = 11
cps = 100 2
flags = IPv4
}
开启相关的服务
systemctl restart cobblerd tftp dhcp && systemctl enable cobblerd tftp dhcpd
执行命令 cobbler get-loaders下载相关的loader组件
执行 cobbler check检查配置,并解决出现的问题
谈谈 Cobbler 3.x 部署实战
在大批量安装Linux服务器系统时,如果手动安装,则需要花费大量的时间,而使用PXE安装时,会相对轻松很多。 Cobbler是一个将PXE整套流程合在一起的工具,可以帮我们快速的搭建好PXE安装所需的各种工具,并且在配置中也更方便。 本文将介绍如何部署Cobbler环
本文来自网络,不代表站长网立场,转载请注明出处:https://www.tzzz.com.cn/html/server/linux/2021/1214/38153.html