cobbler自动化安装系统

简介: 笔者Q:972581034 交流群:605799367。有任何疑问可与笔者或加群交流在很久很久以前,使用kickstart实现自动化安装的时候,我一直认为装系统是多么高大上的活,直到cobbler的出现,让自动化批量安装系统变得如此简单。

笔者Q:972581034 交流群:605799367。有任何疑问可与笔者或加群交流

  • 在很久很久以前,使用kickstart实现自动化安装的时候,我一直认为装系统是多么高大上的活,直到cobbler的出现,让自动化批量安装系统变得如此简单。嘿嘿。现在隔壁办公室的财务妹妹都跟我学会了装系统。
  • cobbler是基于kickstart来实现自动化安装系统的,cobbler实质是把kickstart经过封装后,以web界面的方式,可以让我们以简单粗暴的方式自定义自已的系统。

安装cobbler

命令行的操作

需要epel源

yum -y install cobbler cobbler-web dhcp tftp-server pykickstart httpd
[root@CentOS6 ~]# cobbler check   #检查还有哪些步骤需要做
The following are potential configuration items that you may want to fix:

1 : The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work.  This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.    #设置server端Ip地址
2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 128.0.0.1, and should match the IP of the boot server on the PXE network.   #PXE设置
3 : change 'disable' to 'no' in /etc/xinetd.d/tftp  #把disable改为no
4 : some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to download them, or, 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, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements.  #需要下载,运行cobbler get-loaders即可
5 : change 'disable' to 'no' in /etc/xinetd.d/rsync  #disable改为no
6 : file /etc/xinetd.d/rsync does not exist  #没有这个文件
7 : debmirror package is not installed, it will be required to manage debian deployments and repositories  #可忽略
8 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one  #提示需要修改root密码
9 : 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.


cp /etc/cobbler/settings{,.ori} #备份
sed -i 's/server: 127.0.0.1/server: 172.16.1.101/' /etc/cobbler/settings #解决第一项
sed -i 's/next_server: 127.0.0.1/next_server: 172.16.1.101/' /etc/cobbler/settings #
sed -i 's/manage_dhcp: 0/manage_dhcp: 1/' /etc/cobbler/settings #让cobbler管理dhcp服务
sed -i 's/pxe_just_once: 0/pxe_just_once: 1/' /etc/cobbler/settings #禁止无限重装统
sed -ri "/default_password_crypted/s#(.: ).#\1"`openssl passwd -1 -salt 'oldboy' '123456'`"#" /etc/cobbler/settings #设置密码内嵌命令openssl passwd -1 -salt 'oldboy' '123456'
sed -i 's#yes#no#' /etc/xinetd.d/rsync #把所有yes改为no
sed -i 's#yes#no#' /etc/xinetd.d/tftp #把yes改为no


把下载好的命令传过来解压,由于从官方下载太慢,所以这里使用下载好的直接解压
[root@CentOS6 ~]# rz -E
rz waiting to receive.
[root@CentOS6 ~]# ls
anaconda-ks.cfg  cobbler_load.tar.gz  install.log  install.log.syslog
[root@CentOS6 ~]# tar xfP cobbler_load.tar.gz

[root@CentOS6 ~]# cobbler sync
task started: 2017-04-12_172139_sync
task started (id=Sync, time=Wed Apr 12 17:21:39 2017)
running pre-sync triggers
cleaning trees
removing: /var/lib/tftpboot/grub/images
copying bootloaders
trying hardlink /var/lib/cobbler/loaders/pxelinux.0 -> /var/lib/tftpboot/pxelinux.0
trying hardlink /var/lib/cobbler/loaders/menu.c32 -> /var/lib/tftpboot/menu.c32
trying hardlink /var/lib/cobbler/loaders/yaboot -> /var/lib/tftpboot/yaboot
trying hardlink /usr/share/syslinux/memdisk -> /var/lib/tftpboot/memdisk
trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
copying distros to tftpboot
copying images
generating PXE configuration files
generating PXE menu structure
rendering TFTPD files
generating /etc/xinetd.d/tftp
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 ***

