CentOS 7.4下Cobbler安装详解

系统:
[root@cobbler ~]# more /etc/RedHat-release
CentOS Linux release 7.4.1708 (Core)

一、安装基础软件:
yum -y install wget net-tools curl epel-release
更新:
yum -y update
关闭iptables与selinux:
[root@cobbler ~]# vim /etc/selinux/config
SELINUX=disabled
重启后查看:
[root@cobbler ~]# sestatus
SELinux status: disabled

二、安装基础服务:
yum -y install dhcp httpd xinetd tftp-server rsync fence-agents pykickstart
设置开机启动
systemctl enable xinetd dhcpd httpd rsyncd
systemctl start xinetd dhcpd httpd rsyncd
1、安装cobbler
[root@cobbler ~]# yum -y install cobbler-web
设置开机启动:
systemctl enable cobblerd
systemctl start cobblerd

2、效验cobbler安装条件
[root@cobbler ~]# cobbler check
The following are potential configuration items that you may want to fix:

1 : comment out ‘dists’ on /etc/debmirror.conf for proper debian support
2 : comment out ‘arches’ on /etc/debmirror.conf for proper debian support

Restart cobblerd and then run ‘cobbler sync’ to apply changes

3、随机生成一个密码
[root@cobbler ~]# openssl passwd -1 -salt “cobbler” “huangzai”
$1$cobbler$zPOuqy9SLOb87DIQb3RbQ.

4、更改cobbler配置文件
[root@cobbler ~]# vim /etc/cobbler/settings
……….
default_password_crypted: “$1$cobbler$zPOuqy9SLOb87DIQb3RbQ.” #第三步生成的密码
manage_dhcp: 1 #dhcp服务
manage_tftpd: 1 #xinetd服务
manage_rsync: 1 #rsyncd服务
next_server: 192.168.3.222 #替换成本机IP地址,dhcp服务地址
server: 192.168.3.222 #替换为本机IP地址,cobber服务地址
……….

5、更新load信息:
[root@cobbler ~]# cobbler get-loaders
task started: 2018-03-06_051434_get_loaders
task started (id=Download Bootloader Content, time=Tue Mar 6 05:14:34 2018)
downloading https://cobbler.github.io/loaders/README to /var/lib/cobbler/loaders/README
downloading https://cobbler.github.io/loaders/COPYING.elilo to /var/lib/cobbler/loaders/COPYING.elilo
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/elilo-3.8-ia64.efi to /var/lib/cobbler/loaders/elilo-ia64.efi
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

6、设置tftp配置文件,‘disable’为’no’
[root@cobbler ~]# cat /etc/xinetd.d/tftp | grep -v ‘^#’
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -B 1380 -v -s /var/lib/tftpboot
per_source = 11
cps = 100 2
flags = IPv4
}

7、修改dhcp配置文件
[root@cobbler ~]# vim /etc/cobbler/dhcp.template
ddns-update-style interim;
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
option pxe-system-type code 93 = unsigned integer 16;
subnet 192.168.3.0 netmask 255.255.255.0 {
option routers 192.168.3.222;
option domain-name-servers 202.96.209.5,202.96.209.133;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.3.60 192.168.3.100;
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
class “pxeclients” {
match if substring (option vendor-class-identifier, 0, 9) = “PXEClient”;
if option pxe-system-type = 00:02 {
filename “ia64/elilo.efi”;
} else if option pxe-system-type = 00:06 {
filename “grub/grub-x86.efi”;
} else if option pxe-system-type = 00:07 {
filename “grub/grub-x86_64.efi”;
} else if option pxe-system-type = 00:09 {
filename “grub/grub-x86_64.efi”;
} else {
filename “pxelinux.0”;
}
}

}
………

三、导入镜像进行配置
1、上传iso镜像到服务器
2、创建文件夹
mkdir -p /data/centos7.0
3、将镜像文件挂载或copy到文件夹
[root@cobbler ~]# mount /dev/cdrom /data/centos7.0/

4、把挂载光盘镜像的mnt目录中的内容导入到cobbler
[root@cobbler ~]# cobbler import –path=/data/centos7.0/ –name=cent7.0
task started: 2018-03-06_055628_import
task started (id=Media import, time=Tue Mar 6 05:56:28 2018)
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/cent7.0:
creating new distro: cent7.0-x86_64
trying symlink: /var/www/cobbler/ks_mirror/cent7.0 -> /var/www/cobbler/links/cent7.0-x86_64
creating new profile: cent7.0-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/cent7.0 for cent7.0-x86_64
processing repo at : /var/www/cobbler/ks_mirror/cent7.0
need to process repo/comps: /var/www/cobbler/ks_mirror/cent7.0
looking for /var/www/cobbler/ks_mirror/cent7.0/repodata/comps.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/cent7.0/repodata
 TASK COMPLETE

5、cobber report查看导入信息
[root@cobbler ~]# cobbler report
distros:

