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 ...
随机推荐
- HDU 2648(搜索题,哈希表)
#include<iostream> #include<map> #include<string> #include<cstring> #include ...
- laravel 将数组转化成字符串 再把字符串转化成数组
这是在给阮少翔改代码的时候用的方法, 开始的数据用explored转化成数组不是想要的结果, 我就自己写了一个方法把有用的信息提取出来拼接成一个字符串, 再用explored将字符串转化成数组. ...
- Django-form组件补充
首先来看一个用户登录的实例 from django.forms import Form from django.forms import fields from django.forms import ...
- React项目结构
任何一种语言.框架,在真正上手的时候,多多少少会想想怎么安排项目结构(正所谓磨刀不误砍柴工),React也不例外. google了下,拿下面3篇博客来说道说道. (1) how-to-better-o ...
- Data Matrix Font and Encoder条码控件可以以字体的形式来打印DataMatrix条形码
Data Matrix Font and Encoder条码控件使您能够以字体的形式来打印DataMatrix条形码. 本产品能够在不论什么支持Java类库..NET动态链接库或Windows COM ...
- 优化梯度计算的改进的HS光流算法
前言 在经典HS光流算法中,图像中两点间的灰度变化被假定为线性的,但实际上灰度变化是非线性的.本文详细分析了灰度估计不准确造成的偏差并提出了一种改进HS光流算法,这种算法可以得到较好的计算结果,并能明 ...
- 图像处理之滤波---gabor
http://blog.csdn.net/xiaowei_cqu/article/details/24745945 小魏北大
- 从S3中导入数据到Dynamodb
本节如果你已经从Dynamodb中导出过数据,而且导出的文件以及被存入S3.文件内部结构会在Verify Data Export File 中描写叙述. 我们称之前导出数据的原始表为source ta ...
- 设置netbeans文件编码格式
在项目ecmall上右键 选择属性,然后在项目属性里设置
- SAM4E单片机之旅——10、UART与MCK之PLL
为使用更更高的波特率,则需要更更高的外设时钟的频率.这个时候就需要用到锁相环(PLL)了.锁相环可以对输入的时钟进行分频.升频后进行输出.MCK可以使用的锁相环为PLLA,而PLLA的输入时钟为MAI ...