centos7系统部署cobbler批量安装系统
系统环境:
一.开启两个网卡。一个仅主机模式,一个桥接模式,主机模式对内提供cobbler服务
[root@localhost ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:24:81:b8 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.191/24 brd 192.168.1.255 scope global noprefixroute dynamic ens33
valid_lft 6395sec preferred_lft 6395sec
inet6 fe80::d57f:69e1:bdc9:112c/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: ens37: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:24:81:c2 brd ff:ff:ff:ff:ff:ff
inet 192.168.199.129/24 brd 192.168.199.255 scope global noprefixroute dynamic ens37
valid_lft 1706sec preferred_lft 1706sec
inet6 fe80::2e3a:fb50:b5de:f0d1/64 scope link noprefixroute
valid_lft forever preferred_lft forever
内网IP:192.168.199.129/24
外网IP:192.168.1.191/24
二.关闭安全服务
[root@localhost ~]# systemctl stop firewalld #关闭防火墙
[root@localhost ~]# setenforce 0 #关闭selinux
三.下载cobbler及其所需要的服务
[root@localhost ~]# yum install cobbler httpd dhcp tftp-server xinetd syslinux -y
yum安装cobbler需要使用下面两个源
[epel]
name=epel
enabled=1
gpgcheck=0
baseurl=https://mirrors.aliyun.com/epel/7/x86_64/
[centos]
name=centos base
enabled=1
gpgcheck=0
baseurl=http://mirrors.163.com/centos/7/os/x86_64/
配置相关服务
第一步:配置DHCP服务
[root@localhost ~]# vim /etc/dhcp/dhcpd.conf
subnet 192.168.199.0 netmask 255.255.255.0 {
range 192.168.199.125 192.168.199.129;
default-lease-time 600;
max-lease-time 7200;
filename "pxelinux.0";
}
第二步:配置tftp
[root@localhost ~]# vim /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer
# protocol. The tftp protocol is often used to boot diskless
# workstations, download configuration files to network-aware printers,
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = no #yes改为no
per_source = 11
cps = 100 2
flags = IPv4
第三步:启动cobbler
[root@localhost ~]# systemctl restart cobblerd
第四步:启动httpd
[root@localhost ~]# systemctl restart httpd
第五步:检查cobbler配置
[root@localhost ~]# 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.
2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.
3 : 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.
4 : enable and start rsyncd.service with systemctl
5 : debmirror package is not installed, it will be required to manage debian deployments and repositories
6 : ksvalidator was not found, install pykickstart
7 : 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
8 : 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.
问题一:cobbler文件默认时127.0.0.1本地回环地址,需要更改为提供cobbler服务的IP地址192.168.199.129 在384行
384 server: 192.168.199.129
问题二:next_server也是默认本地回环地址,需要改为提供cobbler服务的IP地址 192.168.199.129 在272行
272 next_server: 192.168.199.129
问题三:可以忽略
问题四:启动rsync即可
[root@localhost ~]# systemctl restart rsyncd
[root@localhost ~]# systemctl enable rsyncd
Created symlink from /etc/systemd/system/multi-user.target.wants/rsyncd.service to /usr/lib/systemd/system/rsyncd.service.
问题五:可以忽略
问题六:更改密码
[root@localhost ~]# openssl passwd -1 -salt "123" "123123"
$1$123$ai3PKcU9Q7J3tIviFBaqN0
把新生成的加密数据填写进/etc/cobbler/settings
101 default_password_crypted: "$1$123$ai3PKcU9Q7J3tIviFBaqN0."
问题7:可以忽略
解决之后需要同步和重启
[root@localhost ~]# systemctl restart cobblerd
[root@localhost ~]# cobbler sync
再次检查是否已经更新完成
[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, 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.
2 : debmirror package is not installed, it will be required to manage debian deployments and repositories
3 : ksvalidator was not found, install pykickstart
4 : 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@localhost ~]# mount /dev/cdrom /mnt
mount: /dev/sr0 写保护,将以只读方式挂载
mount: /dev/sr0 已经挂载或 /mnt 忙
/dev/sr0 已经挂载到 /mnt 上
数据导入(需要等候半小时)
查看distro
[root@localhost ~]# cobbler distro list
centos7.5-x86_64
查看profile
[root@localhost ~]# cobbler profile list
centos7.5-x86_64
第七步:准备kicksstart文件
在root目录下找到ks文件,并移动到/var/lib/cobbler/kickstarts/到目录下改名为ks.cfg
[root@localhost ~]# mv anaconda-ks.cfg /var/lib/cobbler/kickstarts/ks.cfg
[root@localhost ~]# vim /var/lib/cobbler/kickstarts/ks.cfg
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
url --url=http://192.168.199.129/cobbler/ks_mirror/centos7.5/ #这里需要改为repodata所在的http地址
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=cn --xlayouts='cn'
# System language
lang zh_CN.UTF-8
# Network information
network --bootproto=dhcp --device=ens33 --onboot=off --ipv6=auto --no-activate
network --hostname=localhost.localdomain
# Root password
rootpw --iscrypted $6$TMd0rYN/SfJ1lCgp$wXdVnqpX/mHK0UgVnHaNJNNS0UIdddW3fJ.61SUO4maZQOvg1c/0eWXT28o0I25rmOOjKs5/3IZVNeYcIA6rL0
# System services
services --enabled="chronyd"
# System timezone
timezone Asia/Shanghai --isUtc
# System bootloader configuration
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
autopart --type=lvm
# Partition clearing information
clearpart --none --initlabel
%packages
@^minimal
@core
chrony
kexec-tools
需要改为repodata所在的http地址
第八步:自定义profile
[root@localhost ~]# cobbler profile add --distro=centos7.5-x86_64 --name=centos7.5_ken --kickstart=/var/lib/cobbler/kickstarts/ks.cfg
[root@localhost ~]# cobbler sync
第九步:查看profile
[root@localhost ~]# cobbler profile list
centos7.5-x86_64
centos7.5_ken
第十步:删除不包含ks文件的profile
[root@localhost ~]# cobbler profile remove --name=centos7.5-x86_64
[root@localhost ~]# cobbler profile list
centos7.5_ken
cobbler自动安装测试
新建一个虚拟机,需要和cobbler服务器所在同一个虚拟网络中即与我们上面设置的cobbler服务器的主机模式。内存需要3个G以上。
选择我们自定义的包即可自动化安装
centos7系统部署cobbler批量安装系统的更多相关文章
- 末学者笔记--Centos7系统部署cobbler批量安装系统
[前言]: cobbler是一个可以实现批量安装系统的Linux应用程序.它有别于pxe+kickstart,cobbler可以实现同个服务器批量安装不同操作系统版本. 系统环境准备及其下载cob ...
- 基于CentOS7系统部署cobbler批量安装系统(week3_day5_part1)-技术流ken
前言 cobbler是一个可以实现批量安装系统的Linux应用程序.它有别于pxe+kickstart,cobbler可以实现同个服务器批量安装不同操作系统版本. 系统环境准备及其下载cobbler ...
- 基于Centos7系统部署cobbler批量安装系统
前言 cobbler是一个可以实现批量安装系统的Linux应用程序.它有别于pxe+kickstart,cobbler可以实现同个服务器批量安装不同操作系统版本 系统环境的准备及下载cobbler 一 ...
- 006-(成功环境记录)基于Centos7系统部署cobbler批量安装系统
1.1 cobbler简介 Cobbler是一个Linux服务器安装的服务,可以通过网络启动(PXE)的方式来快速安装.重装物理服务器和虚拟机,同时还可以管理DHCP,DNS等. Cobbler可以使 ...
- cobbler批量安装系统
cobbler是一个可以实现批量安装系统的Linux应用程序.它有别于pxe+kickstart,cobbler可以实现同个服务器批量安装不同操作系统版本. 1.系统环境准备及其下载cobbler 1 ...
- cobbler批量安装系统使用详解-技术流ken
前言 cobbler是一个可以实现批量安装系统的Linux应用程序.它有别于pxe+kickstart,cobbler可以实现同个服务器批量安装不同操作系统版本. 系统环境准备及其下载cobbler ...
- cobbler一键批量安装系统
cobbler是一个可以实现批量安装系统的Linux应用程序.它有别于pxe+kickstart,cobbler可以实现同个服务器批量安装不同操作系统版本. 一.系统环境准备及其下载cobbler 1 ...
- 其他综合-Cobbler无人值守安装系统 CentOS 7
Cobbler 无人值守安装系统 CentOS 7 1.实验描述 1.1 概述 作为运维,在公司经常遇到一些机械性重复工作要做,例如:为新机器装系统,一台两台机器装系统,可以用光盘.U盘等介质安装,1 ...
- cobbler自动化安装系统
笔者Q:972581034 交流群:605799367.有任何疑问可与笔者或加群交流 在很久很久以前,使用kickstart实现自动化安装的时候,我一直认为装系统是多么高大上的活,直到cobbler的 ...
随机推荐
- python3的字符串和字节
Python3中内置类型bytes和str用法及byte和string之间各种编码转换 Python 3最重要的新特性大概要算是对文本和二进制数据作了更为清晰的区分.文本总是Unicode(16进制) ...
- sass基本用法
什么是SASS SASS是一种CSS的开发工具,提供了许多便利的写法,大大节省了设计者的时间,使得CSS的开发,变得简单和可维护. 本文总结了SASS的主要用法.我的目标是,有了这篇文章,日常 ...
- 【长期更新】迈向现代化的 .Net 配置指北
1. 欢呼 .NET Standard 时代 我现在已不大提 .Net Core,对于我来说,未来的开发将是基于 .NET Standard,不仅仅是 面向未来 ,也是 面向过去:不只是 .Net C ...
- 深入理解 GIL:如何写出高性能及线程安全的 Python 代码
深入理解 GIL:如何写出高性能及线程安全的 Python 代码 本文由 伯乐在线 - 郑芸 翻译.未经许可,禁止转载!英文出处:A. Jesse.欢迎加入翻译组. GIL对多线程的影响:http:/ ...
- cv2.matchTemplate()函数的应用,匹配图片后画出矩形
import cv2 as cv import numpy as np """ matchTemplate(): 参数image:待搜索的图像(大图) 参数temple: ...
- Python unittest 测试输入(input)和输出(print)
Python 自带的 unittest 库可以用来写单元测试. 测试输入输出的解决方法是: 将标准输入输出定向到一个StringIO类(python3是 io.StringIO). import un ...
- (转)学习HTML5 Canvas这一篇文章就够了
作者:做人要厚道2013 原文:https://blog.csdn.net/u012468376/article/details/73350998
- fhq_treap 小结
简介 \(fhq\_treap\)是一种非旋平衡树.在学习这篇文章之前,还是先学习一下普通\(treap\)吧 优点 相比于普通的\(treap\),它可以处理区间操作. 相比于\(splay\),它 ...
- golang中使用Redis
一.golang中安装Redis github地址:https://github.com/garyburd/redigo 文档地址:http://godoc.org/github.com/garybu ...
- 微信小程序与webview交互实现支付
实现原理:点击h5网页的支付按钮——(跳转)——>嵌套改h5的小程序的支付页面——(处理支付)——>跳转至支付完成后的页面 注意:(1)网页h5中,引入微信的jssdk <scrip ...