[root@CentOS6 ~]# /etc/init.d/xinetd restart
Stopping xinetd:                                           [FAILED]
Starting xinetd:                                           [  OK  ]
[root@CentOS6 ~]# /etc/init.d/cobblerd restart
Stopping cobbler daemon:                                   [  OK  ]
Starting cobbler daemon:                                   [  OK  ]
[root@CentOS6 ~]# /etc/init.d/httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd: httpd: apr_sockaddr_info_get() failed for CentOS6
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
                                                           [  OK  ]
sed -i 's#192.168.1#172.16.1#g;22d;23d' /etc/cobbler/dhcp.template   #修改DHCP模版,删除网关,删除DNS

检查cobbler

现在只有三处错误了,可以忽略
[root@CentOS6 ~]# cobbler check
The following are potential configuration items that you may want to fix:

1 : file /etc/xinetd.d/rsync does not exist #这个是程序bug
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.

检查端口

[root@CentOS6 ~]# ss -luntp|grep dhcp
[root@CentOS6 ~]# cobbler sync #把所有更改做同步

注意:一个局域网只能有一个dhcp

挂载

[root@CentOS6 ~]# mount /dev/cdrom /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only

接下来进行web界面的操作
在浏览器输入http://ip/cobbler_web即可访问

web界面

1.导入镜像

  • 挂载
    img_a50f87a1e8fc8df397a0e7ca9619b0dd.jpg

    [root@CentOS6 ~]# mount /dev/cdrom /mnt
    mount: block device /dev/sr0 is write-protected, mounting read-only
    [root@CentOS6 ~]# ps -ef|grep rsync      #通过rsync进行导入的
    root      25266   1582 15 17:30 ?        00:00:06 rsync -a /mnt/ /var/www/cobbler/ks_mirror/CentOS6.8-x86_64 --progress
    root      25267  25266  0 17:30 ?        00:00:00 rsync -a /mnt/ /var/www/cobbler/ks_mirror/CentOS6.8-x86_64 --progress
    root      25268  25267 11 17:30 ?        00:00:05 rsync -a /mnt/ /var/www/cobbler/ks_mirror/CentOS6.8-x86_64 --progress

    img_152f07d76aea92f221fc81edec86adbe.jpg

2.如何让cobbler下载yum源

  • 导入yum源

img_565d272ccd667d6c6f473e02f1f46b00.jpg

img_bf6be2bb67ec91ebe170946fc5161d4c.jpg


[root@CentOS6 ~]# cd /var/www/cobbler/repo_mirror/
[root@CentOS6 repo_mirror]# ls
oldboyedu
  • 使用公网yum源的方法
    img_a57255562c12ea1e4b6ad3d1e8e9166d.png

  • 装系统的时候关联到本地yum源
    img_f2107b12b5d147df7813c142954a9bcb.jpg

    到这一步即可完成以默认的方式安装系统

  • 自定义模版

    1.创建模版文件

    img_02700dbb0d9d36aa630d35438365c6d1.jpg
    img_727bde73068b2233c1dce8eef0b04a6f.jpg

2.创建自定义模版

img_ca3e7a35896241a7234775094905b2bf.jpg

img_a10c77250e0f7c9f2637a872c73cc801.jpg
img_a480ed2fb0f1bb110ddaea6a17654ecb.jpg

img_01ab341dfc26e74c8e9bb4a93a0dd2ad.jpg

img_b6e3db83fca5742242a5b276cbf367ad.jpg

3.同步实据到服务器端
  • 开机后就可以喝咖啡了

img_e0e5d1751ea5822677c8e45fd078178b.jpg

kickstart无人值守:http://www.cnblogs.com/Csir/p/6699881.html

