RHEL6.5上安装配置Cobbler

Cobbler运行流程图

<特别声明: 该图来源“煮酒品茶”的博客,如有不妥,请联系本人删除,谢谢!>

加载epel源

# rpm -Uvh http://mirrors.ustc.edu.cn/epel/6/x86_64/epel-release-6-8.noarch.rpm

或者

# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

安装cobbler包及其组件

# yum install -y cobbler rsync tftp dhcphttpd cman pykickstart debmirror tftp-server xinetd python-ctypes

# yum install -y ed patch perlperl-Compress-Zlib perl-Digest-SHA1 perl-LockFile-Simple perl-libwww-perl

设置服务开机启动

# chkconfig httpd on

# chkconfig dhcpd on

# chkconfig xinetd on

# chkconfig cobblerd on

系统环境设置selinux/iptables

# sed -i ‘/SELINUX/s/enforcing/disabled/‘/etc/selinux/config

# setenforce 0

# chkconfig iptables off

# service iptables stop

修改httpd配置并启动

# vim /etc/httpd/conf/httpd.conf

ServerName 127.0.0.1:80

# service httpd start

修改cobbler配置并启动

设置目标系统root密码

# PASSWORD=”`echo "zhangdh.com" |openssl passwd -1 -salt ‘randomstr‘ –stdin`”

# sed [email protected]"^default_password_crypted.*$"@"default_password_crypted:\"$PASSWORD\""@g /etc/cobbler/settings

设置cobbler server的IP

# sed -i ‘s/server: 127.0.0.1/server:10.240.216.1/g‘ /etc/cobbler/settings

设置DHCP server的IP

# sed -i ‘s/next_server:127.0.0.1/next_server: 10.240.216.1/g‘ /etc/cobbler/settings

设置允许cobbler管理DHCP

# sed -i ‘s/manage_dhcp: 0/manage_dhcp:1/g‘ /etc/cobbler/settings

设置允许cobbler管理rsync

# sed -i ‘s/manage_rsync: 0/manage_rsync:1/g‘ /etc/cobbler/settings

设置一次安装开关(可选)

# sed -i ‘s/pxe_just_once: 0/pxe_just_once:1/g‘ /etc/cobbler/settings

修改cobbler管理DHCP的模板

# cat /etc/cobbler/dhcp.template

ddns-update-style interim;

allow booting;

allow bootp;

ignore client-updates;

set vendorclass = optionvendor-class-identifier;

option pxe-system-type code 93 = unsignedinteger 16;

subnet 10.240.216.0 netmask 255.255.255.0 {

option routers            10.240.216.254;     #路由地址

#option domain-name-servers 8.8.8.8;                            #DNSserver地址

option subnet-mask        255.255.255.0;             #子网掩码

#rangedynamic-bootp        10.240.216.210.240.216.200;  #分配IP地址段

default-lease-time         21600;

max-lease-time             43200;

next-server               $next_server;

filename                  "pxelinux.0";

}

subnet 10.240.217.0 netmask 255.255.255.0 {

option routers            10.240.217.254;

option subnet-mask        255.255.255.0;

filename                  "/pxelinux.0";

default-lease-time         21600;

max-lease-time             43200;

next-server               $next_server;

}

注:可添加很多个子网...

启动cobbler

# service cobblerd start

校验cobbler安装条件

# cobbler check

更新loader信息

# cobbler get-loaders

修改xinetd关于tftp和rsync的配置并启动

# sed -i ‘/disable/c\\tdisable\t\t\t= no‘/etc/xinetd.d/tftp

# sed -i -e ‘s/\=\ yes/\=\ no/g‘/etc/xinetd.d/rsync

# service xinetd start

配置dhcp server并启动

# cat /etc/dhcp/dhcpd.conf

ddns-update-style interim;

allow booting;

allow bootp;

ignore client-updates;

set vendorclass = optionvendor-class-identifier;

option pxe-system-type code 93 = unsignedinteger 16;

#可以添加多子网(保持和dhcp.template一致)

subnet 10.240.216.0 netmask 255.255.255.0 {

option routers            10.240.216.254;

option subnet-mask        255.255.255.0;

filename                  "/pxelinux.0";

#rangedynamic-bootp        10.240.216.210.240.216.200;

default-lease-time         21600;

max-lease-time             43200;

next-server               10.240.216.1;

}

subnet 10.240.217.0 netmask 255.255.255.0 {

option routers            10.240.217.254;

option subnet-mask         255.255.255.0;

filename                  "/pxelinux.0";

default-lease-time         21600;

max-lease-time             43200;

next-server               10.240.216.1;

}

# group for Cobbler DHCP tag: default

group {

}

# service dhcpd start

修改debmirror.conf去掉仅对debian系统的支持参数

# sed -i "s/^@dists/#@dists/g"/etc/debmirror.conf

# sed -i "s/^@arches/#@arches/g"/etc/debmirror.conf

Cobbler配置同步

# service cobblerd restart

# cobbler sync

挂载安装镜像并导入distro

# mkdir /mnt/rhel6.5

# mkdir /mnt/rhel7.0

