cobbler安装(详细版)

1、系统环境

centos-6.4

ipaddr: 10.240.240.114 gateway:10.240.240.1

2、关闭selinux  (关闭完之后最好进行一次重启)

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

关闭防火墙

chkconfig iptables off

3、 配置obbler yum源

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

4、安装Cobbler基础包

yum install -y cobbler tftp dhcp httpd cman pykickstart debmirror

5、安装Cobbler依赖包

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

6、将基础的服务配置成开机自启动

chkconfig httpd on

chkconfig dhcpd on

chkconfig xinetd on

chkconfig cobblerd on

7、修改httpd配置文件并启动httpd

vim /etc/httpd/conf/httpd.conf

ServerName 127.0.0.1:80

启动httpd进程

service httpd start

查看http进程启动情况

netstat -ntulp | grep :80

8、启动Cobbler服务并执行检查命令

[[email protected] ~]# service cobblerd start

Starting cobbler daemon: [  OK  ]

[[email protected] ~]# cobbler check

The following are potential configuration items that you may want to fix:

1 : The ‘server‘ field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work.  This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.

2 : For PXE to be functional, the ‘next_server‘ field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.

3 : some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run ‘cobbler get-loaders‘ to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely.  Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The ‘cobbler get-loaders‘ command is the easiest way to resolve these requirements.

4 : change ‘disable‘ to ‘no‘ in /etc/xinetd.d/rsync

5 : comment out ‘dists‘ on /etc/debmirror.conf for proper debian support

6 : comment out ‘arches‘ on /etc/debmirror.conf for proper debian support

7 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to ‘cobbler‘ and should be changed, try: "openssl passwd -1 -salt ‘random-phrase-here‘ ‘your-password-here‘" to generate new one

Restart cobblerd and then run ‘cobbler sync‘ to apply changes.

修改上面错误的方法如下:

(1).错误1,修改/etc/cobbler/settings 里面的 server 为Cobbler Server的IP地址 ;

[[email protected] ~]  vim /etc/cobbler/settings

server: 10.240.240.114

(2).错误2,修改/etc/cobbler/settings 里面的 next_serverw 为本机的 ip;

[[email protected] ~] vim /etc/cobbler/settings

next_server: 10.240.240.114

(3).错误3,据说这个错误可以忽略,有强迫完美运行症的人士可以运行以下命令来解决;

[[email protected] ~]cobbler get-loaders

(4).错误4,修改/etc/xinetd.d/tftp 把‘disable‘ 修改为‘no‘;修改/etc/xinetd.d/rsync 把‘disable‘ 修改为‘no‘;

[[email protected] ~]# vim /etc/xinetd.d/tftp

disable     = no

[[email protected] ~]# vim /etc/xinetd.d/rsync

disable = no

再次启动xinetd服务。

[[email protected] ~]# service xinetd start

正在启动 xinetd:           [确定]

(5).错误5与错误6,debmmirror有错误;

[[email protected] ~]# vim /etc/debmirror.conf

#注释掉@dists="sid"与@arches="i386即可

#@dists="sid";

#@arches="i386";

(6).错误7,设置默认root密码;

注,刚接触Cobbler的博友会问,这个密码是什么密码。有的博友系统安装好了会问,root密码是什么。这里设置的就是客户端安装好系统的root密码。

注,生成你想要的密码的加密字符串,然后复制运行命令之后的加密代码;

[[email protected] ~]# openssl passwd -1 -salt ‘hahaha‘ ‘jiayuan.com‘

$1$hahaha$hSxFjZSHRoiEn4DYrrGUI.

注,然后替换/etc/cobbler/settings 中选项双引号中的加密代码;

[[email protected] ~]# vim /etc/cobbler/settings

default_password_crypted: "$1$hahaha$hSxFjZSHRoiEn4DYrrGUI."

9.重新启动Cobbler并运行检查命令

[[email protected] ~]# service cobblerd restart

Stopping cobbler daemon: [  OK  ]

Starting cobbler daemon: [  OK  ]

检查cobbler

[[email protected] ~]# cobbler check

No configuration problems found.  All systems go.

10、修改DHCP模板

首先修改cobbler配置,让cobbler来管理dhcp服务,编辑文件/etc/cobbler/settings

manage_dhcp: 1

接下来修改/etc/cobbler/dhcp.template,此文件是cobbler管理dhcp的模板

[[email protected] ~]# vim /etc/cobbler/dhcp.template

