cobbler批量装机工具,可以实现同时装多台或多台不同系统的主机,也可以实现定制安装

cobbler批量装机工具

文章目录

  • cobbler批量装机工具
    • 1. cobbler简介
    • 2. cobbler服务端部署uos
    • 3. 客户端安装(内存和cpu可以多个点,以免后面出错)
    • 4.cobbler服务端部署centos7
    • 5.客户端安装
    • 6.cobbler服务端部署centos8
    • 7.客户端安装
    • 8.cobbler服务端部署rockylinux9
    • 9.客户端安装
    • 10.定制安装

1. cobbler简介

Cobbler是一个Linux服务器安装的服务,可以通过网络启动(PXE)的方式来快速安装、重装物理服务器和虚拟机,同时还可以管理DHCPDNS等。

Cobbler可以使用命令行方式管理,也提供了基于Web的界面管理工具(cobbler-web),还提供了API接口,可以方便二次开发使用。

Cobbler是较早前的kickstart的升级版,优点是比较容易配置,还自带web界面比较易于管理。

Cobbler内置了一个轻量级配置管理系统,但它也支持和其它配置管理系统集成,如Puppet,暂时不支持SaltStack。

Cobbler官网

cobbler集成的服务

  • PXE服务支持
  • DHCP服务管理
  • DNS服务管理(可选bind,dnsmasq)
  • 电源管理
  • Kickstart服务支持
  • YUM仓库管理
  • TFTP(PXE启动时需要)
  • Apache(提供kickstart的安装源,并提供定制化的kickstart配置)

cobbler配置文件详解
cobbler配置文件目录在/etc/cobbler

配置文件作用
/etc/cobbler/settingscobbler 主配置文件
/etc/cobbler/iso/iso模板配置文件
/etc/cobbler/pxepxe模板配置文件
/etc/cobbler/power电源配置文件
/etc/cobbler/user.confweb服务授权配置文件
/etc/cobbler/users.digestweb访问的用户名密码配置文件
/etc/cobbler/dhcp.templatedhcp服务器的的配置模板
/etc/cobbler/dnsmasq.templatedns服务器的配置模板
/etc/cobbler/tftpd.templatetftp服务的配置模板
/etc/cobbler/modules.conf模块的配置文件

cobbler数据目录

目录作用
/var/lib/cobbler/config/用于存放distros,system,profiles等信息配置文件
/var/lib/cobbler/triggers/用于存放用户定义的cobbler命令
/var/lib/cobbler/kickstart/默认存放kickstart文件
/var/lib/cobbler/loaders/存放各种引导程序以及镜像目录
/var/www/cobbler/ks_mirror/导入的发行版系统的所有数据
/var/www/cobbler/images/导入发行版的kernel和initrd镜像用于远程网络启动
/var/www/cobbler/repo_mirror/yum仓库存储目录

cobbler日志文件

日志文件路径说明
/var/log/cobbler/installing客户端安装日志
/var/log/cobbler/cobbler.logcobbler日志

cobbler命令详解

cobbler check       //核对当前设置是否有问题
cobbler list        //列出所有的cobbler元素
cobbler report      //列出元素的详细信息
cobbler sync        //同步配置到数据目录,更改配置最好都要执行下
cobbler reposync    //同步yum仓库
cobbler distro      //查看导入的发行版系统信息
cobbler system      //查看添加的系统信息
cobbler profile     //查看配置信息

2. cobbler服务端部署uos

服务端主机空间要求

在这里插入图片描述