Name : cent7.0-x86_64
Architecture : x86_64
TFTP Boot Files : {}
Breed : redhat
Comment :
Fetchable Files : {}
Initrd : /var/www/cobbler/ks_mirror/cent7.0/images/pxeboot/initrd.img
Kernel : /var/www/cobbler/ks_mirror/cent7.0/images/pxeboot/vmlinuz
Kernel Options : {}
Kernel Options (Post Install) : {}
Kickstart Metadata : {‘tree’: ‘http://@@http_server@@/cblr/links/cent7.0-x86_64’}
Management Classes : []
OS Version : rhel7
Owners : [‘admin’]
Red Hat Management Key : <<inherit>>
Red Hat Management Server : <<inherit>>
Template Files : {}

Name : rhel7.0-x86_64
Architecture : x86_64
TFTP Boot Files : {}
Breed : redhat
Comment :
Fetchable Files : {}
Initrd : /var/www/cobbler/ks_mirror/rhel7.0/images/pxeboot/initrd.img
Kernel : /var/www/cobbler/ks_mirror/rhel7.0/images/pxeboot/vmlinuz
Kernel Options : {}
Kernel Options (Post Install) : {}
Kickstart Metadata : {‘tree’: ‘http://@@http_server@@/cblr/links/rhel7.0-x86_64’}
Management Classes : []
OS Version : rhel7
Owners : [‘admin’]
Red Hat Management Key : <<inherit>>
Red Hat Management Server : <<inherit>>
Template Files : {}

profiles:

Name : cent7.0-x86_64
TFTP Boot Files : {}
Comment :
DHCP Tag : default
Distribution : cent7.0-x86_64
Enable gPXE? : 0
Enable PXE Menu? : 1
Fetchable Files : {}
Kernel Options : {}
Kernel Options (Post Install) : {}
Kickstart : /var/lib/cobbler/kickstarts/sample_end.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

Name : rhel7.0-x86_64
TFTP Boot Files : {}
Comment :
DHCP Tag : default
Distribution : rhel7.0-x86_64
Enable gPXE? : 0
Enable PXE Menu? : 1
Fetchable Files : {}
Kernel Options : {}
Kernel Options (Post Install) : {}
Kickstart : /var/lib/cobbler/kickstarts/sample_end.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

6、查看导入列表
[root@cobbler ~]# cobbler distro list
cent7.0-x86_64
rhel7.0-x86_64

7、同步所有cobber配置
[root@cobbler ~]# cobbler sync
task started: 2018-03-06_061140_sync
task started (id=Sync, time=Tue Mar 6 06:11:40 2018)
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/images/cent7.0-x86_64
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/images/cent7.0-x86_64
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
copying: /var/lib/cobbler/loaders/pxelinux.0 -> /var/lib/tftpboot/pxelinux.0
copying: /var/lib/cobbler/loaders/menu.c32 -> /var/lib/tftpboot/menu.c32
copying: /var/lib/cobbler/loaders/yaboot -> /var/lib/tftpboot/yaboot
copying: /usr/share/syslinux/memdisk -> /var/lib/tftpboot/memdisk
copying: /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
copying: /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
copying distros to tftpboot
copying files for distro: cent7.0-x86_64
trying hardlink /var/www/cobbler/ks_mirror/cent7.0/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/cent7.0-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/cent7.0/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/cent7.0-x86_64/initrd.img
copying images
generating PXE configuration files
generating PXE menu structure
copying files for distro: cent7.0-x86_64
trying hardlink /var/www/cobbler/ks_mirror/cent7.0/images/pxeboot/vmlinuz -> /var/www/cobbler/images/cent7.0-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/cent7.0/images/pxeboot/initrd.img -> /var/www/cobbler/images/cent7.0-x86_64/initrd.img
Writing template files for cent7.0-x86_64
rendering TFTPD files
generating /etc/xinetd.d/tftp
processing boot_files for distro: cent7.0-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 shell triggers from /var/lib/cobbler/triggers/sync/post/
running python triggers from /var/lib/cobbler/triggers/change/
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/
 TASK COMPLETE

8、重启所有服务

9、安装成功,客户端启动:

10、修改cobber登录密码:
[root@cobbler ~]# htdigest /etc/cobbler/users.digest “Cobbler” cobbler
Changing password for user cobbler in realm Cobbler
New password:
Re-type new password:

11、打开cobber web

cobblerd启动报错
[root@cobbler conf.d]# systemctl status cobblerd
● cobblerd.service – Cobbler Helper Daemon
Loaded: loaded (/usr/lib/systemd/system/cobblerd.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Mon 2018-03-12 07:09:51 EDT; 18s ago
Process: 1644 ExecStartPost=/usr/bin/touch /usr/share/cobbler/web/cobbler.wsgi (code=exited, status=0/SUCCESS)
Process: 1643 ExecStart=/usr/bin/cobblerd -F (code=exited, status=0/SUCCESS)
Main PID: 1643 (code=exited, status=0/SUCCESS)

Mar 12 07:09:51 cobbler cobblerd[1643]: Traceback (most recent call last):
Mar 12 07:09:51 cobbler cobblerd[1643]: File “/usr/bin/cobblerd”, line 75, in main
Mar 12 07:09:51 cobbler cobblerd[1643]: api = cobbler_api.BootAPI(is_cobblerd=True)
Mar 12 07:09:51 cobbler cobblerd[1643]: File “/usr/lib/python2.7/site-packages/cobbler/api.py”, …it__
Mar 12 07:09:51 cobbler cobblerd[1643]: “authn_configfile”
Mar 12 07:09:51 cobbler cobblerd[1643]: File “/usr/lib/python2.7/site-packages/cobbler/api.py”, …file
Mar 12 07:09:51 cobbler cobblerd[1643]: return module_loader.get_module_from_file(section,name,f…ack)
Mar 12 07:09:51 cobbler cobblerd[1643]: File “/usr/lib/python2.7/site-packages/cobbler/modulelo…file
Mar 12 07:09:51 cobbler cobblerd[1643]: raise CX((“Failed to load module for %s/%s”) % (categor…ld))
Mar 12 07:09:51 cobbler cobblerd[1643]: CX: ‘Failed to load module for authentication/module’
Hint: Some lines were ellipsized, use -l to show in full.
解决方法:
[root@cobbler ~]# vim /etc/cobbler/modules.conf
[authentication]
module = authn_configfile
重启cobber服务
systemctl restart cobblerd

效验报错:
[root@cobbler ~]# cobbler check
httpd does not appear to be running and proxying cobbler, or SELinux is in the way. Original traceback:
Traceback (most recent call last):
File “/usr/lib/python2.7/site-packages/cobbler/cli.py”, line 251, in check_setup
s.ping()
File “/usr/lib64/python2.7/xmlrpclib.py”, line 1233, in call
return self.send(self.name, args)
File “/usr/lib64/python2.7/xmlrpclib.py”, line 1587, in request
verbose=self.verbose
File “/usr/lib64/python2.7/xmlrpclib.py”, line 1273, in request
return self.single_request(host, handler, request_body, verbose)
File “/usr/lib64/python2.7/xmlrpclib.py”, line 1321, in single_request
response.msg,
ProtocolError: <ProtocolError for 127.0.0.1:80/cobbler_api: 503 Service Unavailable>

解决方法:
关闭selinux:
[root@cobbler ~]# vim /etc/selinux/config
SELINUX=disabled
重启服务器

文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/222306.html<

(0)
运维的头像运维
上一篇2025-04-15 10:43
下一篇 2025-04-15 10:44

相关推荐

  • 个人主题怎么制作?

    制作个人主题是一个将个人风格、兴趣或专业领域转化为视觉化或结构化内容的过程,无论是用于个人博客、作品集、社交媒体账号还是品牌形象,核心都是围绕“个人特色”展开,以下从定位、内容规划、视觉设计、技术实现四个维度,详细拆解制作个人主题的完整流程,明确主题定位:找到个人特色的核心主题定位是所有工作的起点,需要先回答……

    2025-11-20
    0
  • 社群营销管理关键是什么?

    社群营销的核心在于通过建立有温度、有价值、有归属感的社群,实现用户留存、转化和品牌传播,其管理需贯穿“目标定位-内容运营-用户互动-数据驱动-风险控制”全流程,以下从五个维度展开详细说明:明确社群定位与目标社群管理的首要任务是精准定位,需明确社群的核心价值(如行业交流、产品使用指导、兴趣分享等)、目标用户画像……

    2025-11-20
    0
  • 香港公司网站备案需要什么材料?

    香港公司进行网站备案是一个涉及多部门协调、流程相对严谨的过程,尤其需兼顾中国内地与香港两地的监管要求,由于香港公司注册地与中国内地不同,其网站若主要服务内地用户或使用内地服务器,需根据服务器位置、网站内容性质等,选择对应的备案路径(如工信部ICP备案或公安备案),以下从备案主体资格、流程步骤、材料准备、注意事项……

    2025-11-20
    0
  • 如何企业上云推广

    企业上云已成为数字化转型的核心战略,但推广过程中需结合行业特性、企业痛点与市场需求,构建系统性、多维度的推广体系,以下从市场定位、策略设计、执行落地及效果优化四个维度,详细拆解企业上云推广的实践路径,精准定位:明确目标企业与核心价值企业上云并非“一刀切”的方案,需先锁定目标客户群体,提炼差异化价值主张,客户分层……

    2025-11-20
    0
  • PS设计搜索框的实用技巧有哪些?

    在PS中设计一个美观且功能性的搜索框需要结合创意构思、视觉设计和用户体验考量,以下从设计思路、制作步骤、细节优化及交互预览等方面详细说明,帮助打造符合需求的搜索框,设计前的规划明确使用场景:根据网站或APP的整体风格确定搜索框的调性,例如极简风适合细线条和纯色,科技感适合渐变和发光效果,电商类则可能需要突出搜索……

    2025-11-20
    0

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注