Cent os下部署cobbler

刚进公司,听同事提到cobbler,之前只知道有个PXE,后来在网上查找了一些资料,自己找了台服务器测试了一下

Cobbler

部署环境 :  
                                 cobbler-server dell PowerEdge C6220
                                 cobbler-server OS   Centos6.4
                                 cobbler_server ip : 192.168.1.100

cobbler安装环境:

1、安装epel
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -Uvh epel-release-6*.rpm
2、服务安装
yum -y install cobbler httpd rsync tftp xinetd dhcp cman pykickstart
3、修改cobbler配置文件 /etc/cobbler/settings
sed -i ‘s/manage_dhcp: 0/manage_dhcp: 1/‘ /etc/cobbler/settings    #开启dhcp功能
sed -i ‘s/manage_rsync: 0/manage_rsync: 1/‘ /etc/cobbler/settings  #开启rsync功能
sed -i ‘s/next_server: 127.0.0.1/next_server: 192.168.1.100/‘ /etc/cobbler/settings  #设置你的 tftp server 地址
sed -i ‘s/server: 127.0.0.1/server: 192.168.1.100/‘ /etc/cobbler/settings   #cobbler_server 地址
4、开启cobbler服务前需要做
service iptables stop #关闭防火墙
setenforce 0 #关闭selinux
/etc/xinetd.d/tftp
disable                 = no #开启tftp服务
/etc/xinetd.d/rsync
disable                 = no #开启 rsync 服务
openssl passwd -1 -salt ‘cocosoa‘ ‘00001234‘  生成系统安装后的 root 密码,cocosoa是干扰密码,00001234是系统登录密码
vim /etc/cobbler/settings 编辑配置文件,将默认的密码替换为新生成的
default_password_crypted: "$1$cocosoa$oAeSzE7VLKwhMPiBEOJD81"

cobbler get-loaders    #下载引导操作系统文件

yum install debmirror -y
vim /etc/debmirror.conf
#@dists="sid";    // 注销
#@arches="i386";    // 注销
配置dhcp服务,只需要修改cobbler的dhcp模板文件即可
vim /etc/cobbler/dhcp.template

subnet 192.168.1.0 netmask 255.255.255.0 {
     option routers             192.168.1.5;
     option domain-name-servers 192.168.1.1;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.1.100 192.168.1.254;
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                192.168.1.122;
     class "pxeclients" {
          match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
          if option pxe-system-type = 00:02 {
                  filename "ia64/elilo.efi";
          } else if option pxe-system-type = 00:06 {
                  filename "grub/grub-x86.efi";
          } else if option pxe-system-type = 00:07 {
                  filename "grub/grub-x86_64.efi";
          } else {
                  filename "pxelinux.0";
          }
     }

}

注意修改之后,使用cobbler sync 同步下配置文件,不然dhcp无法启动,会报错

5、启动服务
service httpd start 在配置文件中加入ServerName localhost:80
service cobbler start
chkconfig httpd on
chkconfig cobblerd on
chkconfig dhcpd on
chkconfig xinetd on
chkconfig tftp on
chkconfig iptables off
6、导入镜像
cobbler import --path=/media --name=CentOS6.4 --arch=x86_64
touch /var/lib/cobbler/kickstarts/CentOS6.4.ks
cobbler profile add --name=centos6.4 --distro=CentOS6.4-x86_64 --kickstart=/var/lib/cobbler/kickstarts/CentOS6.4.ks
添加一个profile文件,并使用CentOS6.4-x86_64这个distro,并指定相应的ks文件,ks文件是事先准备好的
vim /etc/cobbler/pxe/pxedefault.template    #编辑pxe模板
ONTIMEOUT centos6.4         #修改默认安装的profile为centos6.4,也就是说当你没有选择,超时操作后自动安装此profile
7、编辑kickstarts文件     #可以自己写
vim /var/lib/cobbler/kickstarts/CentOS6.4.ks
install
auth --useshadow --enablemd5
key --skip
bootloader --location=mbr
clearpart --all --initlabel
text
firewall --disabled
keyboard us
lang en_US
url --url=$tree
reboot
rootpw --iscrypted $1$cocosoa$oAeSzE7VLKwhMPiBEOJD81
selinux --disabled
timezone --isUtc Asia/Shanghai
zerombr
autopart

%packages

$SNIPPET(‘package‘)

cat /var/lib/cobbler/snippets/package

此文件里写入需要安装的包

下面是扩展目录,可以自己添加单独的配置文件,方便管理

/var/lib/cobbler/snippets

$SNIPPET (文件名)  该文件要到/var/lib/cobbler/snippets下创建编辑。

