使用cobbler 安装工具批量安装服务器

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

Cobbler简介



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


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


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


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


Cobbler官网



http://cobbler. github.io/


cobbler集成的服务



  • PXE服务支持


  • DHCP服务管理


  • DNS服务管理(可选bind,dnsmasq)


  • 电源管理


  • Kickstart服务支持


  • YUM仓库管理


  • TFTP(PXE启动时需要)


  • Apache(提供kickstart的安装源,并提供定制化的kickstart配置)


cobbler配置文件详解



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


image.png


cobbler数据目录



image.png


cobbler日志文件



image.png


cobbler命令详解


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


cobbler服务端部署



配置yum源(网络源)


[root@localhost ~]#  curl -o /etc/yum.repos.d/CentOS7-Base-163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1572  100  1572    0     0   2687      0 --:--:-- --:--:-- --:--:--  2691
[root@localhost ~]# ls /etc/yum.repos.d/
CentOS7-Base-163.repo  redhat.repo  xx.repo
[root@localhost ~]# sed -i 's/\$releasever/7/g' /etc/yum.repos.d/CentOS7-Base
[root@localhost ~]# sed -i 's/^enabled=.*/enabled=1/g' /etc/yum.repos.d/CentOS7-Base-163.repo


  • 安装epel-release源


[root@localhost ~]# yum -y install epel-release
已加载插件:product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
base                                                 | 3.6 kB     00:00     
centosplus                                           | 3.4 kB     00:00     
extras                                               | 3.4 kB     00:00 
……
安装过程省略


安装cobbler以及相关的软件


[root@localhost ~]# yum -y install httpd dhcp tftp python-ctypes cobbler  xinetd cobbler-web pykickstart
已加载插件:product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
安装过程省略
……


启动服务并设置开机自启


[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl start cobblerd
[root@localhost ~]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@localhost ~]# systemctl enable cobblerd
Created symlink from /etc/systemd/system/multi-user.target.wants/cobblerd.service to /usr/lib/systemd/system/cobblerd.service.


  • 修改server的ip、tfftp地址为本机ip


[root@localhost ~]# vim /etc/cobbler/settings 
[root@localhost ~]# 
[root@localhost ~]# sed -i 's/^server: 127.0.0.1/server: 192.168.170.14/' /etc/cobbler/settings
[root@localhost ~]# sed -i 's/^next_server: 127.0.0.1/next_server:  192.168.170.14/' /etc/cobbler/settings


  • 下载确实文件


[root@localhost ~]#  cobbler sync
task started: 2019-08-29_172318_sync
task started (id=Sync, time=Thu Aug 29 17:23:18 2019)
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/images/rhel-7-x86_64
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/grub-x86.efi
removing: /var/lib/tftpboot/grub/grub-x86_64.efi
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/images/rhel-7-x86_64
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
copying distros to tftpboot
copying files for distro: rhel-7-x86_64
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/rhel-7-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/rhel-7-x86_64/initrd.img
copying images
generating PXE configuration files
generating PXE menu structure
copying files for distro: rhel-7-x86_64
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/vmlinuz -> /var/www/cobbler/images/rhel-7-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/initrd.img -> /var/www/cobbler/images/rhel-7-x86_64/initrd.img
Writing template files for rhel-7-x86_64
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
rendering TFTPD files
generating /etc/xinetd.d/tftp
processing boot_files for distro: rhel-7-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.service
running shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.manage_genders
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***


  • 启动rsync并设置开机自启


[root@localhost ~]# systemctl restart xinetd
[root@localhost ~]# systemctl restart cobblerd
[root@localhost ~]# systemctl restart httpd
[root@localhost ~]# ss -antl
State       Recv-Q Send-Q Local Address:Port               Peer Address:Port              
LISTEN      0      128      *:22                   *:*                  
LISTEN      0      100    127.0.0.1:25                   *:*                  
LISTEN      0      5      127.0.0.1:25151                *:*                  
LISTEN      0      5        *:873                  *:*                  
LISTEN      0      128     :::80                  :::*                  
LISTEN      0      128     :::22                  :::*                  
LISTEN      0      100    ::1:25                  :::*                  
LISTEN      0      128     :::443                 :::*                  
LISTEN      0      5       :::873                 :::*  


  • 生成加密的密码


[root@localhost ~]#  openssl passwd -1 -salt "$RANDOM" '123456'
$1$4083$9jFt/kdeFNmOe4QlSuV4D.


  • 将新生成的加密密码加入到配置文件