# mount -t iso9660 -o loop,ro/opt/rhel-server-6.5-x86_64-dvd.iso /mnt/rhel6.5

# cobbler import --name=redhat6.5--arch=x86_64 --path=/mnt/rhel6.5

查看生成的项目

# cobbler distro list

# cobbler profile list

查看项目明细

# cobbler report

自定义KS文件

# vim rhel6.5.ks

install

text

key --skip

keyboard us

lang en_US.UTF-8

skipx

network --device eth0 --bootproto dhcp

rootpw root

firewall --disabled

authconfig --enableshadow --enablemd5

selinux --disabled

timezone --utc Asia/Shanghai

url --url=$tree

$SNIPPET(‘network_config‘)

bootloader --location=mbr --driveorder=sda

zerombr yes

clearpart --all

part /boot --fstype ext4 --size=200

#part /    --fstype ext4 --size=20000

part swap --fstype swap --size=4096

#part /u01 --fstype ext4 --grow --size=200

reboot

%packages

@base

@core

@server-policy

ipmitool

OpenIPMI

openssh-clients

net-snmp

%post

将自定义的kickstart文件与镜像相关联

# cobbler profile edit--name=redhat6.5-x86_64 --distro=redhat6.5-x86_64--kickstart=/var/lib/cobbler/kickstarts/rhel6.5.ks

再次同步cobbler配置

# cobbler sync                         ###下面贴出完整信息,注意红色部分

task started: 2015-05-25_154818_sync

task started (id=Sync, time=Mon May 2515:48:18 2015)

running pre-sync triggers

cleaning trees

removing:/var/www/cobbler/images/redhat6.5-x86_64

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

removing: /var/lib/tftpboot/grub/efidefault

removing: /var/lib/tftpboot/grub/images

removing:/var/lib/tftpboot/images/redhat6.5-x86_64

removing:/var/lib/tftpboot/s390x/profile_list

copying bootloaders

trying hardlink/var/lib/cobbler/loaders/pxelinux.0 -> /var/lib/tftpboot/pxelinux.0

trying hardlink/var/lib/cobbler/loaders/menu.c32 -> /var/lib/tftpboot/menu.c32

trying hardlink /var/lib/cobbler/loaders/yaboot-> /var/lib/tftpboot/yaboot

trying hardlink/var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi

trying hardlink/var/lib/cobbler/loaders/grub-x86_64.efi ->/var/lib/tftpboot/grub/grub-x86_64.efi

copying distros to tftpboot

copying files for distro: redhat6.5-x86_64

trying hardlink/var/www/cobbler/ks_mirror/redhat6.5-x86_64/images/pxeboot/vmlinuz ->/var/lib/tftpboot/images/redhat6.5-x86_64/vmlinuz

trying hardlink/var/www/cobbler/ks_mirror/redhat6.5-x86_64/images/pxeboot/initrd.img ->/var/lib/tftpboot/images/redhat6.5-x86_64/initrd.img

copying images

generating PXE configuration files

generating PXE menu structure

copying files for distro: redhat6.5-x86_64

trying hardlink/var/www/cobbler/ks_mirror/redhat6.5-x86_64/images/pxeboot/vmlinuz ->/var/www/cobbler/images/redhat6.5-x86_64/vmlinuz

trying hardlink/var/www/cobbler/ks_mirror/redhat6.5-x86_64/images/pxeboot/initrd.img ->/var/www/cobbler/images/redhat6.5-x86_64/initrd.img

Writing template files for redhat6.5-x86_64

rendering DHCP files

generating /etc/dhcp/dhcpd.conf

rendering TFTPD files

generating /etc/xinetd.d/tftp

processing boot_files for distro:redhat6.5-x86_64

cleaning link caches

rendering Rsync files

running post-sync triggers

