centos7.2安装cobbler 并安装系统

系统CentOS7.2

要学习CentOS6.5系统的可以看一下这个前辈的链接,这里不再介绍

http://blog.chinaunix.net/uid-16728139-id-4174109.html


其实centos6.5跟7.2的话,也就是centos6.5多了一个rsync,而centos7.2不需要配置rsync,其他操作均相同

下面把多的那一部分截图放出来

wKioL1d-ISLA40hMAABZ-1Ge358819.png-wh_50


还有就是装centos6.5的系统(我采用的是VMware Workstation虚拟的方式) 会提示一个  

wKioL1d-ISXhepzwAAA8cGLfPVI723.png-wh_50

这里需要大家敲一下回车

下面开始centos7.2上的操作


1.关闭selinux

sed -in 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
setenforce 0


2.关闭防火墙

systemctl disable firewalld.service
systemctl stop firewalld.service
systemctl is-enabled firewalld.service


3.安装epel-release、163源

yum -y install epel-release 
cd /etc/yum.repos.d/ ; wget http://mirrors.163.com/.help/CentOS7-Base-163.repo ; cd


4.查看cobbler包

yum search all cobbler


wKioL1d-ISaQmI3KAAB7Mr266uk341.png-wh_50


5.安装cobbler

yum -y install cobbler cobbler-web


6.安装dhcp httpd xinetd

yum -y install dhcp httpd xinetd


7.将cobbler httpd dhcp xinetd添加到开机自启

chkconfig cobblerd on
chkconfig httpd on
chkconfig dhcpd on
chkconfig xinetd on


8.配置环境

先备份一个配置文件  以防不时之需

cp /etc/cobbler/settings{,.bak}

next_server: 10.0.0.103

server: 10.0.0.103

manage_dhcp: 0 #设置为1时,开启cobbler的dhcp管理器  这里不开启,因为之前测试开不开启并没有什么用  都得再配置dhcpd的配置文件

manage_rsync: 1 #设置为1时,开启cobbler的rsync管理器



9.生成密码串(这个密码就是安装完系统之后的root密码)

格式:

openssl passwd -1 -salt "任意字符" “密码”

openssl passwd -1 -salt "cobbler" "centos"

$1$cobbler$DWL2fHTHaRTa2hj5VEuZk.


vim /etc/cobbler/settings



default_password_crypted: "$1$cobbler$DWL2fHTHaRTa2hj5VEuZk."



10.启用xinetd

将disable的值改为“no”


wKiom1d-ISKRcu5lAABr3cEppyU543.png-wh_50

systemctl start xinetd.service


11.启用dhcp服务

按以下配置dhcp的话,分配到ip地址后可以直接上网(只要你的上网环境没有问题)

wKioL1d-ISKRZA7NAABYahkT7PE264.png-wh_50


subnet 10.0.0.0 netmask 255.255.255.0 {

       option routers 10.0.0.1;

       option domain-name-servers 114.114.114.114;

       option subnet-mask 255.255.255.0;

       default-lease-time 21600;

       max-lease-time 43200;

       range 10.0.0.200 10.0.0.210;

       next-server 10.0.0.103;

       filename "pxelinux.0";

}


systemctl start dhcpd.service


12.依次启动httpd cobbler 然后检查cobbler 然后根据提示操作

wKioL1d-ISPSuYPZAACP2gohiIc774.png-wh_50

systemctl start httpd.service
systemctl start cobblerd.service
cobbler check
cobbler get-loaders
systemctl enable rsyncd.service
yum -y install pykickstart
yum -y install fence-agents
cobbler sync

wKiom1d-ISXAyd04AAAtUpTcfbs500.png-wh_50

最后剩下一个  是用来安装debian系统的  我不需要  我就不安装了


13.修改cobbler的web密码(此步骤可以省略

htdigest /etc/cobbler/users.digest "Cobbler" cobbler

wKiom1d-ISKCre7hAAAZNOonCnA833.png-wh_50

systemctl restart httpd.service
systemctl restart cobblerd.service


注意这里的http访问协议是“https”  注意 使用http不可访问

https://10.0.0.103/cobbler_web

wKiom1d-ISOg7TPeAAEvAKoMIik979.png-wh_50


14.挂载磁盘,导入系统镜像,这里导入的是centos7.2的系统

cobbler import --path=/mnt/ --name=centos7.2

wKioL1d-ISPCIoVVAAC_d8pCmt8473.png-wh_50


遇到问题就用cobbler check 检查一下  ,可以加快你排错的时间


wKioL1d-ISei1_j4AAHE29-vR5I903.png-wh_50

上述所采用的ks文件为默认  当然安装的系统也是最小化的


做完这些操作之后你就可以装系统了,而且不需要人为去干预


这里提示一下

有时可能需要批量安装某一种系统  可以将LABEL后的名称复制放到引导文件第一行DEFAULT 的后边 如下图

wKioL1d-ISSzf8puAACKwOrl4XE632.png-wh_50


引导程序的位置在

/var/lib/tftpboot/pxelinux.cfg/default

wKioL1d-ISTgHyv4AACI8IK828c662.png-wh_50



这里解释一下:

DEFAULT menu #指定默认引导入口名称(假如指定的是)

PROMPT 0 #是否等待用户选择(1表示等待   0表示不等待)就像下图这样wKiom1d-ISSjgWPNAABlANCdmSU458.png-wh_50


LABEL 。。。 #启动项

wKiom1d-ISWCnJQPAABqoeUusB8925.png-wh_50


wKioL1d-ISSBRROkAAAVn1RPgIo016.png-wh_50






發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章