• 基于CentOS8操作cobbler批量装机


    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/settings.yamlcobbler 主配置文件
    /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     //查看配置信息
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    系统平台IP
    centos8
    redhat8
    192.168.229.148

    2. cobbler服务端部署

    关闭防火墙跟SElinux
    [root@localhost ~]# systemctl disable --now firewalld
    [root@localhost ~]# sed -i 's/^SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
    [root@localhost ~]# grep 'SELINUX=disabled' /etc/selinux/config
    SELINUX=disabled
    
    
    //配置yum源
    [root@localhost ~]# cd /etc/yum.repos.d/
    [root@localhost yum.repos.d]# rm -rf *
    [root@localhost yum.repos.d]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
    [root@localhost yum.repos.d]#  sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
    
    
     // epel源
    [root@localhost yum.repos.d]#  yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
    
    [root@localhost yum.repos.d]#  sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
    [root@localhost yum.repos.d]#  sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
    
    
     // 查找cobbler, 并开启,
    [root@localhost ~]# dnf module list|grep cobbler
    cobbler      3     default [d]     Versatile Linux deployment server
    cobbler     3.3    default        Versatile Linux deployment server
    
    
    开启 cobbler , 注意要跟上版本
    [root@localhost ~]# dnf module enable cobbler:3
    Last metadata expiration check: 0:09:18 ago on Sat 13 Aug 2022 09:51:23 PM CST.
    Dependencies resolved.
    ======================================================================
     Package         Architecture   Version         Repository       Size
    ======================================================================
    Enabling module streams:
     cobbler                        3
    
    Transaction Summary
    ======================================================================
    
    Is this ok [y/N]: y
    Complete!
    
    
    // 没有开启cobbler 模块是找不到的
    [root@localhost ~]# dnf list all|grep cobbler
    cobbler.noarch          3.2.2-11.module_el8+14161+f12890f2      epel-modular 
    cobbler-tests.noarch    3.2.2-11.module_el8+14161+f12890f2      epel-modular
    cobbler-web.noarch      3.2.2-11.module_el8+14161+f12890f2      epel-modul
    
    
    [root@localhost ~]# dnf list all|grep rsync
    rsync.x86_64              3.1.3-12.el8       @base  # 下载这个包
    librsync.x86_64          2.3.2-1.el8         epel
    librsync-devel.x86_64    2.3.2-1.el8          epel
    librsync-doc.noarch      2.3.2-1.el8          epel
    rsync-bpc.x86_64         3.1.3.0-1.el8       epel
    rsync-daemon.noarch      3.1.3-12.el8          base    # 下载这个包
    
    
    //安装cobbler以及相关的软件
    [root@localhost ~]# dnf  -y install httpd dhcp-server tftp tftp-server  cobbler  cobbler-web pykickstart  rsync-daemon  rsync
    安装过程略....
    
    
    
    
    
    
    
    //启动服务并设置开机自启
    [root@localhost ~]# systemctl enable --now tftp
    [root@localhost ~]# systemctl enable --now dhcpd
    [root@localhost ~]# systemctl enable --now httpd
    Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
    [root@localhost ~]# systemctl enable --now cobblerd
    Created symlink /etc/systemd/system/multi-user.target.wants/cobblerd.service → /usr/lib/systemd/system/cobblerd.service.
    [root@localhost ~]# ss -antl
    State  Recv-Q Send-Q  Local Address:Port    Peer Address:Port Process
    LISTEN 0      5           127.0.0.1:25151        0.0.0.0:*
    LISTEN 0      128           0.0.0.0:22           0.0.0.0:*
    LISTEN 0      128                 *:80                 *:*
    LISTEN 0      128              [::]:22              [::]:*
    LISTEN 0      128                 *:443                *:*
    [root@localhost ~]#
    
    
    
    
    
    [root@localhost ~]# cd /etc/cobbler/
    [root@localhost cobbler]# ls
    auth.conf               logging_config.conf  secondary.template
    boot_loader_conf        modules.conf         settings.d
    cheetah_macros          mongodb.conf         settings.yaml  //在8 里叫这个名字
    dhcp.template           named.template       users.conf
    dnsmasq.template        ndjbdns.template     users.digest
    genders.template        reporting            version
    import_rsync_whitelist  rsync.exclude        zone.template
    iso                     rsync.template       zone_templates
    
    
    //修改server的ip地址为本机ip
    [root@localhost ~]# sed -i 's/^server: 127.0.0.1/server: 192.168.229.148/' /etc/cobbler/settings.yaml
    
    
    //设置tftp的ip地址为本机ip
    [root@localhost ~]# sed -i 's/^next_server: 127.0.0.1/next_server: 192.168.229.148/' /etc/cobbler/settings.yaml
    
    
    
    
    //启动rsync并设置开机自启
    [root@localhost ~]# systemctl enable  --now rsyncd
    Created symlink /etc/systemd/system/multi-user.target.wants/rsyncd.service → /usr/lib/systemd/system/rsyncd.service.
    [root@localhost ~]# systemctl status rsyncd
    ● rsyncd.service - fast remote file copy program daemon
       Loaded: loaded (/usr/lib/systemd/system/rsyncd.service; enabled; v>
       Active: active (running) since Sat 2022-08-13 22:25:50 CST; 6s ago
    
    
    //生成加密的密码
    [root@localhost ~]# openssl passwd -1 -salt "$RANDOM" 'agan9639@'
    $1$31746$4gpDrgEIXdIwdIUq3X3V//        //这是密码加密后的形式
    # 这个密码是给系统用的不必在意
    
    
    //将新生成的加密密码加入到配置文件
    [root@localhost ~]#sed -i '/default_password_crypted.*/c default_password_crypted: "$1$31746$4gpDrgEIXdIwdIUq3X3V//"' /etc/cobbler/settings.yaml
    
    [root@localhost ~]# grep 'default_password_crypted.*' /etc/cobbler/settings.yaml
    default_password_crypted: "$1$31746$4gpDrgEIXdIwdIUq3X3V//"
    
    
    //重启cobbler
    [root@localhost ~]# systemctl restart cobblerd
    [root@localhost ~]# ss -antl
    State  Recv-Q Send-Q  Local Address:Port    Peer Address:Port Process
    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      128           0.0.0.0:22           0.0.0.0:*
    LISTEN 0      5                [::]:873             [::]:*
    LISTEN 0      128                 *:80                 *:*
    LISTEN 0      128              [::]:22              [::]:*
    LISTEN 0      128                 *:443                *:*
    
    
    
    
    //通过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: reposync is not installed, install yum-utils or dnf-plugins-core
    3: yumdownloader is not installed, install yum-utils or dnf-plugins-core
    4: debmirror package is not installed, it will be required to manage debian deployments and repositories
    5: 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.
    //以上4和5是关于debian系统的错误,请忽略
    
    现在解决123问题
    
    [root@localhost ~]# dnf list all|grep syslinux
    syslinux.x86_64             6.04-5.el8     base  // 下载这个包解决第一个问题
    syslinux-extlinux.x86_64    6.04-5.el8     base  
    syslinux-nonlinux.noarch    6.04-5.el8     base
    syslinux-tftpboot.noarch     6.04-5.el8    base  
    [root@localhost ~]#
    
    
    [root@localhost ~]# ls /usr/share/syslinux/menu.c32
    /usr/share/syslinux/menu.c32  # 复制到/var/lib/cobbler/loaders
    [root@localhost ~]# ls /usr/share/syslinux/pxelinux.0
    /usr/share/syslinux/pxelinux.0   # 复制到/var/lib/cobbler/loaders
    
    
    复制这两个文件menu.c32 pxelinux.0  到/var/lib/cobbler/loaders
    [root@localhost ~]# cd /usr/share/syslinux/
    [root@localhost syslinux]# cp menu.c32 pxelinux.0 /var/lib/cobbler/loaders/
    
    
    [root@localhost ~]# ls /var/lib/cobbler/loaders
    menu.c32  pxelinux.0
    
    执行这个脚本
    [root@localhost ~]# /usr/share/cobbler/bin/mkgrub.sh
    ...省略N
    
    [root@localhost ~]# ls /var/lib/cobbler/loaders
    grub  ldlinux.c32  menu.c32  pxelinux.0
    多出的这两个文件,是开启需要的,没有启动不了
    
    
    [root@localhost ~]# dnf list all| grep yum-utils
    yum-utils.noarch         4.0.21-3.el8       base  // 这个包解决2和3的问题
    [root@localhost ~]#
    
    [root@localhost ~]# dnf -y install yum-utils syslinux   
    
    # 再检查一次
    [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
    3: 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 的问题包  已经下载了所以可以忽略它
    
    
    
    //配置cobbler dhcp
    //修改cobbler配置文件,让cobbler控制dhcp
    [root@localhost ~]# sed -i 's/^manage_dhcp: false/manage_dhcp: true/' /etc/cobbler/settings.yaml
    [root@localhost ~]# sed -n '/manage_dhcp: true/p' /etc/cobbler/settings.yaml
    manage_dhcp: true
    
    
    
    //配置dhcp
    [root@localhost ~]# vim /etc/cobbler/dhcp.template
    ....    //此处为省略内容
    subnet 192.168.229.0 netmask 255.255.255.0 {
         option routers             192.168.229.2; // 网关
         option domain-name-servers 114.114.114.114;  //此处为系统安装好后指定的dns地址
         option subnet-mask         255.255.255.0;
         range dynamic-bootp        192.168.229.10 192.168.229.250; // 分配网段
         default-lease-time         21600;
         max-lease-time             43200;
         next-server                $next_server;
    ....    //此处为省略内容
    
    //重启服务并同步配置,改完dhcp必须要sync同步配置
    [root@localhost ~]# systemctl restart cobblerd
    [root@localhost ~]# cobbler sync
    ...省略N 
    *** TASK COMPLETE ***  # 看到这个表示成功
    
    //检查dhcp是否正常
    [root@localhost ~]# ss -an|grep 67
    udp   UNCONN  0   0     0.0.0.0:67                 0.0.0.0:*
    udp   ESTAB   0   0   192.168.229.148%ens160:68   192.168.229.254:67
    
    
    
    
    
    
    //导入centos8镜像
    [root@localhost ~]# mount /dev/cdrom /mnt/  # 挂载
    mount: /mnt: WARNING: device write-protected, mounted read-only.
    [root@localhost ~]# df -h
    Filesystem           Size  Used Avail Use% Mounted on
    devtmpfs             874M     0  874M   0% /dev
    tmpfs                893M     0  893M   0% /dev/shm
    tmpfs                893M  8.7M  885M   1% /run
    tmpfs                893M     0  893M   0% /sys/fs/cgroup
    /dev/mapper/cs-root   17G  2.0G   16G  12% /
    /dev/sda1           1014M  215M  800M  22% /boot
    tmpfs                179M     0  179M   0% /run/user/0
    /dev/sr0              11G   11G     0 100% /mnt
    
    
    [root@localhost ~]# cobbler import --path=/mnt --name=centos8 --arch=x86_64
    .....省略N
    *** TASK COMPLETE ***
    
    //说明:
        --path      //镜像路径
        --name      //为安装源定义一个名字
        --arch      //指定安装源平台
    
    //安装源的唯一标示就是根据name参数来定义,本例导入成功后,安装源的唯一标示就是:CentOS-7-x86_64,如果重复,系统会提示导入失败
    
    
    //查看cobbler镜像列表
    [root@localhost ~]# cobbler list
    distros:
       centos8-x86_64
    
    profiles:
       centos8-x86_64
    
    systems:
    
    repos:
    
    images:
    
    mgmtclasses:
    
    packages:
    
    files:
    
    
    
    
    
    # 自动生成安装脚本
    [root@localhost ~]# cobbler profile get-autoinstall --name=centos8-x86_64
    # Sample kickstart file for current EL, Fedora based distributions.
    
    #platform=x86, AMD64, or Intel EM64T
    # System authorization information
    auth  --useshadow  --enablemd5
    # System bootloader configuration
    bootloader --location=mbr
    # Partition clearing information
    clearpart --all --initlabel
    # Use text mode install
    text
    # Firewall configuration
    firewall --enabled
    # Run the Setup Agent on first boot
    firstboot --disable
    # System keyboard
    keyboard us
    # System language
    lang en_US
    # Use network installation
    url --url=http://192.168.229.148/cblr/links/centos8-x86_64
    # If any cobbler repo definitions were referenced in the kickstart profile, include them here.
    repo --name=source-1 --baseurl=http://192.168.229.148/cobbler/distro_mirror/centos8-x86_64/AppStream
    repo --name=source-2 --baseurl=http://192.168.229.148/cobbler/distro_mirror/centos8-x86_64/BaseOS
    
    # Network information
    network --bootproto=dhcp --device=eth0 --onboot=on
    
    # Reboot after installation
    reboot
    
    #Root password
    rootpw --iscrypted $1$31746$4gpDrgEIXdIwdIUq3X3V//
    # SELinux configuration
    selinux --disabled
    # Do not configure the X Window System
    skipx
    # System timezone
    timezone  America/New_York
    # Install OS instead of upgrade
    install
    # Clear the Master Boot Record
    zerombr
    # Allow anaconda to partition the system as needed
    autopart
    
    %pre
    set -x -v
    exec 1>/tmp/ks-pre.log 2>&1
    
    # Once root's homedir is there, copy over the log.
    while : ; do
        sleep 10
        if [ -d /mnt/sysimage/root ]; then
            cp /tmp/ks-pre.log /mnt/sysimage/root/
            logger "Copied %pre section log to system"
            break
        fi
    done &
    
    
    
    # Enable installation monitoring
    
    %end
    
    %packages
    %end
    
    %post --nochroot
    set -x -v
    exec 1>/mnt/sysimage/root/ks-post-nochroot.log 2>&1
    
    %end
    
    %post
    set -x -v
    exec 1>/root/ks-post.log 2>&1
    
    # Start yum configuration
    curl "http://192.168.229.148/cblr/svc/op/yum/profile/centos8-x86_64" --output /etc/yum.repos.d/cobbler-config.repo
    
    # End yum configuration
    
    
    
    # Start post_install_network_config generated code
    # End post_install_network_config generated code
    
    # Start download cobbler managed config files (if applicable)
    # End download cobbler managed config files (if applicable)
    
    # Start koan environment setup
    echo "export COBBLER_SERVER=192.168.229.148" > /etc/profile.d/cobbler.sh
    echo "setenv COBBLER_SERVER 192.168.229.148" > /etc/profile.d/cobbler.csh
    # End koan environment setup
    
    $SNIPPET('redhat_register')
    # Begin cobbler registration
    # cobbler registration is disabled in /etc/cobbler/settings.yaml
    # End cobbler registration
    
    # Enable post-install boot notification
    
    # Start final steps
    
    curl "http://192.168.229.148/cblr/svc/op/autoinstall/profile/centos8-x86_64" -o /root/cobbler.ks
    # End final steps
    %end
    
    //把生成的自动安装脚本复制到centos8里
    [root@localhost ~]# cd /var/lib/cobbler/templates/
    [root@localhost templates]# vim centos8.ks
    ....省略N
    firewall --disabled  # 把enabled 修改为disabled
    # Run the Setup Agent on first boot
    firstboot --disable
    ...省略N
    rootpw --iscrypted $1$31746$4gpDrgEIXdIwdIUq3X3V//
    # SELinux configuration
    selinux --disabled
    # Do not configure the X Window System
    skipx
    # System timezone
    timezone  Asia/Shanghai --isUtc --nontp  # 地区改为亚洲上海
    # Install OS instead of upgrade
    install
    # Clear the Master Boot Record
    ...省略N
    %packages
    @^minimal-environment  # 这个跟系统一样,也就跟anaconda-ks.cfg 这个文件里的@^minimal-environment 一样
    %end
    ...省略N
    %end
    
    
    # 验证自动安装
    [root@localhost ~]# cobbler validate-autoinstalls
    task started: 2022-08-13_233559_validate_autoinstall_files
    task started (id=Automated installation files validation, time=Sat Aug 13 23:35:59 2022)
    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 ***
    
    
    
    
    //查看当前cobbler有哪些配置文件
    [root@localhost ~]#  cobbler profile list
       centos8-x86_64
       
    //修改profile,将我们新建的ks文件设为默认的autoinstall安装文件
    [root@localhost ~]# cobbler profile edit --name centos8-x86_64 --autoinstall=centos8.ks
    
    //配置网卡名称为传统网卡名称eth0
    [root@localhost ~]# cobbler profile edit --name centos8-x86_64 --kernel-options='net.ifnames=0 biosdevname=0'
    
    
    
    
    //检查当前系统cobbler配置文件信息
    # cobbler distro report --name=fedora17-x86_64 // 如果有多个要带上名字
    [root@localhost ~]# cobbler profile report
    Name                           : centos8-x86_64
    Automatic Installation Template : centos8.ks  
    Automatic Installation Metadata : {}
    TFTP Boot Files                : {}
    Comment                        :
    DHCP Tag                       : default
    Distribution                   : centos8-x86_64  
    Enable gPXE?                   : False
    Enable PXE Menu?               : True
    Fetchable Files                : {}
    DHCP Filename Override         : <>
    Kernel Options                 : {'net.ifnames': '0', 'biosdevname': '0'} //网卡设为传统命名方式
    Kernel Options (Post Install)  : {}
    Management Classes             : []
    Management Parameters          : <>
    Name Servers                   : []
    Name Servers Search Path       : []
    Next Server Override           : <>
    Owners                         : ['admin']
    Parent Profile                 :
    Proxy                          :
    Red Hat Management Key         : <>
    Repos                          : []
    Server Override                : <>
    Template Files                 : {}
    Virt Auto Boot                 : True
    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
    
    
    
    
    //同步cobbler
    [root@localhost ~]# cobbler sync
    ...省略N
    *** TASK COMPLETE ***
    
    
    //为避免发生未知问题,先把服务端所有服务重启
    [root@localhost ~]# systemctl restart httpd
    [root@localhost ~]# systemctl restart cobblerd.service
    [root@localhost ~]# systemctl restart rsyncd
    [root@localhost ~]# systemctl restart dhcpd
    
    [root@localhost ~]# ss -antl
    State  Recv-Q  Send-Q   Local Address:Port    Peer Address:Port Process
    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       128            0.0.0.0:22           0.0.0.0:*
    LISTEN 0       5                 [::]:873             [::]:*
    LISTEN 0       128                  *:80                 *:*
    LISTEN 0       128               [::]:22              [::]:*
    LISTEN 0       128                  *:443                *:*
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203
    • 204
    • 205
    • 206
    • 207
    • 208
    • 209
    • 210
    • 211
    • 212
    • 213
    • 214
    • 215
    • 216
    • 217
    • 218
    • 219
    • 220
    • 221
    • 222
    • 223
    • 224
    • 225
    • 226
    • 227
    • 228
    • 229
    • 230
    • 231
    • 232
    • 233
    • 234
    • 235
    • 236
    • 237
    • 238
    • 239
    • 240
    • 241
    • 242
    • 243
    • 244
    • 245
    • 246
    • 247
    • 248
    • 249
    • 250
    • 251
    • 252
    • 253
    • 254
    • 255
    • 256
    • 257
    • 258
    • 259
    • 260
    • 261
    • 262
    • 263
    • 264
    • 265
    • 266
    • 267
    • 268
    • 269
    • 270
    • 271
    • 272
    • 273
    • 274
    • 275
    • 276
    • 277
    • 278
    • 279
    • 280
    • 281
    • 282
    • 283
    • 284
    • 285
    • 286
    • 287
    • 288
    • 289
    • 290
    • 291
    • 292
    • 293
    • 294
    • 295
    • 296
    • 297
    • 298
    • 299
    • 300
    • 301
    • 302
    • 303
    • 304
    • 305
    • 306
    • 307
    • 308
    • 309
    • 310
    • 311
    • 312
    • 313
    • 314
    • 315
    • 316
    • 317
    • 318
    • 319
    • 320
    • 321
    • 322
    • 323
    • 324
    • 325
    • 326
    • 327
    • 328
    • 329
    • 330
    • 331
    • 332
    • 333
    • 334
    • 335
    • 336
    • 337
    • 338
    • 339
    • 340
    • 341
    • 342
    • 343
    • 344
    • 345
    • 346
    • 347
    • 348
    • 349
    • 350
    • 351
    • 352
    • 353
    • 354
    • 355
    • 356
    • 357
    • 358
    • 359
    • 360
    • 361
    • 362
    • 363
    • 364
    • 365
    • 366
    • 367
    • 368
    • 369
    • 370
    • 371
    • 372
    • 373
    • 374
    • 375
    • 376
    • 377
    • 378
    • 379
    • 380
    • 381
    • 382
    • 383
    • 384
    • 385
    • 386
    • 387
    • 388
    • 389
    • 390
    • 391
    • 392
    • 393
    • 394
    • 395
    • 396
    • 397
    • 398
    • 399
    • 400
    • 401
    • 402
    • 403
    • 404
    • 405
    • 406
    • 407
    • 408
    • 409
    • 410
    • 411
    • 412
    • 413
    • 414
    • 415
    • 416
    • 417
    • 418
    • 419
    • 420
    • 421
    • 422
    • 423
    • 424
    • 425
    • 426
    • 427
    • 428
    • 429
    • 430
    • 431
    • 432
    • 433
    • 434
    • 435
    • 436
    • 437
    • 438
    • 439
    • 440
    • 441
    • 442
    • 443
    • 444
    • 445
    • 446
    • 447
    • 448
    • 449
    • 450
    • 451
    • 452
    • 453
    • 454
    • 455
    • 456
    • 457
    • 458
    • 459
    • 460
    • 461
    • 462
    • 463
    • 464
    • 465
    • 466
    • 467
    • 468
    • 469
    • 470
    • 471
    • 472
    • 473
    • 474
    • 475
    • 476
    • 477
    • 478
    • 479
    • 480
    • 481
    • 482
    • 483
    • 484
    • 485
    • 486
    • 487
    • 488
    • 489
    • 490
    • 491
    • 492
    • 493
    • 494
    • 495
    • 496
    • 497
    • 498
    • 499
    • 500
    • 501
    • 502
    • 503
    • 504
    • 505
    • 506
    • 507
    • 508
    • 509
    • 510
    • 511
    • 512
    • 513
    • 514
    • 515
    • 516
    • 517
    • 518
    • 519
    • 520
    • 521
    • 522
    • 523
    • 524
    • 525

    3. 客户端安装

    新建虚拟机
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

    4. 定制安装

    定制安装步骤:

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

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

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-VIDM2Cdk-1660435082726)(../../%E5%8D%9A%E5%AE%A2/%E7%A0%B4%E8%A7%A3%E5%AF%86%E7%A0%81/1660432571099.png)]

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-7jmli26c-1660435082727)(../../%E5%8D%9A%E5%AE%A2/%E7%A0%B4%E8%A7%A3%E5%AF%86%E7%A0%81/1660432610873.png)]

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-o72R4bLG-1660435082729)(../../%E5%8D%9A%E5%AE%A2/%E7%A0%B4%E8%A7%A3%E5%AF%86%E7%A0%81/1660432936915.png)]

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-XsAXttTU-1660435082730)(../../%E5%8D%9A%E5%AE%A2/%E7%A0%B4%E8%A7%A3%E5%AF%86%E7%A0%81/1660434663887.png)]

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Yu9GG2yY-1660435082731)(../../%E5%8D%9A%E5%AE%A2/%E7%A0%B4%E8%A7%A3%E5%AF%86%E7%A0%81/1660434915142.png)]

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-eSUMF8Kn-1660435082732)(../../%E5%8D%9A%E5%AE%A2/%E7%A0%B4%E8%A7%A3%E5%AF%86%E7%A0%81/1660434973775.png)]

    同步配置并重启相关服务:

    [root@localhost ~]# cobbler sync
    [root@localhost ~]# systemctl restart httpd
    [root@localhost ~]# systemctl restart cobblerd
    • 1
    • 2

    最后开机自动会安装系统

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-V0lrpqbF-1660435082733)(../../%E5%8D%9A%E5%AE%A2/%E7%A0%B4%E8%A7%A3%E5%AF%86%E7%A0%81/1660435012505.png)]

    5.报错信息

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-sjZotfvA-1660435082735)(../../%E5%8D%9A%E5%AE%A2/%E7%A0%B4%E8%A7%A3%E5%AF%86%E7%A0%81/1660406440380.png)]

    在这里插入图片描述

  • 相关阅读:
    NLog自定义Target之MQTT
    SpringMVC学习笔记——1
    【Linux】Systemd中的 target 是什么?有什么用?如何使用?
    如何生成一个足够安全又容易记住的密码?
    AspectCore和MSDI 实现Name注册以及解析对象
    LightDB中的存储过程(八)—— 包
    一个C++基类的封装
    家用电脑可以用做服务器吗
    Docker Tutorial
    服务接口调用OpenFeign_超时机制
  • 原文地址:https://blog.csdn.net/m0_58805648/article/details/126327950