Cobbler安装配置简单使用
安装Cobbler
[root@linux-node3 ~]# yum -y install epel-release
[root@linux-node3 ~]# yum -y install cobbler cobbler-web dhcp httpd xinetd pykickstart fence-agents # 如果你的报错请用163源
[root@linux-node3 ~]# chkconfig cobblerd on
[root@linux-node3 ~]# chkconfig httpd on
[root@linux-node3 ~]# chkconfig dhcpd on
[root@linux-node3 ~]# chkconfig xinetd on
[root@linux-node3 ~]# chkconfig rsyncd on
[root@linux-node3 ~]# sed -i -e 's/\=\ yes/\=\ no/g' /etc/xinetd.d/tftp
[root@linux-node3 ~]# openssl passwd - -salt "cobbler" "centos" # centos为你之后所装所有机器的root密码,cobbler是对centos进行加密时用到的加密文(可以去看下salt加密相关),参数是数字1不是字母l
[root@linux-node3 ~]# cat/etc/cobbler/settings
next_server: 192.168.145.11 # 提供pxe的主机,你的本机ip
server: 192.168.145.11 # 提供cobbler的主机,还是你的本机ip
manage_dhcp:
manage_rsync:
default_password_crypted: "$1$cobbler$DWL2fHTHaRTa2hj5VEuZk." # 刚才使用加密后得到的密文,注意最后有个.
pxe_just_once: # 防止循环装系统,很重要! [root@linux-node3 ~]# cat /etc/cobbler/dhcp.template # 更改第一段就好,其实就是dhcp的配置
subnet 192.168.56.0 netmask 255.255.255.0 {
option routers 192.168.56.2;
option domain-name-servers 8.8.8.8;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.56.100 192.168.56.254;
default-lease-time ;
max-lease-time ;
next-server $next_server;
class "pxeclients" {
match if substring (option vendor-class-identifier, , ) = "PXEClient";
if option pxe-system-type = : {
filename "ia64/elilo.efi";
} else if option pxe-system-type = : {
filename "grub/grub-x86.efi";
} else if option pxe-system-type = : {
filename "grub/grub-x86_64.efi";
} else if option pxe-system-type = : {
filename "grub/grub-x86_64.efi";
} else {
filename "pxelinux.0";
}
} } [root@linux-node3 ~]# systemctl start xinetd
[root@linux-node3 ~]# systemctl start dhcpd
[root@linux-node3 ~]# systemctl start httpd
[root@linux-node3 ~]# systemctl start rsyncd
[root@linux-node3 ~]# systemctl start cobblerd
[root@linux-node3 ~]# cobbler get-loaders # 去git下载cobbler相关包,下载慢的话可以把dns换成114.114.114.
[root@linux-node3 ~]# cobbler sync # 每次有修改过文件后都要执行哦
[root@linux-node3 ~]# cobbler check # cobbler自带的检测命令,出了问题就可以使用下,可以快速帮助你检测出问题的所在点,centos7会出debmirror错误,这是安装debian系统相关的,不会影响到使用
[root@linux-node3 ~]# htdigest /etc/cobbler/users.digest "Cobbler" cobbler # 设置cobbler_web页面的访问密码
访问https://192.168.145.11/cobbler_web # 用户名为cobbler,密码刚才设置的,注意是https [root@linux-node3 ~]# cat /etc/cobbler/pxe/pxedefault.template
DEFAULT menu
PROMPT
MENU TITLE Cobbler | http://www.cnblogs.com/bfmq/
TIMEOUT # 装系统时的等待时间,默认20秒
TOTALTIMEOUT
ONTIMEOUT centos7.-x86_64 # 这个需要改成你自己的cobbler profile list出现的,之后默认不选择系统引导后就会自动选择这个 LABEL local
MENU LABEL (local)
MENU DEFAULT
LOCALBOOT -
$pxe_menu_items MENU end
使用Cobbler
[root@linux-node3 ~]# mount /dev/sr0 /mnt # /dev/sr0是centos7.2的iso源镜像
[root@linux-node3 ~]# cobbler import --path=/mnt/ --name=centos7. # 需要一些时间,导入的镜像会放在/var/www/cobbler/ks_mirror内,以name指定的为目录名
[root@linux-node3 ~]# cd /var/lib/cobbler/kickstarts [root@linux-node3 ~]# cat centos7.-x86_64.cfg # 里面不可以有中文,so,不注释含义了,都很好理解
# kickstart template for Fedora and later.
# (includes %end blocks)
# do not use with earlier distros #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 --disabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# Use network installation
url --url=$tree
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
$yum_repo_stanza
# Network information
$SNIPPET('network_config')
# Reboot after installation
reboot #Root password
rootpw --iscrypted $default_password_crypted
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone Asia/Shanghai
# Install OS instead of upgrade
install
# Clear the Master Boot Record
zerombr
# Allow anaconda to partition the system as needed
autopart
#clearpart --all --initlabel
#part / --fstype xfs --size 1 --grow --asprimary --onbiosdisk=80 #part swap --maxsize= --asprimary --size= --onbiosdisk=80 #part /boot --fstype=xfs --grow --asprimary --size= --onbiosdisk=80 %packages
@^minimal
@base
@core
@development lftp
openssh-clients
tree
lrzsz
telnet
nc
sysstat
gcc
gcc-c++
%end %post
sed -i "s/#UseDNS yes/UseDNS no/g" /etc/ssh/sshd_config
echo 'export HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S "' >> /etc/bashrc
echo 'export HISTSIZE=9999' >> /etc/bashrc
IP=`ifconfig eth0|grep netmask|awk '{print $2}'`
HN=`echo $IP|awk -F. '{print $NF}'`
sed -i 's/dhcp/none/g' /etc/sysconfig/network-scripts/ifcfg-eth0
echo 'PREFIX=24' >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "IPADDR=$IP" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo 'GATEWAY=192.168.145.2' >> /etc/sysconfig/network-scripts/ifcfg-eth0
sed -i 's/nameserver *.*.*.*/nameserver 8.8.8.8/g' /etc/resolv.conf
systemctl restart network
%end %pre
$SNIPPET('log_ks_pre')
$SNIPPET('kickstart_start')
$SNIPPET('pre_install_network_config')
# Enable installation monitoring
$SNIPPET('pre_anamon')
%end [root@linux-node3 ~]# cobbler profile edit --name=centos7.-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos7.-x86_64.cfg
[root@linux-node3 ~]# cobbler profile edit --name= centos7.-x86_64 --kopts='net.ifnames=0 biosdevname=0' # 装6的系统不需要,这是统一网卡名称用的 96 [root@linux-node3 ~]# cobbler sync
然后你就可以直接开机等待系统自动安装了
Cobbler安装配置简单使用的更多相关文章
- Linux装机利器Cobbler安装配置
Linux装机利器Cobbler安装配置 2011-05-27 15:31:05 分类: LINUX 一.安装环境 centos 5.4 关掉iptables 关掉 selinux selinux ...
- saltstack master minion安装配置简单使用
首先先了解下saltstack是什么,为什么使用它 它与Ansible.Puppet都属于集中管理工具,由于现在企业规模的不断庞大及业务的增长,所需要管理的服务器数量增多,而且大部分机器都属于同类业务 ...
- cobbler安装配置(二)
安装环境: 操作系统:CentOS 6.5 x86_64测试机器ip:192.168.0.1 关闭防火墙.selinux:service iptables stop && chkcon ...
- puppet yum安装配置,简单证书维护
Puppet学习之puppet的安装和配置 一.Puppet简介 Puppet基于ruby语言开发的自动化系统配置工具,可以C/S模式或独立运行,支持对所有UNIX及类UNIX系统的配置管理,最新版本 ...
- cobbler安装配置.基本全了多看help和docs
env 系统环境配置,软件包安装 centos7 yum update -y sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/sysconfig/ ...
- Jenkins安装配置简单使用
安装启动是十分简单的,直接去https://jenkins.io/download/下载对应的rpm包就好了,需要注意的是我们的机器上要提前有java环境,相对应要选择你java环境可以支持的jenk ...
- ELK安装配置简单使用
ELK是三款软件的总称,包括了elasticsearch.logstash.kibana,其实在生产使用中,我们还需要使用到其他的更多辅助软件来更好更合理的收集展示数据. Elasticsearch: ...
- Katalon Studio 安装 配置 简单使用
本教程只针对Katalon Studio进行演示操作. 一.下载 Katalon 官网下载地址:https://www.katalon.com/download/ (需要注册账号) 二.解压.配置 直 ...
- glusterfs安装配置简单使用
GlusterFS是一种分布式分布式文件系统,默认采用无中心完全对等架构,搭建维护使用十分简单,是很受欢迎的分布式文件系统. 官网https://www.gluster.org/,官网上表示Glust ...
随机推荐
- golang map to struct
http://stackoverflow.com/questions/26744873/converting-map-to-struct func SetField(obj interface{}, ...
- background-attachment
CreateTime--2017年9月28日10:58:58 Author:Marydon background-attachment 1.定义 定义背景图片随滚动轴的移动方式(设置背景图像是否固 ...
- Linux基础(2)- 用户、群组和权限
一.用户.群组和权限 1) 新建用户natasha,uid为1100,gid为555,备注信息为“master” 2) 修改natasha用户的家目录为/Natasha 3) 查看用户信息配置文 ...
- centos创建本地yum仓库
怎样发布自己软件的安装和更新YUM源 在创建之前,我们先了解些相关的内容: yum仓库可以支持三种途径提供给yum在安装的时候下载rpm包 第一种: ftp服务 ftp:// 第二种: http ...
- 【浅墨Unity3D Shader编程】之三 光之城堡篇:子着色器、通道与标签的写法 & 纹理混合
本系列文章由@浅墨_毛星云 出品,转载请注明出处. 文章链接:http://hpw123.net/a/C__/kongzhitaichengxu/2014/1117/120.html 作者:毛星云 ...
- memcache及其telnet命令使用详解
1.启动Memcache 常用参数memcached 1.4.3-p <num> 设置端口号(默认不设置为: 11211)-U <num> UDP监听端口 ...
- 神经网络实现Discuz验证码识别
最近自己尝试了网上的验证码识别代码项目,该小项目见以下链接: https://cuijiahua.com/blog/2018/01/dl_5.html 数据也就用了作者上传的60000张Discuz验 ...
- ubuntu搭建mysql
步骤1 – 安装MySQL 在 Ubuntu 16.04 中,默认情况下,只有最新版本的 MySQL 包含在 APT 软件包存储库中.在撰写本文时,那是 MySQL 5.7 要安装它,只需更新服务器上 ...
- Web UI回归测试 -- BackstopJS 入门
BackstopJS是一个测试工具,用于测试ui图和实际项目是否偏差. 话不多说,直接启动一个项目吧测试吧. 1.首先全局安装BackstopJS npm install -g backstopjs ...
- 一篇文章搞明白CORS跨域
面试问到数据交互的时候,经常会问跨域如何处理.大部分人都会回答JSONP,然后面试官紧接着就会问:"JSONP缺点是什么啊?"这个时候坑就来了,如果面试者说它支持GET方式,然后面 ...