当前位置: 首页 > news >正文

centos8安装cobbler3.2

系统环境 centos8 stream

官方最新文档:1. Quickstart — Cobbler 3.4.0 documentation

cobbler代码仓库:GitHub - cobbler/cobbler: Cobbler is a versatile Linux deployment server

ip地址

[root@localhost ~]# cat /etc/redhat-release 
CentOS Stream release 8
[root@localhost ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:46:cb:7b brd ff:ff:ff:ff:ff:ff
    altname enp3s0
    inet 10.66.8.111/16 brd 10.66.255.255 scope global noprefixroute ens160
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe46:cb7b/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

 安装

dnf install epel-release -y
dnf module enable cobbler:3 -y
dnf install cobbler -y

 cobbler配置

1.设置新系统默认密码

[root@localhost ~]# openssl passwd -1
Password: 
Verifying - Password: 
$1$NBSwa0Xy$VweeQYaNbeBlNNZyW5ztb/

修改配置文件 /etc/cobbler/settings.yaml 

default_password_crypted: "$1$NBSwa0Xy$VweeQYaNbeBlNNZyW5ztb/"

2.1配置server,该配置为cobbler服务器的ip

server: 10.66.8.111

 2.2配置next_server,该配置为dhcp/pxe作为下载网络引导文件的tftp服务器的ip,通常和cobbler服务器设置相同的ip

next_server: 10.66.8.111

 3.配置dhcp管理

manage_dhcp: true

 修改dhcp模板文件

vim /etc/cobbler/dhcp.template

修改内容如下

subnet 10.66.8.0 netmask 255.255.255.0 { 
     option routers             10.66.0.1;
     option domain-name-servers 10.66.0.1;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        10.66.8.220 10.66.8.254;
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                $next_server_v4;
}

4.启动cobbler服务

[root@localhost ~]# systemctl start cobblerd
[root@localhost ~]# systemctl status cobblerd
● cobblerd.service - Cobbler Helper Daemon
   Loaded: loaded (/usr/lib/systemd/system/cobblerd.service; disabled; vendor preset: disabled)
   Active: active (running) since Mon 2022-08-29 22:52:53 EDT; 3s ago
  Process: 2441 ExecStartPost=/usr/bin/touch /usr/share/cobbler/web/cobbler.wsgi (code=exited, status=1/FAILURE)
 Main PID: 2440 (cobblerd)
    Tasks: 1 (limit: 25313)
   Memory: 32.2M
   CGroup: /system.slice/cobblerd.service
           └─2440 /usr/bin/python3.6 -s /usr/bin/cobblerd -F

Aug 29 22:52:53 localhost.localdomain systemd[1]: Starting Cobbler Helper Daemon...
Aug 29 22:52:53 localhost.localdomain touch[2441]: /usr/bin/touch: cannot touch '/usr/share/cobbler/web/cobbler.wsgi': No such file or directory
Aug 29 22:52:53 localhost.localdomain systemd[1]: Started Cobbler Helper Daemon.

 5.检查问题,并且进行同步

[root@localhost ~]# cobbler check
The following are potential configuration items that you may want to fix:

1: dhcpd is not installed
2: some network boot-loaders are missing from /var/lib/cobbler/loaders. 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.
3: reposync is not installed, install yum-utils or dnf-plugins-core
4: yumdownloader is not installed, install yum-utils or dnf-plugins-core
5: debmirror package is not installed, it will be required to manage debian deployments and repositories
6: ksvalidator was not found, install pykickstart
7: 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: dhcpd is not installed
dnf install dhcp-server -y

#问题2
dnf install syslinux -y
cp /usr/share/syslinux/{pxelinux.0,menu.c32} /var/lib/cobbler/loaders/

# 问题3,4: reposync is not installed, install yum-utils or dnf-plugins-core
dnf install yum-utils -y

#问题5可以忽略

# 问题6,7: ksvalidator was not found, install pykickstart
dnf install pykickstart fence-agents -y

同步并再次测试

cobbler sync
cobbler check

 第一个已经配置过了,不知道为啥还提示,第二个可以忽略

[root@localhost ~]# cobbler check
The following are potential configuration items that you may want to fix:

1: some network boot-loaders are missing from /var/lib/cobbler/loaders. 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.
2: debmirror package is not installed, it will be required to manage debian deployments and repositories

Restart cobblerd and then run 'cobbler sync' to apply changes.

导入镜像

# root目录下有个centos7的镜像,挂载
mount -t iso9660 -o loop,ro /root/CentOS-7-x86_64-Minimal-2009.iso /mnt
[root@localhost ~]# cobbler import --name=centos7 --arch=x86_64 --path=/mnt
task started: 2022-08-29_230935_import
task started (id=Media import, time=Mon Aug 29 23:09:35 2022)
running python triggers from /var/lib/cobbler/triggers/task/import/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/import/pre/*
shell triggers finished successfully
Found a candidate signature: breed=redhat, version=rhel6
Found a candidate signature: breed=redhat, version=rhel7
Found a matching signature: breed=redhat, version=rhel7
Adding distros from path /var/www/cobbler/distro_mirror/centos7-x86_64:
creating new distro: centos7-x86_64
trying symlink: /var/www/cobbler/distro_mirror/centos7-x86_64 -> /var/www/cobbler/links/centos7-x86_64
creating new profile: centos7-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/distro_mirror/centos7-x86_64 for centos7-x86_64
processing repo at : /var/www/cobbler/distro_mirror/centos7-x86_64
need to process repo/comps: /var/www/cobbler/distro_mirror/centos7-x86_64
looking for /var/www/cobbler/distro_mirror/centos7-x86_64/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/distro_mirror/centos7-x86_64/repodata
*** TASK COMPLETE ***

测试安装系统

[root@localhost ~]# systemctl start tftp
[root@localhost ~]# systemctl status tftp
● tftp.service - Tftp Server
   Loaded: loaded (/usr/lib/systemd/system/tftp.service; indirect; vendor preset: disabled)
   Active: active (running) since Mon 2022-08-29 23:11:21 EDT; 9s ago
     Docs: man:in.tftpd
 Main PID: 5155 (in.tftpd)
    Tasks: 1 (limit: 25313)
   Memory: 204.0K
   CGroup: /system.slice/tftp.service
           └─5155 /usr/sbin/in.tftpd -s /var/lib/tftpboot

Aug 29 23:11:21 localhost.localdomain systemd[1]: Started Tftp Server.

重启客户机,看是否正常

sh /usr/share/cobbler/bin/mkgrub.sh

重启,重新进入引导,就可以发现菜单已经存在

 手动选择进行操作

 自动操作,根据mac地址,自动安装

cobbler system  add --name=c7test --profile=centos7-X86_64 --interface=eth0 --mac=00:50:56:34:62:CD --ip-address=10.66.8.234 --netmask=255.255.0.0 --static=1 --gateway=10.66.0.1

[root@localhost cobbler]# cobbler system  add --name=c7test --profile=centos7-X86_64 --interface=eth0 --mac=00:50:56:34:62:CD --ip-address=10.66.8.234 --netmask=255.255.0.0 --static=1 --gateway=10.66.0.1
[root@localhost cobbler]# cobbler system report --name=c7test
Name                           : c7test
Automatic Installation Template : <<inherit>>
Automatic Installation Template Metadata : {}
TFTP Boot Files                : {}
Boot loader                    : <<inherit>>
Comment                        : 
Enable gPXE?                   : <<inherit>>
Fetchable Files                : {}
DHCP Filename Override         : <<inherit>>
Gateway                        : 10.66.0.1
Hostname                       : 
Image                          : 
IPv6 Autoconfiguration         : False
IPv6 Default Device            : 
Kernel Options                 : {}
Kernel Options (Post Install)  : {}
Management Classes             : <<inherit>>
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Netboot Enabled                : True
Next Server Override           : <<inherit>>
Owners                         : <<inherit>>
Power Management Address       : 
Power Management ID            : 
Power Identity File            : 
Power Management Options       : 
Power Management Password      : 
Power Management Type          : ipmilan
Power Management Username      : 
Profile                        : centos7-X86_64
Internal Proxy                 : <<inherit>>
Redhat Management Key          : <<inherit>>
Repos Enabled                  : False
Serial Baud Rate               : 
Serial Device #                : 
Server Override                : <<inherit>>
Status                         : production
Template Files                 : {}
Virt Auto Boot                 : <<inherit>>
Virt CPUs                      : <<inherit>>
Virt Disk Driver Type          : <<inherit>>
Virt File Size(GB)             : <<inherit>>
Virt Path                      : <<inherit>>
Virt PXE Boot                  : 0
Virt RAM (MB)                  : <<inherit>>
Virt Type                      : <<inherit>>
Interface =====                : eth0
Bonding Opts                   : 
Bridge Opts                    : 
CNAMES                         : []
InfiniBand Connected Mode      : False
DHCP Tag                       : 
DNS Name                       : 
Per-Interface Gateway          : 
Master Interface               : 
Interface Type                 : na
IP Address                     : 10.66.8.234
IPv6 Address                   : 
IPv6 Default Gateway           : 
IPv6 MTU                       : 
IPv6 Prefix                    : 
IPv6 Secondaries               : []
IPv6 Static Routes             : []
MAC Address                    : 00:50:56:34:62:cd
Management Interface           : False
MTU                            : 
Subnet Mask                    : 255.255.0.0
Static                         : True
Static Routes                  : []
Virt Bridge                    : 

 ip正好是自己设定的信息

cobbler3.3测试安装成功,但是不知怎么回事,无法出现菜单

相关文章:

  • 网络编程-----socket函数
  • SpringBoot的自动装配进阶
  • 高通平台Android 蓝牙调配置手试和册-- OPP File Transmission Failure
  • STC15单片机内部RAM讲解
  • zemax---Ray Aberration(光线光扇图)
  • Polygon zkEVM Arithmetic状态机
  • 汽车毫米波雷达测试与测量解决方案
  • 网络编程--sockaddr 与 sockaddr_in
  • HashMap底层分析
  • 《工程伦理与学术道德》之《导论》
  • VGLUT 1抗体丨SYSY VGLUT 1抗体化学性质和文献参考
  • 598. 范围求和 II (脑筋急转弯)
  • 【云存储】大容量网盘的介绍与选择
  • openEuler-22.03系统安装openGauss3.0.0 企业版过程中遇到的坑
  • Vue组件、slot介绍
  • CSS相对定位
  • ES6语法详解(一)
  • FineReport中如何实现自动滚屏效果
  • Java 23种设计模式 之单例模式 7种实现方式
  • JavaScript类型识别
  • JavaScript设计模式系列一:工厂模式
  • Java深入 - 深入理解Java集合
  • js面向对象
  • Python_OOP
  • Redis中的lru算法实现
  • Spring Boot快速入门(一):Hello Spring Boot
  • 阿里中间件开源组件:Sentinel 0.2.0正式发布
  • 搞机器学习要哪些技能
  • 解析 Webpack中import、require、按需加载的执行过程
  • 看完九篇字体系列的文章,你还觉得我是在说字体?
  • 那些被忽略的 JavaScript 数组方法细节
  • 前端工程化(Gulp、Webpack)-webpack
  • 通过npm或yarn自动生成vue组件
  • 项目管理碎碎念系列之一:干系人管理
  • 原创:新手布局福音!微信小程序使用flex的一些基础样式属性(一)
  • Redis4.x新特性 -- 萌萌的MEMORY DOCTOR
  • ​​​​​​​sokit v1.3抓手机应用socket数据包: Socket是传输控制层协议,WebSocket是应用层协议。
  • ​【已解决】npm install​卡主不动的情况
  • # include “ “ 和 # include < >两者的区别
  • #pragma预处理命令
  • (附源码)ssm旅游企业财务管理系统 毕业设计 102100
  • (附源码)基于SpringBoot和Vue的厨到家服务平台的设计与实现 毕业设计 063133
  • (附源码)计算机毕业设计SSM在线影视购票系统
  • (剑指Offer)面试题41:和为s的连续正数序列
  • (论文阅读26/100)Weakly-supervised learning with convolutional neural networks
  • (三)elasticsearch 源码之启动流程分析
  • (三)Honghu Cloud云架构一定时调度平台
  • (学习日记)2024.04.04:UCOSIII第三十二节:计数信号量实验
  • (转)linux自定义开机启动服务和chkconfig使用方法
  • (转)创业家杂志:UCWEB天使第一步
  • (转载)VS2010/MFC编程入门之三十四(菜单:VS2010菜单资源详解)
  • .NET/C# 获取一个正在运行的进程的命令行参数
  • .NET/C# 在代码中测量代码执行耗时的建议(比较系统性能计数器和系统时间)
  • .net连接MySQL的方法
  • .NET中GET与SET的用法