[root@localhost ~]# vim /etc/cobbler/settings
....    //此处为省略内容
default_password_crypted: "$1$28958$sq1sJFDX0bZo.H8Q.8NLg0"
.....   //此处为省略内容


  • 重启cobbler


[root@localhost ~]# systemctl restart cobblerd
[root@localhost ~]# ss -antl
State       Recv-Q Send-Q      Local Address:Port                     Peer Address:Port
LISTEN      0      128                     *:22                                  *:*
LISTEN      0      100             127.0.0.1:25                                  *:*
LISTEN      0      5               127.0.0.1:25151                               *:*
LISTEN      0      5                       *:873                                 *:*
LISTEN      0      128                    :::80                                 :::*
LISTEN      0      128                    :::22                                 :::*
LISTEN      0      100                   ::1:25                                 :::*
LISTEN      0      128                    :::443                                :::*
LISTEN      0      5                      :::873                                :::*


  • 通过cobbler check核对当前设置是否有问题


[root@localhost ~]# 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 them
以上两个是关于debian系统的错误,请忽略


  • 配置cobbler dhcp


  • 修改cobbler配置文件,让cobbler控制dhcp


[root@localhost ~]# vim /etc/cobbler/dhcp.template
....    //此处为省略内容
subnet 192.168.170.0 netmask 255.255.255.0 {
     option routers             192.168.170.2;         //服务器端的网关
     option domain-name-servers 8.8.8.8;        //此处为系统安装好后指定的dns地址
     option subnet-mask         255.255.255.0;
     range dynamic-bootp      192.168.170.100 192.168.170.200;  分配的地址池
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                $next_server; 
....    //此处为省略内容


  • 重启服务并同步配置,改完dhcp必须要sync同步配置


[root@localhost ~]# cobbler sync
task started: 2019-08-29_184616_sync
task started (id=Sync, time=Thu Aug 29 18:46:16 2019)
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/images/rhel-7-x86_64
removing: /var/lib/tftpboot/pxelinux.cfg/01-00-50-56-27-5d-16
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/pxelinux.cfg/01-00-50-56-3a-17-d2
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/grub-x86.efi
removing: /var/lib/tftpboot/grub/grub-x86_64.efi
removing: /var/lib/tftpboot/grub/01-00-50-56-27-5D-16
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/grub/01-00-50-56-3A-17-D2
removing: /var/lib/tftpboot/images/rhel-7-x86_64
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
copying distros to tftpboot
copying files for distro: rhel-7-x86_64
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/rhel-7-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/rhel-7-x86_64/initrd.img
copying images
generating PXE configuration files
generating: /var/lib/tftpboot/pxelinux.cfg/01-00-50-56-3a-17-d2
generating: /var/lib/tftpboot/grub/01-00-50-56-3A-17-D2
generating PXE menu structure
copying files for distro: rhel-7-x86_64
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/vmlinuz -> /var/www/cobbler/images/rhel-7-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/initrd.img -> /var/www/cobbler/images/rhel-7-x86_64/initrd.img
Writing template files for rhel-7-x86_64
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
rendering TFTPD files
generating /etc/xinetd.d/tftp
processing boot_files for distro: rhel-7-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.service
running shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.manage_genders
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***


  • 检查dhcp是否正常


[root@localhost ~]# netstat -anulp|grep dhcp
udp        0      0 0.0.0.0:67              0.0.0.0:*                           12692/dhcpd 


  • 导入redhat7镜像


[root@localhost ~]# mount /dev/cdrom /mnt/cdrom/
mount: /dev/sr0 写保护,将以只读方式挂载
[root@localhost ~]# cobbler import --path=/mnt/cdrom --name=rhel-7 arch=x86_64
task started: 2019-08-29_171616_import
task started (id=Media import, time=Thu Aug 29 17:16:16 2019)
Found a candidate signature: breed=redhat, version=rhel6
Found a candidate signature: breed=redhat, version=rhel7
Found a matching signature: breed=redhat, version=rhel7
Adding distros from path /var/www/cobbler/ks_mirror/rhel-7:
creating new distro: rhel-7-x86_64
trying symlink: /var/www/cobbler/ks_mirror/rhel-7 -> /var/www/cobbler/links/rhel-7-x86_64
creating new profile: rhel-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/ks_mirror/rhel-7 for rhel-7-x86_64
processing repo at : /var/www/cobbler/ks_mirror/rhel-7
need to process repo/comps: /var/www/cobbler/ks_mirror/rhel-7
looking for /var/www/cobbler/ks_mirror/rhel-7/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/rhel-7/repodata
processing repo at : /var/www/cobbler/ks_mirror/rhel-7/addons/HighAvailability
need to process repo/comps: /var/www/cobbler/ks_mirror/rhel-7/addons/HighAvailability
looking for /var/www/cobbler/ks_mirror/rhel-7/addons/HighAvailability/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/rhel-7/addons/HighAvailability/repodata
processing repo at : /var/www/cobbler/ks_mirror/rhel-7/addons/ResilientStorage
need to process repo/comps: /var/www/cobbler/ks_mirror/rhel-7/addons/ResilientStorage
looking for /var/www/cobbler/ks_mirror/rhel-7/addons/ResilientStorage/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/rhel-7/addons/ResilientStorage/repodata
*** TASK COMPLETE ***
//说明:
    --path      //镜像路径
    --name      //为安装源定义一个名字
    --arch      //指定安装源平台
安装源的唯一标示就是根据name参数来定义,本例导入成功后,安装源的唯一标示就是:CentOS-7-x86_64,如果重复,系统会提示导入失败


  • 查看cobbler镜像列表


[root@localhost ~]# cobbler list
distros:
   rhel-7-x86_64
profiles:
   rhel-7-x86_64
systems:
repos:
images:
mgmtclasses:
packages:
files:


  • 创建kickstarts自动安装脚本


[root@localhost ~]# cat > /var/lib/cobbler/kickstarts/rhel-7-x86_64.ks <<'EOF'
> 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://172.16.12.128/cobbler/ks_mirror/rhel-7-x86_64
> $yum_repo_stanza
> reboot
> 
> rootpw --iscrypted $6$2WTFvfNvAMgCUPuC$MJgWGzhakgxrRObcEbAwSe8vkz0s//xyiTllGwxRsHHruQhcskO69u2LVTU9u0eemHXH2pzcGawyAJ54R2E/x0
> 
> 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
> %end
> EOF
[root@localhost ~]# 
[root@localhost ~]# vim /var/lib/cobbler/kickstarts/rhel-7-x86_64.ks 
[root@localhost ~]# cobbler validateks
task started: 2019-08-29_172202_validateks
task started (id=Kickstart Validation, time=Thu Aug 29 17:22:02 2019)
----------------------------
osversion: rhel7
checking url: http://192.168.170.14/cblr/svc/op/ks/profile/rhel-7-x86_64
running: /usr/bin/ksvalidator -v "rhel7" "http://192.168.170.14/cblr/svc/op/ks/profile/rhel-7-x86_64"
received on stdout: 
received on stderr: 
*** all kickstarts seem to be ok ***
*** TASK COMPLETE ***


  • 检查ks文件语法是否有误


[root@localhost ~]# cobbler profile list
   rhel-7-x86_64
[root@localhost ~]# cobbler profile edit --name rhel-7-x86_64 --kickstart=/var/lib/cobbler/kickstarts/rhel-7-x86_64.ks
[root@localhost ~]#  cobbler profile edit --name rhel-7-x86_64 --kopts='net.ifnames=0 biosdevname=0'
[root@localhost ~]#  cobbler profile report
Name                           : rhel-7-x86_64
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : rhel-7-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
Kernel Options                 : {'biosdevname': '0', 'net.ifnames': '0'}
Kernel Options (Post Install)  : {}
Kickstart                      : /var/lib/cobbler/kickstarts/rhel-7-x86_64.ks
Kickstart Metadata             : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Owners                         : ['admin']
Parent Profile                 : 
Internal proxy                 : 
Red Hat Management Key         : <<inherit>>
Red Hat Management Server      : <<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


  • 查看当前cobbler有哪些配置文件


[root@localhost ~]# cobbler profile list
 Centos-7-x86_64


  • 修改profile,将我们新建的ks文件设为默认的kickstarts安装文件


[root@localhost ~]# cobbler profile edit --name rhel-7-x86_64 --kickstart=/var/lib/cobbler/kickstarts/rhel-7-x86_64.ks


  • 配置网卡名称为传统网卡名称eth0


[root@localhost ~]# cobbler profile edit --name rhel-7-x86_64 --kopts='net.ifnames=0 biosdevname=0'


  • 检查当前系统cobbler配置文件信息


[root@localhost ~]#  cobbler profile report
Name                           : rhel-7-x86_64
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : rhel-7-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
Kernel Options                 : {'biosdevname': '0', 'net.ifnames': '0'}
Kernel Options (Post Install)  : {}
Kickstart                      : /var/lib/cobbler/kickstarts/rhel-7-x86_64.ks
Kickstart Metadata             : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Owners                         : ['admin']
Parent Profile                 : 
Internal proxy                 : 
Red Hat Management Key         : <<inherit>>
Red Hat Management Server      : <<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


  • 同步cobbler


[root@localhost ~]#  cobbler sync
task started: 2019-08-29_172318_sync
task started (id=Sync, time=Thu Aug 29 17:23:18 2019)
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/images/rhel-7-x86_64
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/grub-x86.efi
removing: /var/lib/tftpboot/grub/grub-x86_64.efi
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/images/rhel-7-x86_64
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
copying distros to tftpboot
copying files for distro: rhel-7-x86_64
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/rhel-7-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/rhel-7-x86_64/initrd.img
copying images
generating PXE configuration files
generating PXE menu structure
copying files for distro: rhel-7-x86_64
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/vmlinuz -> /var/www/cobbler/images/rhel-7-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/initrd.img -> /var/www/cobbler/images/rhel-7-x86_64/initrd.img
Writing template files for rhel-7-x86_64
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
rendering TFTPD files
generating /etc/xinetd.d/tftp
processing boot_files for distro: rhel-7-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.service
running shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.manage_genders
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***


  • 为避免发生未知问题,先把服务端所有服务重启


[root@localhost ~]# systemctl restart xinetd
[root@localhost ~]# systemctl restart cobblerd
[root@localhost ~]# systemctl restart httpd
[root@localhost ~]# ss -antl
State       Recv-Q Send-Q Local Address:Port               Peer Address:Port              
LISTEN      0      128      *:22                   *:*                  
LISTEN      0      100    127.0.0.1:25                   *:*                  
LISTEN      0      5      127.0.0.1:25151                *:*                  
LISTEN      0      5        *:873                  *:*                  
LISTEN      0      128     :::80                  :::*                  
LISTEN      0      128     :::22                  :::*                  
LISTEN      0      100    ::1:25                  :::*                  
LISTEN      0      128     :::443                 :::*                  
LISTEN      0      5       :::873                 :::*       


客户端安装系统:



手动验证


创建一个虚拟机,模式和服务端模式一样,(这里我使用的是nat,所以要安装的虚拟机模式也是nat),然后设置,


image.png


然后,直接开启虚拟机,看到以下界面,,手动配置成功


image.png


ok!这样效果是出来了,但是,还是需要手动选择,如果机器太多,每台服务器都要选择,还是很麻烦,所以采用web界面配置


定制安装



定制安装步骤:


  • 统计服务器mac地址


  • 配置cobbler


  • 安装


  • 把所有用到的服务启动起来


[root@cobbler ~]# systemctl restart cobblerd httpd tftp rsyncd
这里不用启动dhcpd是因为已经被cobbler接管了


访问测试 https://IP/cobbler_web报错


500 nternal Server Error


  • 检查


[root@localhost ~]# tail -f  /var/log/httpd/ssl_error_log 
[Wed Aug 14 21:49:53.984939 2019] [:error] [pid 5496] [remote 10.0.0.1:4]     self._setup(name)
[Wed Aug 14 21:49:53.984943 2019] [:error] [pid 5496] [remote 10.0.0.1:4]   File "/usr/lib/python2.7/site-packages/django/conf/__init__.py", line 41, in _setup
[Wed Aug 14 21:49:53.984948 2019] [:error] [pid 5496] [remote 10.0.0.1:4]     self._wrapped = Settings(settings_module)
[Wed Aug 14 21:49:53.984952 2019] [:error] [pid 5496] [remote 10.0.0.1:4]   File "/usr/lib/python2.7/site-packages/django/conf/__init__.py", line 110, in __init__
[Wed Aug 14 21:49:53.984957 2019] [:error] [pid 5496] [remote 10.0.0.1:4]     mod = importlib.import_module(self.SETTINGS_MODULE)
[Wed Aug 14 21:49:53.984961 2019] [:error] [pid 5496] [remote 10.0.0.1:4]   File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
[Wed Aug 14 21:49:53.984968 2019] [:error] [pid 5496] [remote 10.0.0.1:4]     __import__(name)
[Wed Aug 14 21:49:53.984972 2019] [:error] [pid 5496] [remote 10.0.0.1:4]   File "/usr/share/cobbler/web/settings.py", line 89, in <module>
[Wed Aug 14 21:49:53.984978 2019] [:error] [pid 5496] [remote 10.0.0.1:4]     from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
[Wed Aug 14 21:49:53.984988 2019] [:error] [pid 5496] [remote 10.0.0.1:4] ImportError: cannot import name TEMPLATE_CONTEXT_PROCESSORS


  • 猜测python-django版本有问题: https:/lgithub.com/cobblerlcobblerlissues/1959(可以去下载这个版本)


  • 安装新的python-django版本


[root@localhost ~]# yum -y install python2-pip
[root@localhost ~]#  pip install --upgrade pip
[root@localhost ~]# pip install Django==1.9.13
#用pip安装指定版本的Django


再次访问: https://192.168.170.14/cobbler_web


  • 在cobbler 的web界面上配置:


image.png


配在cobbler 的web界面上配置:


  • 创建—个虚拟机


image.png


  • 设置虚拟机


image.png


  • 编辑网卡、mac


image.png


这里的mac是你想装系统的mac


  • 测试


image.png


ok!

相关文章
|
1月前
|
监控 虚拟化 云计算
从物理到云:使用自动化工具简化服务器迁移流程
【10月更文挑战第4天】随着云计算的快速发展,越来越多的企业选择将物理服务器迁移到云环境以提高效率和降低成本。本文详细介绍了使用自动化工具简化从物理到云的服务器迁移流程的技术实现细节,并提供了代码示例。
120 6
|
5天前
|
Ubuntu 网络协议 关系型数据库
超聚变服务器2288H V6使用 iBMC 安装 Ubuntu Server 24.04 LTS及后续系统配置
【11月更文挑战第15天】本文档详细介绍了如何使用iBMC在超聚变服务器2288H V6上安装Ubuntu Server 24.04 LTS,包括连接iBMC管理口、登录iBMC管理界面、配置RAID、安装系统以及后续系统配置等步骤。
|
1月前
|
监控 Java Linux
Linux系统之安装Ward服务器监控工具
【10月更文挑战第17天】Linux系统之安装Ward服务器监控工具
55 5
Linux系统之安装Ward服务器监控工具
|
24天前
|
监控 Kubernetes 安全
如何设置一个有效的远程管理工具来简化服务器的维护工作?
如何设置一个有效的远程管理工具来简化服务器的维护工作?
|
1月前
|
人工智能 安全 大数据
ARM 服务器上安装 OpenEuler (欧拉)
openEuler 是华为于2019年开源的操作系统,支持多种处理器架构,包括X86和鲲鹏。截至2020年底,openEuler 拥有3万社区用户、2万多个拉取请求、2000多名贡献者和7032款软件。openEuler 提供高效、稳定、安全的系统,适用于数据库、大数据、云计算和人工智能等场景。本文介绍了在神州鲲泰 R522 服务器上安装 openEuler 的详细步骤,包括下载镜像、配置 RAID 和 BIOS 设置等。
211 0
ARM 服务器上安装 OpenEuler (欧拉)
|
1月前
|
Ubuntu TensorFlow 算法框架/工具
NVIDIA Triton系列05-安装服务器软件
本文介绍了NVIDIA Triton推理服务器的安装方法,涵盖源代码编译、可执行文件安装及Docker容器部署三种方式。重点讲解了在NVIDIA Jetson AGX Orin设备上的安装步骤,适合Ubuntu 18及以上系统。通过检查HTTP端口状态确认服务器运行正常,为后续客户端软件安装做准备。
46 0
NVIDIA Triton系列05-安装服务器软件
|
1月前
|
SQL 分布式计算 关系型数据库
Hadoop-21 Sqoop 数据迁移工具 简介与环境配置 云服务器 ETL工具 MySQL与Hive数据互相迁移 导入导出
Hadoop-21 Sqoop 数据迁移工具 简介与环境配置 云服务器 ETL工具 MySQL与Hive数据互相迁移 导入导出
53 3
|
1月前
|
Ubuntu 安全 Linux
云服务器安装宝塔教程
云服务器安装宝塔教程
|
1月前
|
弹性计算 应用服务中间件 网络安全
ECS服务器使用:SSL证书安装、配置和问题定位指南
本文简要介绍了SSL证书的生成与部署方法,包括使用OpenSSL生成自签名证书和从CA获取证书的步骤,以及在Apache和Nginx服务器上的配置方法。此外,还提供了测试证书是否生效的方法和常见问题的解决策略,帮助确保证书正确安装并解决调试过程中可能遇到的问题。
149 0
|
1月前
|
域名解析 安全 网络安全
阿里云服务器WordPress环境上安装SSL证书
阿里云服务器WordPress环境上安装SSL证书
下一篇
无影云桌面