# System authorization information 
auth --useshadow --enablemd #用户登录认证 
# System bootloader configuration 
bootloader --location=mbr #mbr引导 
# Partition clearing information 
clearpart --all --initlabel #默认清除所以分区 
# Use text mode install 
text #默认以文本模式安装 
# Firewall configuration 
firewall --enabled #防火墙默认开启 
# 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 #默认的yum仓库 
# Network information 
$SNIPPET(‘network_config‘)  
# Reboot after installation 
reboot #安装完成后重启
#Root password 
rootpw --iscrypted $default_password_crypted #密码是我们/etc/cobbler/settings设置密码 
# SELinux configuration 
selinux --disabled #默认关闭selinux 
# Do not configure the X Window System 
skipx #默认没有安装图形界面  
# System timezone 
timezone America/New_York #默认时区是美国/纽约 
# Install OS instead of upgrade 
install #定义的是安装系统而不是升级系统 
# Clear the Master Boot Record 
zerombr #默认清空所有的mbr 
# Allow anaconda to partition the system as needed 
autopart #默认自动分区

IT交流群144486234

时间: 2024-12-09 02:14:28

Cent os下部署cobbler的相关文章

mac os下部署laravel项目笔记

最近在mac os下部署一个laravel项目,一直都听说mac上配置php+apache+mysql很简单,但是对于不熟悉的我还是遇到了不少的麻烦.一开始装了MAMP,以为和windows上的集成环境一样简单,结果还是遇到了很多问题.最后还是用了brew. brew的安装: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 大家可以上官网看更多的资料:ht

cent os下搭建简单的服务器

作为常和网络打交道的程序员,经常会遇到需要服务器的场合,比如搭建一个web服务器,一个代理服务器,又或者一个小型的游戏服务器. 我时常和朋友一起玩一款叫我的世界的游戏,为了能够长期稳定地联机玩,所以特地买了一个服务器.因为windows作为服务器系统,不如Linux稳定,而且linux可以不用GUI界面,内存占用非常小,这样就能让更多的朋友同时在线.相互比较,我选择了Cent OS系统. Cent OS作为一个网络服务器是非常优秀的,稳定而且强大.废话不多说,我们第一步来搭建一个我的世界服务器.

十二 Cent OS下 tomcat启动项目响应速度很慢

在tomcat部署了web项目,每次启动项目都需要花费2-3分钟,甚至有的时候需要花费10分钟左右,实在是太慢了. 在网上查找解决方案,把 jdk/jre/lib/security/java.security 文件中 securerandom.source=file:/dev/random 改为 securerandom.source=file:/dev/./urandom即可 究其原因是在于 /dev/random 的随机处理形式比较费时,虽然随机性较高,但是会随着读取的内容越多而越慢,所以需

八、cent OS下tomcat启用APR并发模式

Tomcat支持三种接收请求的处理方式:BIO.NIO.APR ,本文记录tomcat配置APR模式,也是首选模式.(Tomcat7 或以下,在 Linux 系统中默认使用BIO方式) 安装依赖库yum install apr-devel yum install openssl-devel yum install gcc yum install make 下载native地址:http://tomcat.apache.org/download-native.cgitar -xvzf tomcat

Cent OS下修改用户打开文件数限制

如果有用户test,现在需要修改此用户打开文件数限制,步骤如下:1 修改Linux下资源使用的配置文件,添加以下参数:sudo vim /etc/security/limits.conftest soft nproc 65534test hard nproc 65534test soft nofile 65534test hard nofile 65534 参数说明:nproc:用户可用的最大进程数量nofile:用户可打开的最大文件总数soft即是软限制,hard是硬限制.用户可以超过soft

Cent OS下搭建VPN

一.确保机器已开通PPP 和 TUN cat /dev/ppp cat /dev/net/tun 输出结果为下午则表示通过,否则请联系供应商. 二: 一键安装脚本 wget http://www.laozuo.org/download/scripts/openvz_centos_vpn.sh chmod a+x openvz_centos_vpn.sh<span style="white-space:pre"> </span> sh openvz_centos_

Centos6.7安装部署cobbler完成无人值守化安装部署

 Centos6.7部署cobbler完成无人值守化安装部署                   Cobbler是一个免费开源系统安装部署软件,用于自动化网络安装操作系统.在生产环境中,经常批量部署几十甚至上百台服务器时,实现自动化安装操作系统尤为重要,按照传统的光盘引导安装工作量是不可预估的:此前我们通过pxe+kickstart简单实现了自动化安装,但只能实现单一版本安装,当需要部署不同版本或不同引导模式(BIOS.EFI)时,此种方式就不够灵活.而Cobbler正是为了解决此问题而设计的.

一、cent OS安装配置JDK

到oracle官网下载JDKhttp://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html 在cent OS系统上检测本机是否安装了JDK命令:java -version 将JDK上传到cent OS命令:scp -P 22 本地文件地址 用户名@IP地址:服务器存放地址 解压缩tar -zxvf jdk-8-x64.tar.gz 创建一个新目录mkdir /laycloud/java 将文件移动到新目录

在MAC OS 下配置python + Flask ,并支持pyCharm编辑器

原创咯- flask是一个micro framework ,伸缩性很强.可以部署到openshift 的PAAS里.这个框架上手非常快.喜欢的可以试试. 若实在MAC里,python已经默认安装了.10.9的系统安装的是2.7.5的版本.所以我们这里就不详细介绍python的安装啦 1. 首先安装  vurtualenv 这是一个虚拟环境,virtualenv 允许多个版本的 Python 同时存在,对应不同的项目. 它实际上并没有安装独立的 Python 副本,但是它确实提供了一种巧妙的方式来