subnet 10.240.240.0 netmask 255.255.255.0 {

option routers             10.240.240.1;

option domain-name-servers 10.240.210.98;

option subnet-mask         255.255.255.0;

range dynamic-bootp        10.240.240.220 10.240.240.240;

default-lease-time         21600;

max-lease-time             43200;

next-server                $next_server;

11、执行一下同步操作并检查配置文件

[[email protected] ~]# cobbler sync

task started: 2014-05-13_054240_sync

task started (id=Sync, time=Tue May 13 05:42:40 2014)

running pre-sync triggers

cleaning trees

mkdir: /var/lib/tftpboot/pxelinux.cfg

mkdir: /var/lib/tftpboot/grub

mkdir: /var/lib/tftpboot/s390x

mkdir: /var/lib/tftpboot/ppc

mkdir: /var/lib/tftpboot/etc

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

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 /usr/share/syslinux/memdisk -> /var/lib/tftpboot/memdisk

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

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

copying distros to tftpboot

copying images

generating PXE configuration files

generating PXE menu structure

rendering TFTPD files

generating /etc/xinetd.d/tftp

cleaning link caches

running post-sync triggers

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

running python trigger cobbler.modules.sync_post_restart_services

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 ***

再次检查cobbler没问题发现

[[email protected] ~]# cobbler check

No configuration problems found.  All systems go.

12、把镜像挂载的目录

[[email protected] ~]# mkdir /mnt/cdrom

[[email protected] ~]# mount -o loop /dev/sr0 /mnt/cdrom/

[[email protected] ~]# cd /mnt/cdrom/

[[email protected] cdrom]# ls

EFI               RELEASE-NOTES-as-IN.html  RELEASE-NOTES-kn-IN.html  RELEASE-NOTES-te-IN.html

EULA              RELEASE-NOTES-bn-IN.html  RELEASE-NOTES-ko-KR.html  RELEASE-NOTES-zh-CN.html

GPL               RELEASE-NOTES-de-DE.html  RELEASE-NOTES-ml-IN.html  RELEASE-NOTES-zh-TW.html

HighAvailability  RELEASE-NOTES-en-US.html  RELEASE-NOTES-mr-IN.html  repodata

images            RELEASE-NOTES-es-ES.html  RELEASE-NOTES-or-IN.html  ResilientStorage

isolinux          RELEASE-NOTES-fr-FR.html  RELEASE-NOTES-pa-IN.html  RPM-GPG-KEY-redhat-beta

LoadBalancer      RELEASE-NOTES-gu-IN.html  RELEASE-NOTES-pt-BR.html  RPM-GPG-KEY-redhat-release

media.repo        RELEASE-NOTES-hi-IN.html  RELEASE-NOTES-ru-RU.html  ScalableFileSystem

Packages          RELEASE-NOTES-it-IT.html  RELEASE-NOTES-si-LK.html  Server

README            RELEASE-NOTES-ja-JP.html  RELEASE-NOTES-ta-IN.html  TRANS.TBL

13、cobbler导入镜像

[[email protected] ~]# cobbler import --path=/mnt/cdrom --name=Redhat-6.3 --arch=x86_64

task started: 2014-05-13_054601_import

task started (id=Media import, time=Tue May 13 05:46:01 2014)

Found a candidate signature: breed=redhat, version=rhel6

Found a matching signature: breed=redhat, version=rhel6

Adding distros from path /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64:

creating new distro: Redhat-6.3-x86_64

trying symlink: /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64 -> /var/www/cobbler/links/Redhat-6.3-x86_64

creating new profile: Redhat-6.3-x86_64

associating repos

checking for rsync repo(s)

checking for rhn repo(s)

checking for yum repo(s)

starting descent into /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64 for Redhat-6.3-x86_64

processing repo at : /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64

need to process repo/comps: /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64

looking for /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/repodata/*comps*.xml

Keeping repodata as-is :/var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/repodata

processing repo at : /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/Server

need to process repo/comps: /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/Server

looking for /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/Server/repodata/*comps*.xml

Keeping repodata as-is :/var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/Server/repodata

processing repo at : /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/HighAvailability

need to process repo/comps: /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/HighAvailability

looking for /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/HighAvailability/repodata/*comps*.xml

Keeping repodata as-is :/var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/HighAvailability/repodata

processing repo at : /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/LoadBalancer

need to process repo/comps: /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/LoadBalancer

looking for /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/LoadBalancer/repodata/*comps*.xml

Keeping repodata as-is :/var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/LoadBalancer/repodata

processing repo at : /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/ResilientStorage

need to process repo/comps: /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/ResilientStorage

looking for /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/ResilientStorage/repodata/*comps*.xml

Keeping repodata as-is :/var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/ResilientStorage/repodata

processing repo at : /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/ScalableFileSystem

need to process repo/comps: /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/ScalableFileSystem

looking for /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/ScalableFileSystem/repodata/*comps*.xml

Keeping repodata as-is :/var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/ScalableFileSystem/repodata

*** TASK COMPLETE ***

查看cobbler列表

[[email protected] ~]#  cobbler list

distros:

Redhat-6.3-x86_64

profiles:

Redhat-6.3-x86_64

systems:

repos:

images:

mgmtclasses:

packages:

files:

14、查看一下导入镜像的详细信息

[[email protected] ~]# cobbler report

distros:

==========

Name                           : Redhat-6.3-x86_64

Architecture                   : x86_64

TFTP Boot Files                : {}

Breed                          : redhat

Comment                        :

Fetchable Files                : {}

Initrd                         : /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/images/pxeboot/initrd.img

Kernel                         : /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/images/pxeboot/vmlinuz

Kernel Options                 : {}

Kernel Options (Post Install)  : {}

Kickstart Metadata             : {‘tree‘: ‘http://@@[email protected]@/cblr/links/Redhat-6.3-x86_64‘}

Management Classes             : []

OS Version                     : rhel6

Owners                         : [‘admin‘]

Red Hat Management Key         : <<inherit>>

Red Hat Management Server      : <<inherit>>

Template Files                 : {}

profiles:

==========

Name                           : Redhat-6.3-x86_64

TFTP Boot Files                : {}

Comment                        :

DHCP Tag                       : default

Distribution                   : Redhat-6.3-x86_64

Enable gPXE?                   : 0

Enable PXE Menu?               : 1

Fetchable Files                : {}

Kernel Options                 : {}

Kernel Options (Post Install)  : {}

Kickstart                      : /var/lib/cobbler/kickstarts/sample_end.ks

Kickstart Metadata             : {}

Management Classes             : []

Management Parameters          : <<inherit>>

Name Servers                   : []

Name Servers Search Path       : []

Owners                         : [‘admin‘]

Parent Profile                 :

Proxy                          :

Red Hat Management Key         : <<inherit>>

Red Hat Management Server      : <<inherit>>

Repos                          : []

Server Override                : <<inherit>>

Template Files                 : {}

Virt Auto Boot                 : 1

Virt Bridge                    : xenbr0

Virt CPUs                      : 1

Virt Disk Driver Type          : raw

Virt File Size(GB)             : 5

Virt Path                      :

Virt RAM (MB)                  : 512

Virt Type                      : kvm

systems:

==========

repos:

==========

images:

==========

mgmtclasses:

==========

packages:

==========

files:

==========

15、自定义kickstart文件

[[email protected] ~]# cd /var/lib/cobbler/kickstarts/

[[email protected] kickstarts]# vi redhat-6.3.ks  (名字可以自己定义)

install

#nfs --server=10.240.240.210 --dir=/mnt/cdrom

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=8192

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

reboot

%packages

@base

@core

@server-policy

ipmitool

OpenIPMI

openssh-clients

net-snmp

%post

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

[[email protected] ~]#   cobbler profile edit --name=Redhat-6.3-x86_64 --distro=Redhat-6.3-x86_64 --kickstart=/var/lib/cobbler/kickstarts/redhat-6.3.ks

[[email protected] ~]# cobbler report

17、同步一下cobbler

[[email protected] ~]# cobbler sync

task started: 2014-05-13_082354_sync

task started (id=Sync, time=Tue May 13 08:23:54 2014)

running pre-sync triggers

cleaning trees

removing: /var/www/cobbler/images/Redhat-6.3-x86_64

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

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

removing: /var/lib/tftpboot/grub/grub-x86_64.efi

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

removing: /var/lib/tftpboot/grub/grub-x86.efi

removing: /var/lib/tftpboot/images/Redhat-6.3-x86_64

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

copying bootloaders

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

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

copying distros to tftpboot

copying files for distro: Redhat-6.3-x86_64

trying hardlink /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/Redhat-6.3-x86_64/vmlinuz

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

copying images

generating PXE configuration files

generating PXE menu structure

copying files for distro: Redhat-6.3-x86_64

trying hardlink /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/images/pxeboot/vmlinuz -> /var/www/cobbler/images/Redhat-6.3-x86_64/vmlinuz

trying hardlink /var/www/cobbler/ks_mirror/Redhat-6.3-x86_64/images/pxeboot/initrd.img -> /var/www/cobbler/images/Redhat-6.3-x86_64/initrd.img

Writing template files for Redhat-6.3-x86_64

rendering DHCP files

generating /etc/dhcp/dhcpd.conf

rendering TFTPD files

generating /etc/xinetd.d/tftp

processing boot_files for distro: Redhat-6.3-x86_64

cleaning link caches

running post-sync triggers

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

running python trigger cobbler.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 ***

[[email protected] ~]#

cobbler安装(详细版)

时间: 2024-12-23 00:21:33

cobbler安装(详细版)的相关文章

cobbler 安装搭建,详细

一. cobbler安装准备 1. 关闭iptables与selinux 1 # chkconfig iptables off 2 # vi /etc/selinux/config SELINUX=disabled 2. 安装源准备并安装cobbler软件 说明:基础源与epel源. rpm –ivh  http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm (要装32位机器可以打开网页选择合

phpStudy模式下安装ssl证书,详细版

phpStudy模式下安装ssl证书,详细版 2017年12月16日 14:27:38 骑着蚂蚁追大象 阅读数:4232 标签: phpstudy安装ssl证书 更多 个人分类: php 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/qq_36176250/article/details/78819744 在安装之前,需要先去申请SSL证书,我用的是腾讯提供的域名型免费的,你们也可以试试,5分钟左右就可以申请成功. 申请地址:https://c

centos 7 下 cobbler 安装

一.cobbler 介绍: Cobbler 是一个系统启动服务(boot server),可以通过网络启动(PXE)的方式用来快速安装.重装物理服务器和虚拟机,支持安装不同的 Linux 发行版和 Windows.该工具使用python开发,小巧轻便(才15k行代码),使用简单的命令即可完成PXE网络安装环境的配置,同时还可以管理 DHCP,DNS,以及yum包镜像. Linux学习,http:// linux.it.net.cn Cobbler 使用命令行方式管理,也提供了基于 Web 的界面

cobbler安装centos系统

整个安装系统的流程与pxe还是一样的,只不过由手动变成了自动,各个版本之间也更好管理. 这里还是centos系统的.cobbler的大致基础使用. 环境: 平台:VirtualBox 虚拟机 服务机:CentOS7 所安装的系统:CentOS7, CentOS6 cobbler里面有几个概念要首先了解一下: distro: 用来标识一个发行版.因为安装不同版本的系统起码要用不同的内核与initrd来启动安装程序.这个就是用来区分它们的.注意distro主要是来标识不同的内核与initrd,与整个

利用apache+svn+jenkins+maven 实现java环境的自动化构建和部署(四)(网内首发超详细版)

6安装maven 下载地址:http://maven.apache.org/download.cgi 解压安装 unzip –o apache-maven-3.2.1-bin.zip mv apache-maven-3.2.1 maven 配置环境变量 MAVEN_HOME=/usr/local/maven export PATH=$MAVEN_HOME/bin:$PATH 7 java环境自动构建部署 7.1 新建job 输入名称如下图 输入SVN服务器地址 注意:上面已经认证过了,因此没有报

利用apache+svn+jenkins+maven 实现java环境的自动化构建和部署(一)(网内首发超详细版)

目录结构如下: 目录 1说明及环境介绍3 1.1说明3 1.2环境准备及格式约定4 2 Linux下apache搭建svn服务器4 2.1 apache安装部署4 2.2 svn安装部署5 2.3整合svn和apache6 2.4 ssl方式部署apache7 2.4.1安装apache7 2.4.2安装svn7 2.4.2 部署认证8 3 Linux下svn独立服务器方式部署9 3.1安装SVN9 3.2 配置环境10 3.3 权限配置样例11 3.4 启动SVN服务器12 3.5 访问方式1

利用apache+svn+jenkins+maven 实现java环境的自动化构建和部署(二)(网内首发超详细版)

2.4 ssl方式部署apache 2.4.1安装apache ./configure --prefix=/usr/local/apache2 --enable-dav --enable-ssl--enable-so --enable-mods-shared=all make && make install 2.4.2安装svn 安装apr-1.4.6.tar.gz.apr-util-1.5.1.tar.gz.neon-0.29.6.tar.gz同2.2章节部分 unzip sqlite-

利用apache+svn+jenkins+maven 实现java环境的自动化构建和部署(三)(网内首发超详细版)

3.3 权限配置样例 注意: * 权限配置文件中出现的用户名必须已在用户配置文件中定义. * 对权限配置文件的修改立即生效,不必重启svn. 用户组格式: [groups] = , 其中,1个用户组可以包含1个或多个用户,用户间以逗号分隔. 版本库目录格式: [<版本库>:/项目/目录] @<用户组名> = <权限> <用户名> = <权限> 其中,方框号内部分可以有多种写法: [/],表示根目录及以下,根目录是svnserve启动时指定的,我们

利用apache+svn+jenkins+maven 实现java环境的自动化构建和部署(五)(网内首发超详细版)

8 Subversion FAQ 8.1 官方FAQ网址 http://subversion.apache.org/faq.zh.html 8.2 svn遇到错误总结 8.2.1 svn不显示日志 解决办法:1)找到你SVN版本库下conf文件夹下的svnserve.conf文件2)打开svnserve.conf文件,将其中名为anon-access的一项设置为anon-access=none. 这样的话,日志文件即可显示正常. 8.2.2 版本冲突问题 svn update --usernam