1.关闭防火墙
[root@cobbler ~]# systemctl disable --now firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@cobbler ~]# getenforce
Disabled2.安装cobbler以及相关的软件
[root@cobbler ~]# yum -y install httpd dhcp tftp python-ctypes cobbler  xinetd cobbler-web pykickstart
UnionTechOS 20 AppStream                                                                         1.3 MB/s | 8.1 MB     00:05    
UnionTechOS 20 BaseOS                                                                            2.0 MB/s | 1.8 MB     00:00    
UnionTechOS 20 PowerTools                                                                        2.6 MB/s | 2.8 MB     00:01    
UnionTechOS 20 Plus                                                                              8.0 MB/s |  10 MB     00:01    
UnionTechOS 20 Extras                                                                            9.1 kB/s | 2.3 kB     00:00    
UnionTechOS 20 Update                                                                            1.0 kB/s | 257  B     00:00    
UnionTechOS 20 GM                                                                                3.4 MB/s | 1.4 MB     00:00    
未找到匹配的参数: dhcp
未找到匹配的参数: python-ctypes
错误:没有任何匹配: dhcp python-ctypes//解决方案
[root@cobbler ~]# yum list all | grep python|grep ctypes
[root@cobbler ~]# yum -y install httpd dhcp* tftp  cobbler  xinetd cobbler-web pykickstart syslinux
完毕!3.启动服务并设置开机自启
[root@cobbler ~]# systemctl enable --now httpd cobblerd
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
Created symlink /etc/systemd/system/multi-user.target.wants/cobblerd.service → /usr/lib/systemd/system/cobblerd.service.4.修改server的ip地址为本机ip
[root@cobbler ~]# vim /etc/cobbler/settings
server: 192.168.116.146      //改为自己本机的ip5.设置tftp的ip地址为本机ip
[root@cobbler ~]# vim /etc/cobbler/settings
next_server: 192.168.116.146   //改为自己本机的ip6.开启tftp
[root@cobbler ~]# systemctl enable --now tftp
Created symlink /etc/systemd/system/sockets.target.wants/tftp.socket → /usr/lib/systemd/system/tftp.socket.
[root@cobbler ~]# systemctl status tftp
● tftp.service - Tftp ServerLoaded: loaded (/usr/lib/systemd/system/tftp.service; indirect; vendor preset: disabled)Active: active (running) since Mon 2023-12-25 14:06:00 CST; 10s agoDocs: man:in.tftpdMain PID: 69394 (in.tftpd)Tasks: 1Memory: 108.0KCGroup: /system.slice/tftp.service└─69394 /usr/sbin/in.tftpd -s /var/lib/tftpboot1225 14:06:00 cobbler systemd[1]: Started Tftp Server.7.下载缺失文件
[root@cobbler ~]# cobbler get-loaders
task started: 2023-12-25_140649_get_loaders
task started (id=Download Bootloader Content, time=Mon Dec 25 14:06:49 2023)
running python triggers from /var/lib/cobbler/triggers/task/get_loaders/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/get_loaders/pre/*
shell triggers finished successfully
downloading https://cobbler.github.io/loaders/README to /var/lib/cobbler/loaders/README
downloading https://cobbler.github.io/loaders/COPYING.yaboot to /var/lib/cobbler/loaders/COPYING.yaboot
downloading https://cobbler.github.io/loaders/COPYING.syslinux to /var/lib/cobbler/loaders/COPYING.syslinux
downloading https://cobbler.github.io/loaders/yaboot-1.3.17 to /var/lib/cobbler/loaders/yaboot
downloading https://cobbler.github.io/loaders/pxelinux.0-3.86 to /var/lib/cobbler/loaders/pxelinux.0
downloading https://cobbler.github.io/loaders/menu.c32-3.86 to /var/lib/cobbler/loaders/menu.c32
downloading https://cobbler.github.io/loaders/grub-0.97-x86.efi to /var/lib/cobbler/loaders/grub-x86.efi
downloading https://cobbler.github.io/loaders/grub-0.97-x86_64.efi to /var/lib/cobbler/loaders/grub-x86_64.efi
*** TASK COMPLETE ***8.启动rsync并设置开机自启
[root@cobbler ~]# rpm -qa | grep rsync
rsync-3.1.3-19.uelc20.x86_64
[root@cobbler ~]# yum -y install rsync-daemon
完毕!
[root@cobbler ~]# systemctl enable --now rsyncd
Created symlink /etc/systemd/system/multi-user.target.wants/rsyncd.service → /usr/lib/systemd/system/rsyncd.service.
[root@cobbler ~]# systemctl status rsyncd
● rsyncd.service - fast remote file copy program daemonLoaded: loaded (/usr/lib/systemd/system/rsyncd.service; enabled; vendor preset: disabled)Active: active (running) since Mon 2023-12-25 14:09:05 CST; 6s agoMain PID: 93475 (rsync)Tasks: 1Memory: 188.0KCGroup: /system.slice/rsyncd.service└─93475 /usr/bin/rsync --daemon --no-detach1225 14:09:05 cobbler systemd[1]: Started fast remote file copy program daemon.
1225 14:09:05 cobbler rsyncd[93475]: rsyncd version 3.1.3 starting, listening on port 8739.生成加密的密码
[root@cobbler ~]# openssl passwd -1 -salt "$RANDOM" 'Passw0rd@_~'
$1$24272$8uLVuFlMwimkhkygX30rN0      //这是密码加密后的形式10.将新生成的加密密码加入到配置文件
[root@cobbler ~]# vim /etc/cobbler/settings
default_password_crypted: "$1$24272$8uLVuFlMwimkhkygX30rN0"    //改为刚刚生成的随机加密的密码11.重启cobbler
[root@cobbler ~]# systemctl restart cobblerd
[root@cobbler ~]# ss -antl
State          Recv-Q         Send-Q                 Local Address:Port                  Peer Address:Port        Process        
LISTEN         0              128                          0.0.0.0:22                         0.0.0.0:*                          
LISTEN         0              5                          127.0.0.1:631                        0.0.0.0:*                          
LISTEN         0              5                          127.0.0.1:25151                      0.0.0.0:*                          
LISTEN         0              5                            0.0.0.0:873                        0.0.0.0:*                          
LISTEN         0              511                                *:80                               *:*                          
LISTEN         0              128                             [::]:22                            [::]:*                          
LISTEN         0              5                              [::1]:631                           [::]:*                          
LISTEN         0              511                                *:443                              *:*                          
LISTEN         0              5                               [::]:873                           [::]:*                          
12.通过cobbler check 核对当前设置是否有问题
[root@cobbler ~]# cobbler check
The following are potential configuration items that you may want to fix:1: reposync is not installed, install yum-utils or dnf-plugins-core
2: yumdownloader is not installed, install yum-utils or dnf-plugins-core
3: debmirror package is not installed, it will be required to manage debian deployments and repositories
4: fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use themRestart cobblerd and then run 'cobbler sync' to apply changes.//解决方案
[root@cobbler ~]# yum -y install yum-utils
完毕![root@cobbler ~]# cobbler check         //这两个可以不用管,这两个问题是其他系统的
The following are potential configuration items that you may want to fix: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 themRestart cobblerd and then run 'cobbler sync' to apply changes.13.配置cobbler dhcp
//修改cobbler配置文件,让cobbler控制dhcp
[root@cobbler ~]# vim /etc/cobbler/settings
manage_dhcp: 114.配置dhcp
[root@cobbler ~]# vim /etc/cobbler/dhcp.template
subnet 192.168.116.0 netmask 255.255.255.0 {               //改为自己虚拟机的网段option routers             192.168.116.146;           //改为自己虚拟机的ipoption domain-name-servers 192.168.116.2;             //自己虚拟机的网关option subnet-mask         255.255.255.0;range dynamic-bootp        192.168.116.100 192.168.116.200;default-lease-time         21600;max-lease-time             43200;next-server                $next_server;15.重启服务并同步配置,改完dhcp必须要sync同步配置
[root@cobbler ~]# systemctl restart cobblerd
[root@cobbler ~]# cobbler sync
task started: 2023-12-25_142054_sync
task started (id=Sync, time=Mon Dec 25 14:20:54 2023)
running python triggers from /var/lib/cobbler/triggers/task/sync/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/sync/pre/*
shell triggers finished successfully
running pre-sync triggers
cleaning trees
removing: /var/lib/tftpboot/grub/system
removing: /var/lib/tftpboot/grub/system_link
removing: /var/lib/tftpboot/grub/images
copying bootloaders
running: ['rsync', '-rpt', '--copy-links', '--exclude=.cobbler_postun_cleanup', '/var/lib/cobbler/loaders/', '/var/lib/tftpboot']
received on stdout: 
received on stderr: 
running: ['rsync', '-rpt', '--copy-links', '--exclude=README.grubconfig', '/var/lib/cobbler/grub_config/', '/var/lib/tftpboot']
received on stdout: 
received on stderr: 
copying distros to tftpboot
copying images
generating PXE configuration files
generating PXE menu structure
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
cleaning link caches
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running: dhcpd -t -q
received on stdout: 
received on stderr: 
running: service dhcpd restart
received on stdout: 
received on stderr: Redirecting to /bin/systemctl restart dhcpd.servicerunning shell triggers from /var/lib/cobbler/triggers/sync/post/*
shell triggers finished successfully
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.scm_track
running python trigger cobbler.modules.managers.genders
running shell triggers from /var/lib/cobbler/triggers/change/*
shell triggers finished successfully
*** TASK COMPLETE ***16.检查dhcp是否正常
[root@cobbler ~]# ss -anulp|grep dhcp
UNCONN 0      0            0.0.0.0:59154      0.0.0.0:*    users:(("dhcpd",pid=144794,fd=20))    
UNCONN 0      0            0.0.0.0:67         0.0.0.0:*    users:(("dhcpd",pid=144794,fd=10))    
UNCONN 0      0               [::]:40968         [::]:*    users:(("dhcpd",pid=144794,fd=21))    17.导入uos镜像
[root@cobbler ~]# mount /dev/cdrom /mnt
mount: /mnt: WARNING: source write-protected, mounted read-only.
[root@cobbler ~]# ls /mnt
AppStream  BaseOS  EFI  extra_files.json  images  isolinux  kernel419  kernel510  media.repo  RPM-GPG-KEY-uos-release  TRANS.TBL
[root@cobbler ~]# cobbler import --path=/mnt --name=uos20 --arch=x86_64
task started: 2023-12-25_142438_import
task started (id=Media import, time=Mon Dec 25 14:24:38 2023)
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=uniontech, version=uniontech
Found a matching signature: breed=uniontech, version=uniontech
Adding distros from path /var/www/cobbler/distro_mirror/uos20-x86_64:
creating new distro: uos20-x86_64
trying symlink: /var/www/cobbler/distro_mirror/uos20-x86_64 -> /var/www/cobbler/links/uos20-x86_64
creating new profile: uos20-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/uos20-x86_64 for uos20-x86_64
processing repo at : /var/www/cobbler/distro_mirror/uos20-x86_64/AppStream
need to process repo/comps: /var/www/cobbler/distro_mirror/uos20-x86_64/AppStream
looking for /var/www/cobbler/distro_mirror/uos20-x86_64/AppStream/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/distro_mirror/uos20-x86_64/AppStream/repodata
processing repo at : /var/www/cobbler/distro_mirror/uos20-x86_64/BaseOS
need to process repo/comps: /var/www/cobbler/distro_mirror/uos20-x86_64/BaseOS
looking for /var/www/cobbler/distro_mirror/uos20-x86_64/BaseOS/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/distro_mirror/uos20-x86_64/BaseOS/repodata
processing repo at : /var/www/cobbler/distro_mirror/uos20-x86_64/kernel419
directory /var/www/cobbler/distro_mirror/uos20-x86_64/kernel419 is missing xml comps file, skipping
processing repo at : /var/www/cobbler/distro_mirror/uos20-x86_64/kernel510
directory /var/www/cobbler/distro_mirror/uos20-x86_64/kernel510 is missing xml comps file, skipping
*** TASK COMPLETE ***//说明:--path      //镜像路径--name      //为安装源定义一个名字--arch      //指定安装源平台//安装源的唯一标示就是根据name参数来定义,本例导入成功后,安装源的唯一标示就是:uos20-x86_64,如果重复,系统会提示导入失败18.查看cobbler镜像列表
[root@cobbler ~]# cobbler list
distros:uos20-x86_64profiles:uos20-x86_64systems:repos:images:mgmtclasses:packages:files:19.进入/var/lib/cobbler/templates目录创建一个以.ks结尾的文件生成自动安装脚本
[root@cobbler ~]# cd /var/lib/cobbler/
[root@cobbler cobbler]# ls
collections  distro_signatures.json  grub_config  loaders  lock  scripts  snippets  templates  triggers  web.ss  webui_sessions
[root@cobbler cobbler]# cd templates/
[root@cobbler templates]# ls
default.ks    install_profiles  pxerescue.ks         sample_esxi5.ks  sample_legacy.ks
esxi4-ks.cfg  legacy.ks         sample_autoyast.xml  sample_esxi6.ks  sample_old.seed
esxi5-ks.cfg  powerkvm.ks       sample_esxi4.ks      sample.ks        sample.seed
[root@cobbler templates]# pwd
/var/lib/cobbler/templates
[root@cobbler templates]# vim uos20.ks
[root@cobbler templates]# cat uos20.ks
auth --enableshadow --passalgo=sha512
bootloader --location=mbr
clearpart --all --initlabel
part /boot --asprimary --fstype="ext4" --size=500
part swap --fstype="swap" --size=4096
part / --fstype="ext4" --grow --size=15000
text
firewall --disabled
firstboot --disable
keyboard us
lang en_US
url --url=http://192.168.116.146/cobbler/links/uos20-x86_64/       //这个到网页上面访问:ip/cobbler
$yum_repo_stanza
rebootrootpw --iscrypted $6$WqdLuLnm2W8M98bv$XKfgxxCeviKNg4y/pj6bT2/b/WIT.91YyWcb3930BgVUiuHXuFtqQXLP3isSdfz2mZpSQCDqO.Ude3uL9pz370                            //这个位置可以复制自己虚拟机的/root/anaconda-ks.cfg中的selinux --disabled
skipx
timezone Asia/Shanghai --isUtc --nontp
install
zerombr%packages
@^minimal
@core
kexec-tools%end%addon com_redhat_kdump --enable --reserve-mb='auto'%end%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end20.检查ks文件语法是否有误
[root@cobbler ~]# cobbler --help
usage
=====
cobbler <distro|profile|system|repo|image|mgmtclass|package|file> ... [add|edit|copy|get-autoinstall*|list|remove|rename|report] [options|--help]
cobbler <aclsetup|buildiso|import|list|replicate|report|reposync|sync|validate-autoinstalls|version|signature|get-loaders|hardlink> [options|--help]
[root@cobbler ~]# cobbler validate-autoinstalls
task started: 2023-12-25_143648_validate_autoinstall_files
task started (id=Automated installation files validation, time=Mon Dec 25 14:36:48 2023)
running python triggers from /var/lib/cobbler/triggers/task/validate_autoinstall_files/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/validate_autoinstall_files/pre/*
shell triggers finished successfully
*** TASK COMPLETE ***21.查看当前cobbler有哪些配置文件
[root@cobbler ~]# cobbler profile listuos20-x86_6422.修改profile,将我们新建的ks文件设为默认的autoinstall安装文件
[root@cobbler ~]# cobbler profile edit --help--autoinstall=AUTOINSTALLAutomatic Installation Template (Path to automaticinstallation template)
[root@cobbler ~]# cobbler profile edit --name uos20-x86_64 --autoinstall=uos20.ks23.配置网卡名称为传统网卡名称eth0
[root@cobbler ~]# cobbler profile edit --help
--kernel-options=KERNEL_OPTIONSKernel Options (Ex: selinux=permissive)
[root@cobbler ~]# cobbler profile edit --name uos20-x86_64 --kernel-options='net.ifnames=0 biosdevname=0'24.检查当前系统cobbler配置文件信息
[root@cobbler ~]# cobbler profile report
Name                           : uos20-x86_64
Automatic Installation Template : uos20.ks
Automatic Installation Metadata : {}
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : uos20-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
DHCP Filename Override         : <<inherit>>
Kernel Options                 : {'net.ifnames': '0', 'biosdevname': '0'}
Kernel Options (Post Install)  : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Next Server Override           : <<inherit>>
Owners                         : ['admin']
Parent Profile                 : 
Proxy                          : 
Red Hat Management Key         : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvm25.同步cobbler
[root@cobbler ~]# cobbler sync
task started: 2023-12-25_144402_sync
task started (id=Sync, time=Mon Dec 25 14:44:02 2023)
running python triggers from /var/lib/cobbler/triggers/task/sync/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/sync/pre/*
shell triggers finished successfully
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/images/uos20-x86_64
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/system
removing: /var/lib/tftpboot/grub/system_link
removing: /var/lib/tftpboot/grub/grub.cfg
removing: /var/lib/tftpboot/grub/local_efi.cfg
removing: /var/lib/tftpboot/grub/local_legacy.cfg
removing: /var/lib/tftpboot/grub/local_powerpc-ieee1275.cfg
removing: /var/lib/tftpboot/grub/aarch64_menu_items.cfg
removing: /var/lib/tftpboot/grub/i386_menu_items.cfg
removing: /var/lib/tftpboot/grub/x86_64_menu_items.cfg
removing: /var/lib/tftpboot/grub/ppc_menu_items.cfg
removing: /var/lib/tftpboot/grub/ppc64_menu_items.cfg
removing: /var/lib/tftpboot/grub/ppc64le_menu_items.cfg
removing: /var/lib/tftpboot/grub/loongarch64_menu_items.cfg
removing: /var/lib/tftpboot/grub/amd64_menu_items.cfg
removing: /var/lib/tftpboot/grub/ppc64el_menu_items.cfg
removing: /var/lib/tftpboot/grub/ia64_menu_items.cfg
removing: /var/lib/tftpboot/grub/s390_menu_items.cfg
removing: /var/lib/tftpboot/grub/s390x_menu_items.cfg
removing: /var/lib/tftpboot/grub/i586_menu_items.cfg
removing: /var/lib/tftpboot/images/uos20-x86_64
copying bootloaders
running: ['rsync', '-rpt', '--copy-links', '--exclude=.cobbler_postun_cleanup', '/var/lib/cobbler/loaders/', '/var/lib/tftpboot']
received on stdout: 
received on stderr: 
running: ['rsync', '-rpt', '--copy-links', '--exclude=README.grubconfig', '/var/lib/cobbler/grub_config/', '/var/lib/tftpboot']
received on stdout: 
received on stderr: 
copying distros to tftpboot
copying files for distro: uos20-x86_64
trying hardlink /var/www/cobbler/distro_mirror/uos20-x86_64/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/uos20-x86_64/vmlinuz
trying hardlink /var/www/cobbler/distro_mirror/uos20-x86_64/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/uos20-x86_64/initrd.img
copying images
generating PXE configuration files
generating PXE menu structure
copying files for distro: uos20-x86_64
trying hardlink /var/www/cobbler/distro_mirror/uos20-x86_64/images/pxeboot/vmlinuz -> /var/www/cobbler/images/uos20-x86_64/vmlinuz
trying hardlink /var/www/cobbler/distro_mirror/uos20-x86_64/images/pxeboot/initrd.img -> /var/www/cobbler/images/uos20-x86_64/initrd.img
Writing template files for uos20-x86_64
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
processing boot_files for distro: uos20-x86_64
cleaning link caches
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running: dhcpd -t -q
received on stdout: 
received on stderr: 
running: service dhcpd restart
received on stdout: 
received on stderr: Redirecting to /bin/systemctl restart dhcpd.servicerunning shell triggers from /var/lib/cobbler/triggers/sync/post/*
shell triggers finished successfully
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.scm_track
running python trigger cobbler.modules.managers.genders
running shell triggers from /var/lib/cobbler/triggers/change/*
shell triggers finished successfully
*** TASK COMPLETE ***26.为避免发生未知问题,先把服务端所有服务重启
[root@cobbler ~]# systemctl restart httpd cobblerd
[root@cobbler ~]# systemctl status xinetd
● xinetd.service - Xinetd A Powerful Replacement For InetdLoaded: loaded (/usr/lib/systemd/system/xinetd.service; enabled; vendor preset: enabled)Active: inactive (dead)Docs: man:xinetdman:xinetd.confman:xinetd.log
[root@cobbler ~]# systemctl enable --now xinetd
[root@cobbler ~]# systemctl status xinetd
● xinetd.service - Xinetd A Powerful Replacement For InetdLoaded: loaded (/usr/lib/systemd/system/xinetd.service; enabled; vendor preset: enabled)Active: active (running) since Mon 2023-12-25 14:46:11 CST; 2s agoDocs: man:xinetdman:xinetd.confman:xinetd.logProcess: 274806 ExecStart=/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid (code=exited, status=0/SUCCESS)Main PID: 274807 (xinetd)Tasks: 1Memory: 828.0KCGroup: /system.slice/xinetd.service└─274807 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
[root@cobbler ~]# ss -antl
State          Recv-Q         Send-Q                 Local Address:Port                  Peer Address:Port        Process        
LISTEN         0              128                          0.0.0.0:22                         0.0.0.0:*                          
LISTEN         0              5                          127.0.0.1:631                        0.0.0.0:*                          
LISTEN         0              5                          127.0.0.1:25151                      0.0.0.0:*                          
LISTEN         0              5                            0.0.0.0:873                        0.0.0.0:*                          
LISTEN         0              511                                *:80                               *:*                          
LISTEN         0              128                             [::]:22                            [::]:*                          
LISTEN         0              5                              [::1]:631                           [::]:*                          
LISTEN         0              511                                *:443                              *:*                          
LISTEN         0              5                               [::]:873                           [::]:*                          

3. 客户端安装(内存和cpu可以多个点,以免后面出错)

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

//解决方案
[root@cobbler ~]# cd /var/lib/tftpboot/
[root@cobbler tftpboot]# ls
boot              COPYING.yaboot  grub      grub-x86_64.efi  images   menu.c32  pxelinux.0    README  yaboot
COPYING.syslinux  etc             grub.cfg  grub-x86.efi     images2  ppc       pxelinux.cfg  s390x[root@cobbler ~]# vim /etc/cobbler/dhcp.template 
subnet 192.168.116.0 netmask 255.255.255.0 {option routers             192.168.116.146;option domain-name-servers 192.168.116.2;option subnet-mask         255.255.255.0;range dynamic-bootp        192.168.116.100 192.168.116.200;default-lease-time         21600;max-lease-time             43200;next-server                $next_server;class "pxeclients" {                //这里的其余的行可以删除吧filename这一行中的grup.0改为pxelinux.0match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";filename "pxelinux.0";}
}

在这里插入图片描述

//解决方案,不用同步
[root@cobbler ~]# cd /var/lib/tftpboot/
[root@cobbler tftpboot]# ls
boot              COPYING.yaboot  grub      grub-x86_64.efi  images   menu.c32  pxelinux.0    README  yaboot
COPYING.syslinux  etc             grub.cfg  grub-x86.efi     images2  ppc       pxelinux.cfg  s390x
[root@cobbler tftpboot]# mv menu.c32  pxelinux.0 /opt
[root@cobbler tftpboot]# ls /usr/share/syslinux
altmbr.bin    cpuidtest.c32  gfxboot.c32   ifplop.c32          ldlinux.c32   mboot.c32     prdhcp.c32      syslinux.com
altmbr_c.bin  debug.c32      gptmbr.bin    isohdpfx.bin        lfs.c32       mbr.bin       pwd.c32         syslinux.exe
altmbr_f.bin  dhcp.c32       gptmbr_c.bin  isohdpfx_c.bin      libcom32.c32  mbr_c.bin     pxechn.c32      vesa.c32
cat.c32       diag           gptmbr_f.bin  isohdpfx_f.bin      libgpl.c32    mbr_f.bin     pxelinux.0      vesainfo.c32
chain.c32     dir.c32        gpxecmd.c32   isohdppx.bin        liblua.c32    memdisk       reboot.c32      vesamenu.c32
cmd.c32       disk.c32       hdt.c32       isohdppx_c.bin      libmenu.c32   meminfo.c32   rosh.c32        vpdtest.c32
cmenu.c32     dmi.c32        hexdump.c32   isohdppx_f.bin      libutil.c32   menu.c32      sanboot.c32     whichsys.c32
config.c32    dmitest.c32    host.c32      isolinux.bin        linux.c32     pci.c32       sdi.c32         zzjson.c32
cptime.c32    dosutil        ifcpu64.c32   isolinux-debug.bin  lpxelinux.0   pcitest.c32   sysdump.c32
cpu.c32       elf.c32        ifcpu.c32     kbdmap.c32          ls.c32        pmload.c32    syslinux64.exe
cpuid.c32     ethersel.c32   ifmemdsk.c32  kontron_wdt.c32     lua.c32       poweroff.c32  syslinux.c32
[root@cobbler tftpboot]# cp /usr/share/syslinux/menu.c32 .
[root@cobbler tftpboot]# cp /usr/share/syslinux/pxelinux.0 .
[root@cobbler tftpboot]# ls
boot              COPYING.yaboot  grub      grub-x86_64.efi  images   menu.c32  pxelinux.0    README  yaboot
COPYING.syslinux  etc             grub.cfg  grub-x86.efi     images2  ppc       pxelinux.cfg  s390x
[root@cobbler tftpboot]# ll /usr/share/syslinux/menu.c32 /opt/menu.c32 
-rw-r--r-- 1 root root  9379 1225 14:07 /opt/menu.c32
-rw-r--r-- 1 root root 26276  315  2023 /usr/share/syslinux/menu.c32
[root@cobbler tftpboot]# ll /usr/share/syslinux/pxelinux.0 /opt/pxelinux.0 
-rw-r--r-- 1 root root  9379 1225 14:07 /opt/pxelinux.0
-rw-r--r-- 1 root root 42373  315  2023 /usr/share/syslinux/pxelinux.0

在这里插入图片描述

//解决方案
[root@cobbler tftpboot]# ls /usr/share/syslinux
altmbr.bin    cpuidtest.c32  gfxboot.c32   ifplop.c32          ldlinux.c32   mboot.c32     prdhcp.c32      syslinux.com
altmbr_c.bin  debug.c32      gptmbr.bin    isohdpfx.bin        lfs.c32       mbr.bin       pwd.c32         syslinux.exe
altmbr_f.bin  dhcp.c32       gptmbr_c.bin  isohdpfx_c.bin      libcom32.c32  mbr_c.bin     pxechn.c32      vesa.c32
cat.c32       diag           gptmbr_f.bin  isohdpfx_f.bin      libgpl.c32    mbr_f.bin     pxelinux.0      vesainfo.c32
chain.c32     dir.c32        gpxecmd.c32   isohdppx.bin        liblua.c32    memdisk       reboot.c32      vesamenu.c32
cmd.c32       disk.c32       hdt.c32       isohdppx_c.bin      libmenu.c32   meminfo.c32   rosh.c32        vpdtest.c32
cmenu.c32     dmi.c32        hexdump.c32   isohdppx_f.bin      libutil.c32   menu.c32      sanboot.c32     whichsys.c32
config.c32    dmitest.c32    host.c32      isolinux.bin        linux.c32     pci.c32       sdi.c32         zzjson.c32
cptime.c32    dosutil        ifcpu64.c32   isolinux-debug.bin  lpxelinux.0   pcitest.c32   sysdump.c32
cpu.c32       elf.c32        ifcpu.c32     kbdmap.c32          ls.c32        pmload.c32    syslinux64.exe
cpuid.c32     ethersel.c32   ifmemdsk.c32  kontron_wdt.c32     lua.c32       poweroff.c32  syslinux.c32
[root@cobbler tftpboot]# cp /usr/share/syslinux/ldlinux.c32 .
[root@cobbler tftpboot]# pwd
/var/lib/tftpboot
[root@cobbler tftpboot]# ls
boot              COPYING.yaboot  grub      grub-x86_64.efi  images   ldlinux.c32  ppc         pxelinux.cfg  s390x
COPYING.syslinux  etc             grub.cfg  grub-x86.efi     images2  menu.c32     pxelinux.0  README        yaboot

在这里插入图片描述

//解决方案
[root@cobbler tftpboot]# pwd
/var/lib/tftpboot
[root@cobbler tftpboot]# ls /usr/share/syslinux
altmbr.bin    cpuidtest.c32  gfxboot.c32   ifplop.c32          ldlinux.c32   mboot.c32     prdhcp.c32      syslinux.com
altmbr_c.bin  debug.c32      gptmbr.bin    isohdpfx.bin        lfs.c32       mbr.bin       pwd.c32         syslinux.exe
altmbr_f.bin  dhcp.c32       gptmbr_c.bin  isohdpfx_c.bin      libcom32.c32  mbr_c.bin     pxechn.c32      vesa.c32
cat.c32       diag           gptmbr_f.bin  isohdpfx_f.bin      libgpl.c32    mbr_f.bin     pxelinux.0      vesainfo.c32
chain.c32     dir.c32        gpxecmd.c32   isohdppx.bin        liblua.c32    memdisk       reboot.c32      vesamenu.c32
cmd.c32       disk.c32       hdt.c32       isohdppx_c.bin      libmenu.c32   meminfo.c32   rosh.c32        vpdtest.c32
cmenu.c32     dmi.c32        hexdump.c32   isohdppx_f.bin      libutil.c32   menu.c32      sanboot.c32     whichsys.c32
config.c32    dmitest.c32    host.c32      isolinux.bin        linux.c32     pci.c32       sdi.c32         zzjson.c32
cptime.c32    dosutil        ifcpu64.c32   isolinux-debug.bin  lpxelinux.0   pcitest.c32   sysdump.c32
cpu.c32       elf.c32        ifcpu.c32     kbdmap.c32          ls.c32        pmload.c32    syslinux64.exe
cpuid.c32     ethersel.c32   ifmemdsk.c32  kontron_wdt.c32     lua.c32       poweroff.c32  syslinux.c32
[root@cobbler tftpboot]# cp /usr/share/syslinux/libutil.c32 .
[root@cobbler tftpboot]# ls
boot              COPYING.yaboot  grub      grub-x86_64.efi  images   ldlinux.c32  menu.c32  pxelinux.0    README  yaboot
COPYING.syslinux  etc             grub.cfg  grub-x86.efi     images2  libutil.c32  ppc       pxelinux.cfg  s390x

新建虚拟机从pxe启动,若出现以下界面则表示成功:

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

//解决方案
[root@cobbler ~]# vim /var/lib/cobbler/templates/uos20.ks 
[root@cobbler ~]# cat /var/lib/cobbler/templates/uos20.ks 
auth --enableshadow --passalgo=sha512
bootloader --location=mbr
clearpart --all --initlabel
part /boot --asprimary --fstype="ext4" --size=500
part swap --fstype="swap" --size=4096
part / --fstype="ext4" --grow --size=15000
text
firewall --disabled
firstboot --disable
keyboard us
lang en_US
url --url=http://192.168.116.146/cobbler/links/uos20-x86_64/
$yum_repo_stanza                          //删除这一行
rebootrootpw --iscrypted $6$WqdLuLnm2W8M98bv$XKfgxxCeviKNg4y/pj6bT2/b/WIT.91YyWcb3930BgVUiuHXuFtqQXLP3isSdfz2mZpSQCDqO.Ude3uL9pz370selinux --disabled
skipx
timezone Asia/Shanghai --isUtc --nontp
install                                   //删除这一行
zerombr%packages
@^minimal                                 //删除这一行                             
@core
kexec-tools%end%addon com_redhat_kdump --enable --reserve-mb='auto'%end%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end

在这里插入图片描述

4.cobbler服务端部署centos7

接着上面的基础上部署

在这里插入图片描述

1.导入centos7镜像
[root@cobbler ~]# mount /dev/cdrom /mnt
mount: /mnt: WARNING: source write-protected, mounted read-only.
[root@cobbler ~]# ls /mnt
CentOS_BuildTag  EULA  images    LiveOS    repodata              RPM-GPG-KEY-CentOS-Testing-7
EFI              GPL   isolinux  Packages  RPM-GPG-KEY-CentOS-7  TRANS.TBL[root@cobbler ~]# cobbler import --path=/mnt --name=centos-7 --arch=x86_64
task started: 2023-12-25_153833_import
task started (id=Media import, time=Mon Dec 25 15:38:33 2023)
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=uniontech, version=uniontech
Found a candidate signature: breed=redhat, version=rhel6
Found a candidate signature: breed=redhat, version=rhel7
Found a candidate signature: breed=redhat, version=rhel8
Found a matching signature: breed=redhat, version=rhel8
Adding distros from path /var/www/cobbler/distro_mirror/centos-7-x86_64:
creating new distro: centos-7-x86_64
trying symlink: /var/www/cobbler/distro_mirror/centos-7-x86_64 -> /var/www/cobbler/links/centos-7-x86_64
creating new profile: centos-7-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/centos-7-x86_64 for centos-7-x86_64
processing repo at : /var/www/cobbler/distro_mirror/centos-7-x86_64
need to process repo/comps: /var/www/cobbler/distro_mirror/centos-7-x86_64
looking for /var/www/cobbler/distro_mirror/centos-7-x86_64/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/distro_mirror/centos-7-x86_64/repodata
*** TASK COMPLETE ***
2.查看cobbler镜像列表
[root@cobbler ~]# cobbler list
distros:centos-7-x86_64uos20-x86_64profiles:centos-7-x86_64uos20-x86_64systems:repos:images:mgmtclasses:packages:files:3.创建kickstarts自动安装脚本
[root@cobbler ~]# cd /var/lib/cobbler/templates/
[root@cobbler templates]# ls
default.ks    install_profiles  pxerescue.ks         sample_esxi5.ks  sample_legacy.ks  uos20.ks
esxi4-ks.cfg  legacy.ks         sample_autoyast.xml  sample_esxi6.ks  sample_old.seed
esxi5-ks.cfg  powerkvm.ks       sample_esxi4.ks      sample.ks        sample.seed
[root@cobbler templates]# cp uos20.ks centos-7.ks
[root@cobbler templates]# ls
centos-7.ks   esxi5-ks.cfg      powerkvm.ks          sample_esxi4.ks  sample.ks         sample.seed
default.ks    install_profiles  pxerescue.ks         sample_esxi5.ks  sample_legacy.ks  uos20.ks
esxi4-ks.cfg  legacy.ks         sample_autoyast.xml  sample_esxi6.ks  sample_old.seed
[root@cobbler templates]# vim centos-7.ks
[root@cobbler templates]# cat centos-7.ks
auth --enableshadow --passalgo=sha512
bootloader --location=mbr
clearpart --all --initlabel
part /boot --asprimary --fstype="ext4" --size=500
part swap --fstype="swap" --size=4096
part / --fstype="ext4" --grow --size=15000
text
firewall --disabled
firstboot --disable
keyboard us
lang en_US
url --url=http://192.168.116.146/cobbler/links/centos-7-x86_64/
$yum_repo_stanza
rebootrootpw --iscrypted $6$WqdLuLnm2W8M98bv$XKfgxxCeviKNg4y/pj6bT2/b/WIT.91YyWcb3930BgVUiuHXuFtqQXLP3isSdfz2mZpSQCDqO.Ude3uL9pz370selinux --disabled
skipx
timezone Asia/Shanghai --isUtc --nontp
install
zerombr%packages
@^minimal
@core
kexec-tools%end%addon com_redhat_kdump --enable --reserve-mb='auto'%end%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end4.检查ks文件语法是否有误
[root@cobbler ~]# cobbler --help
usage
=====
cobbler <distro|profile|system|repo|image|mgmtclass|package|file> ... [add|edit|copy|get-autoinstall*|list|remove|rename|report] [options|--help]
cobbler <aclsetup|buildiso|import|list|replicate|report|reposync|sync|validate-autoinstalls|version|signature|get-loaders|hardlink> [options|--help]
[root@cobbler ~]# cobbler validate-autoinstalls
task started: 2023-12-25_154550_validate_autoinstall_files
task started (id=Automated installation files validation, time=Mon Dec 25 15:45:50 2023)
running python triggers from /var/lib/cobbler/triggers/task/validate_autoinstall_files/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/validate_autoinstall_files/pre/*
shell triggers finished successfully
*** TASK COMPLETE ***5.查看当前cobbler有哪些配置文件
[root@cobbler ~]# cobbler profile listcentos-7-x86_64uos20-x86_646.修改profile,将我们新建的ks文件设为默认的kickstarts安装文件
[root@cobbler ~]# cobbler profile edit --name centos-7-x86_64  --autoinstall=centos-7.ks7.配置网卡名称为传统网卡名称eth0
[root@cobbler ~]# cobbler profile edit --name centos-7-x86_64 --kernel-options='net.ifnames=0 biosdevname=0'8.检查当前系统cobbler配置文件信息
[root@cobbler ~]# cobbler profile report
Name                           : uos20-x86_64
Automatic Installation Template : uos20.ks
Automatic Installation Metadata : {}
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : uos20-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
DHCP Filename Override         : <<inherit>>
Kernel Options                 : {'net.ifnames': '0', 'biosdevname': '0'}
Kernel Options (Post Install)  : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Next Server Override           : <<inherit>>
Owners                         : ['admin']
Parent Profile                 : 
Proxy                          : 
Red Hat Management Key         : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvmName                           : centos-7-x86_64
Automatic Installation Template : centos-7.ks
Automatic Installation Metadata : {}
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : centos-7-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
DHCP Filename Override         : <<inherit>>
Kernel Options                 : {'net.ifnames': '0', 'biosdevname': '0'}
Kernel Options (Post Install)  : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Next Server Override           : <<inherit>>
Owners                         : ['admin']
Parent Profile                 : 
Proxy                          : 
Red Hat Management Key         : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvm9.为避免发生未知问题,先把服务端所有服务重启
[root@cobbler ~]# systemctl restart xinetd httpd cobblerd
[root@cobbler ~]# ss -antl
State          Recv-Q         Send-Q                 Local Address:Port                  Peer Address:Port        Process        
LISTEN         0              5                            0.0.0.0:873                        0.0.0.0:*                          
LISTEN         0              128                          0.0.0.0:22                         0.0.0.0:*                          
LISTEN         0              5                          127.0.0.1:631                        0.0.0.0:*                          
LISTEN         0              5                          127.0.0.1:25151                      0.0.0.0:*                          
LISTEN         0              5                               [::]:873                           [::]:*                          
LISTEN         0              511                                *:80                               *:*                          
LISTEN         0              128                             [::]:22                            [::]:*                          
LISTEN         0              5                              [::1]:631                           [::]:*                          
LISTEN         0              511                                *:443                              *:*                         

5.客户端安装

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

6.cobbler服务端部署centos8

在这里插入图片描述

1.导入centos8镜像
[root@cobbler ~]# mount /dev/cdrom /mnt
mount: /mnt: WARNING: source write-protected, mounted read-only.
[root@cobbler ~]# ls /mnt/
AppStream  BaseOS  EFI  images  isolinux  LICENSE  media.repo  TRANS.TBL
[root@cobbler ~]# cobbler --help
usage
=====
cobbler <distro|profile|system|repo|image|mgmtclass|package|file> ... [add|edit|copy|get-autoinstall*|list|remove|rename|report] [options|--help]
cobbler <aclsetup|buildiso|import|list|replicate|report|reposync|sync|validate-autoinstalls|version|signature|get-loaders|hardlink> [options|--help]
[root@cobbler ~]# cobbler signature update
task started: 2023-12-25_171337_sigupdate
task started (id=Updating Signatures, time=Mon Dec 25 17:13:37 2023)
running python triggers from /var/lib/cobbler/triggers/task/sigupdate/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/sigupdate/pre/*
shell triggers finished successfully
Successfully got file from https://cobbler.github.io/signatures/3.0.x/latest.json
*** TASK COMPLETE ***
[root@cobbler ~]# cobbler import --path=/mnt --name=centos-8 --arch=x86_64
task started: 2023-12-25_210336_import
task started (id=Media import, time=Mon Dec 25 21:03:36 2023)
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=rhel8
Found a matching signature: breed=redhat, version=rhel8
Adding distros from path /var/www/cobbler/distro_mirror/centos-8-x86_64:
creating new distro: centos-8-x86_64
trying symlink: /var/www/cobbler/distro_mirror/centos-8-x86_64 -> /var/www/cobbler/links/centos-8-x86_64
creating new profile: centos-8-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/centos-8-x86_64 for centos-8-x86_64
processing repo at : /var/www/cobbler/distro_mirror/centos-8-x86_64/AppStream
need to process repo/comps: /var/www/cobbler/distro_mirror/centos-8-x86_64/AppStream
looking for /var/www/cobbler/distro_mirror/centos-8-x86_64/AppStream/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/distro_mirror/centos-8-x86_64/AppStream/repodata
processing repo at : /var/www/cobbler/distro_mirror/centos-8-x86_64/BaseOS
need to process repo/comps: /var/www/cobbler/distro_mirror/centos-8-x86_64/BaseOS
looking for /var/www/cobbler/distro_mirror/centos-8-x86_64/BaseOS/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/distro_mirror/centos-8-x86_64/BaseOS/repodata
*** TASK COMPLETE ***2.查看cobbler镜像列表
[root@cobbler ~]# cobbler list
distros:centos-7-x86_64centos-8-x86_64uos20-x86_64profiles:centos-7-x86_64centos-8-x86_64uos20-x86_64systems:repos:images:mgmtclasses:packages:files:3.创建kickstarts自动安装脚本
[root@cobbler ~]# cd /var/lib/cobbler/
[root@cobbler cobbler]# ls
collections  distro_signatures.json  grub_config  loaders  lock  scripts  snippets  templates  triggers  web.ss  webui_sessions
[root@cobbler cobbler]# cd templates/
[root@cobbler templates]# ls
centos-7.ks  esxi4-ks.cfg  install_profiles  powerkvm.ks   sample_autoyast.xml  sample_esxi5.ks  sample.ks         sample_old.seed  uos20.ks
default.ks   esxi5-ks.cfg  legacy.ks         pxerescue.ks  sample_esxi4.ks      sample_esxi6.ks  sample_legacy.ks  sample.seed
[root@cobbler templates]# cp uos20.ks centos-8.ks
[root@cobbler templates]# vim centos-8.ks
[root@cobbler templates]# cat centos-8.ks
auth --enableshadow --passalgo=sha512
bootloader --location=mbr
clearpart --all --initlabel
part /boot --asprimary --fstype="ext4" --size=500
part swap --fstype="swap" --size=4096
part / --fstype="ext4" --grow --size=15000
text
firewall --disabled
firstboot --disable
keyboard us
lang en_US
url --url=http://192.168.116.146/cobbler/links/centos-8-x86_64/
$yum_repo_stanza
rebootrootpw --iscrypted $6$WqdLuLnm2W8M98bv$XKfgxxCeviKNg4y/pj6bT2/b/WIT.91YyWcb3930BgVUiuHXuFtqQXLP3isSdfz2mZpSQCDqO.Ude3uL9pz370selinux --disabled
skipx
timezone Asia/Shanghai --isUtc --nontp
install
zerombr%packages
@^minimal
@core
kexec-tools%end%addon com_redhat_kdump --enable --reserve-mb='auto'%end%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end4.检查ks文件语法是否有误
[root@cobbler ~]# cobbler --help
usage
=====
cobbler <distro|profile|system|repo|image|mgmtclass|package|file> ... [add|edit|copy|get-autoinstall*|list|remove|rename|report] [options|--help]
cobbler <aclsetup|buildiso|import|list|replicate|report|reposync|sync|validate-autoinstalls|version|signature|get-loaders|hardlink> [options|--help]
[root@cobbler ~]# cobbler validate-autoinstalls
task started: 2023-12-25_172657_validate_autoinstall_files
task started (id=Automated installation files validation, time=Mon Dec 25 17:26:57 2023)
running python triggers from /var/lib/cobbler/triggers/task/validate_autoinstall_files/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/validate_autoinstall_files/pre/*
shell triggers finished successfully
*** TASK COMPLETE ***5.查看当前cobbler有哪些配置文件
[root@cobbler ~]# cobbler profile listcentos-7-x86_64centos-8-x86_64uos20-x86_646.修改profile,将我们新建的ks文件设为默认的kickstarts安装文件
[root@cobbler ~]# cobbler profile edit --name centos-8-x86_64 --autoinstall=centos-8.ks7.配置网卡名称为传统网卡名称eth0
[root@cobbler ~]# cobbler profile edit --name centos-8-x86_64 --kernel-options='net.ifnames=0 biosdevname=0'8.检查当前系统cobbler配置文件信息
[root@cobbler ~]# cobbler profile report
Name                           : uos20-x86_64
Automatic Installation Template : uos20.ks
Automatic Installation Metadata : {}
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : uos20-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
DHCP Filename Override         : <<inherit>>
Kernel Options                 : {'net.ifnames': '0', 'biosdevname': '0'}
Kernel Options (Post Install)  : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Next Server Override           : <<inherit>>
Owners                         : ['admin']
Parent Profile                 : 
Proxy                          : 
Red Hat Management Key         : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvmName                           : centos-7-x86_64
Automatic Installation Template : centos-7.ks
Automatic Installation Metadata : {}
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : centos-7-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
DHCP Filename Override         : <<inherit>>
Kernel Options                 : {'net.ifnames': '0', 'biosdevname': '0'}
Kernel Options (Post Install)  : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Next Server Override           : <<inherit>>
Owners                         : ['admin']
Parent Profile                 : 
Proxy                          : 
Red Hat Management Key         : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvmName                           : centos-8-x86_64
Automatic Installation Template : centos-8.ks
Automatic Installation Metadata : {}
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : centos-8-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
DHCP Filename Override         : <<inherit>>
Kernel Options                 : {'net.ifnames': '0', 'biosdevname': '0'}
Kernel Options (Post Install)  : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Next Server Override           : <<inherit>>
Owners                         : ['admin']
Parent Profile                 : 
Proxy                          : 
Red Hat Management Key         : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvm

7.客户端安装

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

8.cobbler服务端部署rockylinux9

1.导入rockylinux9镜像
[root@cobbler ~]# mount /dev/cdrom /mnt
mount: /mnt: WARNING: source write-protected, mounted read-only.
[root@cobbler ~]# ls /mnt
AppStream  BaseOS  EFI  images  isolinux  LICENSE  media.repo
[root@cobbler ~]# cobbler --help
usage
=====
cobbler <distro|profile|system|repo|image|mgmtclass|package|file> ... [add|edit|copy|get-autoinstall*|list|remove|rename|report] [options|--help]
cobbler <aclsetup|buildiso|import|list|replicate|report|reposync|sync|validate-autoinstalls|version|signature|get-loaders|hardlink> [options|--help]
[root@cobbler ~]# cobbler signature update
task started: 2023-12-25_173814_sigupdate
task started (id=Updating Signatures, time=Mon Dec 25 17:38:14 2023)
running python triggers from /var/lib/cobbler/triggers/task/sigupdate/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/sigupdate/pre/*
shell triggers finished successfully
Successfully got file from https://cobbler.github.io/signatures/3.0.x/latest.json
*** TASK COMPLETE ***
[root@cobbler ~]# mount /dev/cdrom /mnt
mount: /mnt: WARNING: source write-protected, mounted read-only.
[root@cobbler ~]# cobbler signature update
task started: 2023-12-25_211938_sigupdate
task started (id=Updating Signatures, time=Mon Dec 25 21:19:38 2023)
running python triggers from /var/lib/cobbler/triggers/task/sigupdate/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/sigupdate/pre/*
shell triggers finished successfully
Successfully got file from https://cobbler.github.io/signatures/3.0.x/latest.json
*** TASK COMPLETE ***
[root@cobbler ~]# cobbler import --path=/mnt --name=rockylinux9 --arch=x86_64
task started: 2023-12-25_212031_import
task started (id=Media import, time=Mon Dec 25 21:20:31 2023)
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=rhel8
Found a candidate signature: breed=redhat, version=rhel9
Found a matching signature: breed=redhat, version=rhel9
Adding distros from path /var/www/cobbler/distro_mirror/rockylinux9-x86_64:
creating new distro: rockylinux9-x86_64
trying symlink: /var/www/cobbler/distro_mirror/rockylinux9-x86_64 -> /var/www/cobbler/links/rockylinux9-x86_64
creating new profile: rockylinux9-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/rockylinux9-x86_64 for rockylinux9-x86_64
processing repo at : /var/www/cobbler/distro_mirror/rockylinux9-x86_64/AppStream
directory /var/www/cobbler/distro_mirror/rockylinux9-x86_64/AppStream is missing xml comps file, skipping
processing repo at : /var/www/cobbler/distro_mirror/rockylinux9-x86_64/BaseOS
directory /var/www/cobbler/distro_mirror/rockylinux9-x86_64/BaseOS is missing xml comps file, skipping
*** TASK COMPLETE ***2.查看cobbler镜像列表
[root@cobbler ~]# cobbler list
distros:centos-8-x86_64rockylinux9-x86_64uos20-x86_64profiles:centos-8-x86_64rockylinux9-x86_64uos20-x86_64systems:repos:images:mgmtclasses:packages:files:3.创建kickstarts自动安装脚本
[root@cobbler ~]# cd /var/lib/cobbler/templates/
[root@cobbler templates]# ls
centos-8.ks  esxi4-ks.cfg  install_profiles  powerkvm.ks   sample_autoyast.xml  sample_esxi5.ks  sample.ks         sample_old.seed  uos20.ks
default.ks   esxi5-ks.cfg  legacy.ks         pxerescue.ks  sample_esxi4.ks      sample_esxi6.ks  sample_legacy.ks  sample.seed
[root@cobbler templates]# cp uos20.ks rockylinux9.ks
[root@cobbler templates]# vim rockylinux9.ks 
[root@cobbler templates]# cat rockylinux9.ks 
auth --enableshadow --passalgo=sha512
bootloader --location=mbr
clearpart --all --initlabel
part /boot --asprimary --fstype="ext4" --size=500
part swap --fstype="swap" --size=4096
part / --fstype="ext4" --grow --size=15000
text
firewall --disabled
firstboot --disable
keyboard us
lang en_US
url --url=http://192.168.116.147/cobbler/links/rockylinux9-x86_64/
rebootrootpw --iscrypted $6$cbbyBQuKbE03l1D.$.0dMYU5cLAbG7w.wwLdJOreYDXusceBHnUUUHufkY25OZzF8mt7H7YzRWVYckC13uQB88ad09JQ93CsUabHJd0selinux --disabled
skipx
timezone Asia/Shanghai --isUtc --nontp
zerombr%packages
@core
kexec-tools%end%addon com_redhat_kdump --enable --reserve-mb='auto'%end%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end4.检查ks文件语法是否有误
[root@cobbler ~]# cobbler --help
usage
=====
cobbler <distro|profile|system|repo|image|mgmtclass|package|file> ... [add|edit|copy|get-autoinstall*|list|remove|rename|report] [options|--help]
cobbler <aclsetup|buildiso|import|list|replicate|report|reposync|sync|validate-autoinstalls|version|signature|get-loaders|hardlink> [options|--help]
[root@cobbler ~]# cobbler validate-autoinstalls
task started: 2023-12-25_212700_validate_autoinstall_files
task started (id=Automated installation files validation, time=Mon Dec 25 21:27:00 2023)
running python triggers from /var/lib/cobbler/triggers/task/validate_autoinstall_files/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/validate_autoinstall_files/pre/*
shell triggers finished successfully
*** TASK COMPLETE ***5.查看当前cobbler有哪些配置文件
[root@cobbler ~]# cobbler profile listcentos-8-x86_64rockylinux9-x86_64uos20-x86_646.修改profile,将我们新建的ks文件设为默认的kickstarts安装文件
[root@cobbler ~]# cobbler profile edit --name rockylinux9-x86_64 --autoinstall=rockylinux9.ks7.配置网卡名称为传统网卡名称eth0
[root@cobbler ~]# cobbler profile edit --name rockylinux9-x86_64 --kernel-options='net.ifnames=0 biosdevname=0'8.检查当前系统cobbler配置文件信息
[root@cobbler ~]# cobbler profile report
Name                           : uos20-x86_64
Automatic Installation Template : uos20.ks
Automatic Installation Metadata : {}
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : uos20-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
DHCP Filename Override         : <<inherit>>
Kernel Options                 : {'net.ifnames': '0', 'biosdevname': '0'}
Kernel Options (Post Install)  : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Next Server Override           : <<inherit>>
Owners                         : ['admin']
Parent Profile                 : 
Proxy                          : 
Red Hat Management Key         : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvmName                           : centos-8-x86_64
Automatic Installation Template : centos-8.ks
Automatic Installation Metadata : {}
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : centos-8-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
DHCP Filename Override         : <<inherit>>
Kernel Options                 : {'net.ifnames': '0', 'biosdevname': '0'}
Kernel Options (Post Install)  : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Next Server Override           : <<inherit>>
Owners                         : ['admin']
Parent Profile                 : 
Proxy                          : 
Red Hat Management Key         : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvmName                           : rockylinux9-x86_64
Automatic Installation Template : rockylinux9.ks
Automatic Installation Metadata : {}
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : rockylinux9-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
DHCP Filename Override         : <<inherit>>
Kernel Options                 : {'net.ifnames': '0', 'biosdevname': '0'}
Kernel Options (Post Install)  : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Next Server Override           : <<inherit>>
Owners                         : ['admin']
Parent Profile                 : 
Proxy                          : 
Red Hat Management Key         : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvm

9.客户端安装

修改参数

1.第一个位置(这个位置可以忽略)
[root@cobbler ~]# cd /var/lib/tftpboot/
[root@cobbler tftpboot]# ls
boot              COPYING.yaboot  grub      grub-x86_64.efi  images   ldlinux.c32  menu.c32  pxelinux.0    README  yaboot
COPYING.syslinux  etc             grub.cfg  grub-x86.efi     images2  libutil.c32  ppc       pxelinux.cfg  s390x
[root@cobbler tftpboot]# ls grub
aarch64_menu_items.cfg  arm_menu_items.cfg   ia64_menu_items.cfg  local_powerpc-ieee1275.cfg  ppc64_menu_items.cfg  system
amd64_menu_items.cfg    grub.cfg             images               loongarch64_menu_items.cfg  ppc_menu_items.cfg    system_link
ARM64_menu_items.cfg    i386_menu_items.cfg  local_efi.cfg        ppc64el_menu_items.cfg      s390_menu_items.cfg   x86_64_menu_items.cfg
armhfp_menu_items.cfg   i586_menu_items.cfg  local_legacy.cfg     ppc64le_menu_items.cfg      s390x_menu_items.cfg  x86_menu_items.cfg
[root@cobbler tftpboot]# vim grub/x86_64_menu_items.cfg      //找到rockylinux9的在ks前面加instappend initrd=/images/rockylinux9-x86_64/initrd.img net.ifnames=0 biosdevname=0  inst.kssendmac inst.ks=http://192.168.116.147/cblr/svc/op/autoinstall/profile/rockylinux9-x86_642.第二个位置
[root@cobbler tftpboot]# pwd
/var/lib/tftpboot
[root@cobbler tftpboot]# ls
boot              COPYING.yaboot  grub      grub-x86_64.efi  images   ldlinux.c32  menu.c32  pxelinux.0    README  yaboot
COPYING.syslinux  etc             grub.cfg  grub-x86.efi     images2  libutil.c32  ppc       pxelinux.cfg  s390x
[root@cobbler tftpboot]# ls pxelinux.cfg/
default
[root@cobbler tftpboot]# vim pxelinux.cfg/default 
[root@cobbler tftpboot]# cat pxelinux.cfg/default     //找到rockylinux9,ks前面加上instappend initrd=/images/rockylinux9-x86_64/initrd.img net.ifnames=0 biosdevname=0  inst.kssendmac inst.ks=http://192.168.116.147/cblr/svc/op/autoinstall/profile/rockylinux9-x86_643.第三个位置
[root@cobbler tftpboot]# find / -name tftp*.py
/usr/sbin/tftpd.py
/usr/lib/python3.6/site-packages/cobbler/modules/managers/tftpd_py.py
/usr/lib/python3.6/site-packages/cobbler/tftpgen.py
[root@cobbler tftpboot]# ls /usr/lib/python3.6/site-packages/cobbler
actions                 cexceptions.py       cobblerd.py          grub.py           modules           resource.py    templar.py       validate.py
api.py                  cli.py               configgen.py         __init__.py       power_manager.py  serializer.py  template_api.py  web
autoinstallgen.py       clogger.py           download_manager.py  items             __pycache__       services.py    tftpgen.py       yumgen.py
autoinstall_manager.py  cobbler_collections  field_info.py        module_loader.py  remote.py         settings.py    utils.py
//用/sendmac找,然后在ks前面加上inst
[root@cobbler tftpboot]# vim /usr/lib/python3.6/site-packages/cobbler/tftpgen.py append_line += " inst.kssendmac"append_line = "%s inst.ks=%s" % (append_line, autoinstall_path)gpxe = blended["enable_gpxe"]

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

10.定制安装

定制安装步骤:

  • 统计服务器mac地址
  • 配置cobbler
  • 安装

统计mac地址此处就不赘述了,直接最重要的配置
在 cobbler 的web界面上配置:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/758010.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

面试笔记——Redis(集群方案:主从复制、哨兵模式和分片集群)

主从复制 在 Redis 主从集群中&#xff0c;一个主节点&#xff08;Master&#xff09;负责处理客户端的读写请求&#xff0c;而多个从节点&#xff08;Slave&#xff09;则负责复制主节点的数据&#xff0c;并对外提供读取服务——解决高并发问题。 主节点&#xff08;Master&…

最新ChatGPT/GPT4科研应用与AI绘图及论文高效写作教程

原文链接&#xff1a;最新ChatGPT/GPT4科研应用与AI绘图及论文高效写作教程https://mp.weixin.qq.com/s?__bizMzUzNTczMDMxMg&mid2247598050&idx5&sn70fd3f5946d581ad9c1363295b130ef5&chksmfa823e05cdf5b713baf9cf1381bfb2455ad675a0b21e194bef8b76f35d6aa77…

C++初阶 | [九] list 及 其模拟实现

摘要&#xff1a;介绍 list 容器&#xff0c;list 模拟实现&#xff0c;list与vector的对比 list&#xff08;带头双向循环列表&#xff09; 导入&#xff1a;list 的成员函数基本上与 vector 类似&#xff0c;具体内容可以查看相关文档(cplusplus.com/reference/list/list/)&…

Linux中使用vim编辑器的时候提示:发现交换文件“XXX.swap“

目录 问题描述解决方案 问题描述 有时候vim编辑文件的时候 系统突然卡了 无奈只能强制退出关机 然后重启 这个时候想重新回来继续编辑刚刚的文件 注意:我这种操作方式 虽然之后可以继续正常编辑了 但是发现文件是没有保存的 vim XXX进去有如下提示 解决方案 注意:我这种操作…

基于python的变配电室运行状态评估与预警系统flask-django-nodejs-php

近年来,随着我国工业化、城镇化步伐的不断加快&#xff0c;城市配电网络取得令人瞩目的发展成果。变配电室是供配电系统的核心&#xff0c;在供配电系统中占有特殊的重要地位[1]。变配电室电气设备运行状态和环境信息缺乏必要的监测评估预警手段&#xff0c;如有一日遭遇突发情…

Linux-线程同步

文章目录 前言一、为什么要线程同步&#xff1f;二、线程同步pthread_cond_initpthread_cond_destroypthread_cond_wait、pthread_cond_signal和 pthread_cond_broadcast 三、示例代码 前言 上节课学习了线程互斥&#xff0c;这节课针对线程互斥内容在做进一步的补充和完善&am…

[C语言]一维数组二维数组的大小

对于一维数组我们知道取地址是取首元素的地址&#xff0c;二维数组呢&#xff0c;地址是取第一行的地址&#xff0c;sizeof(数组名)这里计算的就是整个数组的大小&#xff0c;&数组名 表示整个数组&#xff0c;取出的是整个数组的地址&#xff0c;显示的是数组的首元素 记…

网络工程师练习题2

网络工程师 将专用IP地址转换为公用IP地址的技术是&#xff08;&#xff09;。 A.ARPB.DHCPC.UTMD.NAT 【答案】D 【解析】概念题&#xff0c;NAT技术将源地址从内部专用地址转换成可以在外部Internet上路由的全局IP地址。 R1、R2是一个自治系统中采用RIP路由协议的两个相…

【计算机网络篇】物理层(4)信道的极限容量,信道复用技术

文章目录 &#x1f354;信道的极限容量&#x1f6f8;造成信号失真的主要因素⭐码元的传输速率 &#x1f6f8;奈氏准则&#x1f6f8;香农公式&#x1f388;练习 &#x1f5d2;️小结 &#x1f354;信道复用技术⭐常见的信道复用技术&#x1f388;频分复用FDM&#x1f388;时分复…

时序分解 | Matlab实现GWO-CEEMDAN基于灰狼算法优化CEEMDAN时间序列信号分解

时序分解 | Matlab实现GWO-CEEMDAN基于灰狼算法优化CEEMDAN时间序列信号分解 目录 时序分解 | Matlab实现GWO-CEEMDAN基于灰狼算法优化CEEMDAN时间序列信号分解效果一览基本介绍程序设计参考资料 效果一览 基本介绍 1.CEEMDAN方法的分解效果取决于白噪声幅值权重(Nstd)和噪声添…

【刷题】滑动窗口入门

送给大家一句话&#xff1a; 那脑袋里的智慧&#xff0c;就像打火石里的火花一样&#xff0c;不去打它是不肯出来的。——莎士比亚 滑动窗口入门 认识滑动窗口Leetcode 209. 长度最小的子数组题目描述算法思路 Leetcode 3. 无重复字符的最长子串题目描述算法思路 Leetcode 1004…

部署应用到K8s集群(未完)

&#xff08;等熟悉一番再来写&#xff0c;因为按小时结算的。。。&#xff09; 1 、 kubectl run 启动 nginx 应用 kubectl run nginx --imagenginx:latest 2、将本地机器的80端口转发到集群中名为nginx的Pod的80端口 kubectl port-forward --address 0.0.0.0 pod/nginx 80:8…

AHI对MySQL性能的影响

MySQL中出现很多latch锁&#xff0c;而这个很大程度上和MySQL自适应hash索引有关。 AHI概述 MySQL InnoDB存储引擎的自适应哈希&#xff08;Adaptive Hash Index&#xff0c;下简称AHI&#xff09;功能 若用户的访问模式基本都是类似KV操作的点查询&#xff08;point select&…

es bulk批量操作简单实例

&#xff08;1&#xff09;定义 bulk允许在单个步骤中进行多次create、index、update或delete请求。 bulk与其他的请求体格式稍有不同&#xff0c;如下所示&#xff1a; { action: { metadata }}\n { request body }\n { action: { metadata }}\n { request body …

FPGA高端项目:FPGA基于GS2971+GS2972架构的SDI视频收发+HLS图像缩放+多路视频拼接,提供4套工程源码和技术支持

目录 1、前言免责声明 2、相关方案推荐本博主所有FPGA工程项目-->汇总目录本博已有的 SDI 编解码方案本方案的SDI接收发送本方案的SDI接收图像缩放应用本方案的SDI接收纯verilog图像缩放纯verilog多路视频拼接应用本方案的SDI接收OSD动态字符叠加输出应用本方案的SDI接收HLS…

【CSS】html滚动条相关

1.滚动条样式 ::-webkit-scrollbar {width: 10px;height: 10px;z-index: 101; } ::-webkit-scrollbar-thumb {border-radius: 5px;background: #cecece; } ::-webkit-scrollbar-track {// background: #f5f5f5be;background: rgba(33, 85, 163, 0); } ::-webkit-scrollbar-but…

python汽车租赁系统的设计与实现flask-django-php-nodejs

困扰公司的许多问题当中,汽车租赁管理一定是公司不敢忽视的一块。但是管理好汽车租赁又面临很多麻烦需要解决,例如有几个方面:第一,公司往往汽车数量都比较多,如何保证能够管理到每一汽车;第二,如何在工作琐碎,记录繁多的情况下将汽车租赁的当前情况反应给公司领导相关部门决策…

Python之Web开发中级教程----ubuntu中下载安装Postman

Python之Web开发中级教程----ubuntu中下载安装Postman PostMan 是一款功能强大的网页调试与发送网页 HTTP 请求的 Chrome 插件&#xff0c;可以直接去对我们写出来的路由和视图函数进行调试&#xff0c;作为后端程序员是必须要知道的一个工具。 查看ubuntu系统中是否已经安装了…

常用小知识点总结

1. pc可以跑通&#xff0c;但是安卓编译死循环&#xff0c;可能是函数声明了返回类型&#xff0c;但是没有真正返回 2. ubuntu下根据关键词杀死所有相关进程。ps -ef | grep code | grep -v grep | cut -c 10-16 | xargs kill -s 9 top和ps基本作用都是显示系统进程状况&…

matplotlib绘图一例

网上外卖用户规模及使用率import matplotlib.pyplot as plt import matplotlib.dates as mdates import pandas as pd# 数据源自www.cnnic.net.cn。 l [["2015/12", "1.14亿", "16.5%"], ["2016/6", "1.50亿", "21.1%…