running python triggers from/var/lib/cobbler/triggers/sync/post/*

running python triggercobbler.modules.sync_post_restart_services

running: dhcpd -t -q

received on stdout:

received on stderr:

running: service dhcpd restart

received on stdout: Shutting down dhcpd: [  OK  ]

Starting dhcpd: [ OK  ]          <-- 必须要看到dhcpd服务启动才行

received on stderr:

running shell triggers from/var/lib/cobbler/triggers/sync/post/*

running python triggers from/var/lib/cobbler/triggers/change/*

running python trigger cobbler.modules.scm_track

running shell triggers from/var/lib/cobbler/triggers/change/*

*** TASK COMPLETE ***

<--到此就可以从一台新机器通过pxe启动系统了 -->

配置Cobbler的web管理界面

# yum -y install cobbler-web

# sed -i‘s/authn_denyall/authn_configfile/g‘ /etc/cobbler/modules.conf

# /etc/init.d/cobblerd restart

# /etc/init.d/httpd restart

访问地址:https://10.240.216.1/cobbler_web

时间: 2024-10-11 02:53:24

RHEL6.5上安装配置Cobbler的相关文章

CentOS上安装配置OpenVPN

CentOS6.7上安装配置OpenVPN 安装配置openvpn服务端 1.安装依赖 ntpdate pool.ntp.org yum -y install lzo lzo-devel-devel gcc pam-devel gcc-c++ 2.安装openvpn mkdir tools cd tools wget http://swupdate.openvpn.org/community/releases/openvpn-2.3.2.tar.gz tar xf openvpn-2.3.2.t

【ruby】【linux】【irb】CentOS上安装配置ruby开发环境,安装 irb

在读<理解Unix进程>这本书,书中代码是用Ruby写的,就自己想实践一下,搜来搜去要安装配置Ruby,我是centOS6.5的系统.下面这篇不错,我又加入了一点自己的理解和试验. 1 方法一:下载ruby的安装包来进行安装 1.安装编译环境gcc 使用yum install gcc在线安装 2.安装ruby开发环境 PS:经常在搜帖子的时候,大神的文章中都是随随便便下载个什么啊,又没告诉我这样的菜鸟到哪里下,让人几番周折,这里 下载 Ruby - Ruby 官方网站:https://www.

ubuntu16.04上安装配置DHCP服务的详细过程

DHCP服务器是为客户端机器分配IP地址的,所有分配的IP地址都保存在DHCP服务器的数据库中.为了在子网中实现DHCP分配IP地址,需要在目标主机上安装配置DHCP服务. 安装DHCP服务 安装isc-dhcp-server: $ sudo apt install isc-dhcp-server 配置DHCP服务 首先需要知道目标主机的网卡名称: $ ifconfig 得到以下信息: eno1 Link encap:Ethernet HWaddr e8:39:35:46:10:f5 UP BR

中标麒麟上安装配置达梦数据库7

在中标麒麟上安装配置达梦数据库7分为如下几步: 检查软硬件配置是否满足要求 规划安装目录及用户 配置环境变量及limit文件 挂载安装文件 安装数据库 创建数据库 注册并启动数据库实例服务 下面依次进行介绍. 1. 检查软硬件配置是否满足要求 1) 查看操作系统信息 Cat /etc/issue Uname -a Uname -m 需是达梦数据库支持的操作系统类型及版本. 2)  查看相关软件包是否正确安装 Rpm -aq | grep glibc 3) 检查CPU.内存等硬件信息 Cat /p

Cent OS 6.X 上安装配置samba

一.基本简介 SMB(Server Messages Block,信息服务块)是一种在局域网上共享文件和打印机的一种通信协议,它为局域网内的不同计算机之间提供文件及打印机等资源的共享服务.SMB协议是客户机/服务器型协议,客户机通过该协议可以访问服务器上的共享文件系统.打印机及其他资源.通过设置"NetBIOS over TCP/IP"使得Samba不但能与局域网络主机分享资源,还能与全世界的电脑分享资源. 二.SMB的由来 在早期网络世界当中,档案数据在不同主机之间的传输大多是使用

在CentOS 6.4上安装配置GlusterFS

背景介绍: 项目目前在文件同步方面采用的是rsync,在尝试用分布式文件系统替换的时候,使用过MooseFS,效果差强人意,在了解到了GlusterFS之 后,决定尝试一下,因为它跟MooseFS相比,感觉部署上更加简单一些,同时没有元数据服务器的特点使其没有单点故障的存在,感觉非常不错. 环境介绍: OS: CentOS 6.4 x86_64 Minimal Servers: sc2-log1,sc2-log2,sc2-log3,sc2-log4 Client: sc2-ads15 具体步骤:

在 CentOS 7.0 上安装配置 Ceph 存储

来自: https://linux.cn/article-6624-1.html Ceph 是一个将数据存储在单一分布式计算机集群上的开源软件平台.当你计划构建一个云时,你首先需要决定如何实现你的存储.开源的 Ceph 是红帽原生技术之一,它基于称为 RADOS 的对象存储系统,用一组网关 API 表示块.文件.和对象模式中的数据.由于它自身开源的特性,这种便携存储平台能在公有云和私有云上安装和使用.Ceph 集群的拓扑结构是按照备份和信息分布设计的,这种内在设计能提供数据完整性.它的设计目标就

Windows上安装配置SSH教程(7)——几种方式对比

服务端:Windows XP 客户端:Windows 10 由于Cygwin也可以安装OpenSSH,所以客户端其实可以直接使用Cygwin安装OpenSSH,那么在Windows下使用SCP(安全拷贝)有两种方式 ---------------- 方案1:图形界面,手动上传下载,可采用如下方式 服务端:OpenSSH for Windows 客户端:WinSCP,OpenSSH for Windows ---------------- 方案2:命令行,使用脚本自动上传下载,可采用如下方式 服务

Windows上安装配置SSH教程(8)——综合应用:在Windows上使用手动方式实现SSH远程登陆与文件传输

服务器端操作系统:Windows XP 客户端操作系统:Windows10 安装与配置顺序 1.服务端安装OpenSSH 2.服务端配置OpenSSH 3.客户端安装OpenSSH 4.客户端安装WinSCP 下面逐步介绍安装配置方法 说明:局域网内,请先用交换机把计算机连接起来,设置好IP地址. 1.服务端安装OpenSSH 下载安装包:https://sourceforge.net/projects/sshwindows/ 除了修改软件的安装目录其他都是一路默认选项,Next到最后. 2.服