目录
相关文章
|
6天前
|
安全 Linux iOS开发
Nessus Professional 10.10 Auto Installer for RHEL 10, AlmaLinux 10, Rocky Linux 10 - Nessus 自动化安装程序
Nessus Professional 10.10 Auto Installer for RHEL 10, AlmaLinux 10, Rocky Linux 10 - Nessus 自动化安装程序
54 6
Nessus Professional 10.10 Auto Installer for RHEL 10, AlmaLinux 10, Rocky Linux 10 - Nessus 自动化安装程序
|
6天前
|
Ubuntu 安全 iOS开发
Nessus Professional 10.10 Auto Installer for Ubuntu 24.04 - Nessus 自动化安装程序
Nessus Professional 10.10 Auto Installer for Ubuntu 24.04 - Nessus 自动化安装程序
49 5
|
6天前
|
安全 Ubuntu iOS开发
Nessus Professional 10.10 Auto Installer for Windows - Nessus 自动化安装程序
Nessus Professional 10.10 Auto Installer for Windows - Nessus 自动化安装程序
55 3
Nessus Professional 10.10 Auto Installer for Windows - Nessus 自动化安装程序
|
6天前
|
安全 Ubuntu iOS开发
Nessus Professional 10.10 Auto Installer for macOS Tahoe - Nessus 自动化安装程序
Nessus Professional 10.10 Auto Installer for macOS Tahoe - Nessus 自动化安装程序
43 5
|
1月前
|
机器学习/深度学习 人工智能 测试技术
EdgeMark:嵌入式人工智能工具的自动化与基准测试系统——论文阅读
EdgeMark是一个面向嵌入式AI的自动化部署与基准测试系统,支持TensorFlow Lite Micro、Edge Impulse等主流工具,通过模块化架构实现模型生成、优化、转换与部署全流程自动化,并提供跨平台性能对比,助力开发者在资源受限设备上高效选择与部署AI模型。
234 9
EdgeMark:嵌入式人工智能工具的自动化与基准测试系统——论文阅读
|
9天前
|
存储 人工智能 自然语言处理
拔俗AI自动化评价分析系统:让数据说话,让决策更智能
在用户体验为核心的时代,传统评价分析面临效率低、洞察浅等痛点。本文基于阿里云AI与大数据技术,构建“数据-算法-应用”三层智能分析体系,实现多源数据实时接入、情感与主题精准识别、跨模态融合分析及实时预警,助力企业提升运营效率、加速产品迭代、优化服务质量,并已在头部电商平台成功落地,显著提升用户满意度与商业转化。
|
3月前
|
运维 Prometheus 监控
系统崩了怪运维?别闹了,你该问问有没有自动化!
系统崩了怪运维?别闹了,你该问问有没有自动化!
128 9
|
9月前
|
人工智能 自然语言处理 数据挖掘
企业数字化转型的关键:如何利用OA系统实现自动化与智能决策
在数字化时代,传统办公系统已无法满足现代企业的需求。通过将RPA(机器人流程自动化)和AI(人工智能)技术与OA系统结合,企业能实现业务流程自动化、智能决策支持,大幅提升工作效率和资源配置优化,推动数字化转型。RPA可自动处理重复任务,如审批、数据同步等;AI则提供智能数据分析、预测和决策支持,两者协同作用,助力财务管理、人力资源管理、项目管理和客户服务等多个领域实现智能化升级。未来,智能化OA系统将进一步提升个性化服务、数据安全和协作能力,成为企业发展的关键驱动力。
|
6月前
|
jenkins 测试技术 Shell
利用Apipost轻松实现用户充值系统的API自动化测试
API在现代软件开发中扮演着连接不同系统与模块的关键角色,其测试的重要性日益凸显。传统API测试面临效率低、覆盖率不足及难以融入自动化工作流等问题。Apipost提供了一站式API自动化测试解决方案,支持零代码拖拽编排、全场景覆盖,并可无缝集成CI/CD流程。通过可视化界面,研发与测试人员可基于同一数据源协作,大幅提升效率。同时,Apipost支持动态数据提取、性能压测等功能,满足复杂测试需求。文档还以用户充值系统为例,详细介绍了从创建测试用例到生成报告的全流程,帮助用户快速上手并提升测试质量。
|
7月前
|
存储 人工智能 API
OWL:告别繁琐任务!开源多智能体系统实现自动化协作,效率提升10倍
OWL 是基于 CAMEL-AI 框架开发的多智能体协作系统,通过智能体之间的动态交互实现高效的任务自动化,支持角色分配、任务分解和记忆功能,适用于代码生成、文档撰写、数据分析等多种场景。
1557 13
OWL:告别繁琐任务!开源多智能体系统实现自动化协作,效率提升10倍