cobbler 安装配置

cobbler 安装配置

操作系统:openEuler release 22.03

1、安装相关包并启动服务
yum install cobbler dhcp -y
systemctl enable --now cobblerd httpd tftp dhcpd
2、修改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 automatic installation 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: 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
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, 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

按照提示打开并修改:

vim /etc/cobbler/settings

将server:和next_server:后的ip改为自己的ip,如下图所示

在这里插入图片描述
在这里插入图片描述在这里插入图片描述

3、重新启动服务
systemctl restart cobblerd
4、实现DHCP服务

修改文件

vim /etc/cobbler/dhcp.template 

在这里插入图片描述

再运行下面的代码

cobbler sync
systemctl start dhcpd
5、下载启动的相关文件
cobbler get-loaders

至此cobbler配置完成

下面为老师提供的安装步骤,实际操作过程中到

yum install epel-release -y

时,提示

No match for argument: epel-release
Error: Unable to find a match: epel-release

有能力解决的朋友可以安装下面的步骤安装

1、关闭防护墙
setenforce 0
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
systemctl disable --now firewalld
2、安装依赖包及Cobbler3.2
yum install epel-release -y
yum module list | grep cobbler
dnf module enable cobbler:3 -y
yum install -y cobbler cobbler-web tftp-server dhcp httpd xinetd rsync rsync-daemon pykickstart vim grub2-*  syslinux*
3、开启相关服务
systemctl enable --now cobblerd httpd rsyncd tftp
4、配置Cobbler文件
sed -i.bak 's/^server: 127.0.0.1/server: 192.168.2.77/' /etc/cobbler/settings 
sed -i "s#next_server: 127.0.0.1#next_server: 192.168.2.77#" /etc/cobbler/settings
sed -i "s#manage_dhcp: 0#manage_dhcp: 1#" /etc/cobbler/settings
5、配置默认root密码
openssl passwd -1 -salt "7.1ddsr" 'root'
$1$7.1ddsr$GYDWEhNKjKYYvpUGfmx1P/
6、验证修改
egrep '^server:|^next_server|^manage_dhcp|^default_password_' /etc/cobbler/settings
7、配置DHCP服务(可选)
vim /etc/cobbler/dhcp.template
subnet 192.168.1.0 netmask 255.255.255.0 {  //修改此处网段
     option routers             192.168.1.2;  //修改此处网关
     option domain-name-servers 114.114.114.114;  //修改此处dns
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.2.1140 192.168.2.1140; //地址池 
default-lease-time 21600; max-lease-time 43200; next-server $next_server;
8、配置DNSMASQ服务摸版(如使用dnsmasq服务配置,替代默认dhcp)*
vim /etc/cobbler/dnsmasq.template
read-ethers
addn-hosts = /var/lib/cobbler/cobbler_hosts
cat /etc/cobbler/dnsmasq.template
read-ethers
addn-hosts = /var/lib/cobbler/cobbler_hosts

dhcp-range=192.168.2.210,192.168.2.240,1h
dhcp-option=option:router,192.168.2.1
dhcp-lease-max=1000
dhcp-authoritative

#BIOS
#dhcp-boot=pxelinux.0
#dhcp-boot=net:normalarch,pxelinux.0

#UEFI
#dhcp-boot=uefi/grubx64.efi
#dhcp-boot=net:x86_64,uefi/grubx64.efi

tftp-root=/var/lib/tftpboot
$insert_cobbler_system_definitions
9、启用dnsmasq
cat /etc/cobbler/modules.conf

[dhcp]
#module = managers.isc  # 注释默认
module = managers.dnsmasq # 启用dnsmasq
10、检查当前cobbler配置
#重启服务
systemctl restart cobblerd httpd rsyncd tftp
cobbler check

1: debmirror package is not installed, it will be required to manage debian deployments and repositories
2: fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
11、同步Cobbler配置
cobbler sync

shell triggers finished successfully
*** TASK COMPLETE ***   
  • 9
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值