cobbler基础安装

epel源安装
rpm -ivh epel-release-6-8.noarch.rpm
yum -y install cobbler httpd rsync tftp-server xinetd dhcp cobbler-web koan pykickstart* fence-agents* debmirror syslinux
$$$$$$$$$$$启动cobbler服务
/etc/init.d/cobblerd start
$$$$$$$$启动httpd服务
/etc/init.d/httpd start
$$$$$$$$$$检测
cobbler check
$$$$$$$$$$$$$问题1:
Traceback (most recent call last):
  File "/usr/bin/cobbler", line 36, in <module>
    sys.exit(app.main())
  File "/usr/lib/python2.6/site-packages/cobbler/cli.py", line 657, in main
    rc = cli.run(sys.argv)
  File "/usr/lib/python2.6/site-packages/cobbler/cli.py", line 270, in run
    self.token         = self.remote.login("", self.shared_secret)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1253, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1392, in _parse_response
    return u.close()
  File "/usr/lib64/python2.6/xmlrpclib.py", line 838, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 1: "<class ‘cobbler.cexceptions.CX‘>:‘login failed‘">
$$$$$$$$$$$$解决方法:
service cobblerd restart
cobbler get-loaders
$$$$$$$$$$$$$$$$$$$问题2:
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 :you need to set some SELinux content rules to ensure cobbler works correctly in your SELinux environment, run the following:
      /usr/sbin/semanage fcontext -a -t public_content_t "/tftpboot/.*" && \
      /usr/sbin/semanage fcontext -a -t public_content_t "/var/www/cobbler/images/.*"
5 : change ‘disable‘ to ‘no‘ in /etc/xinetd.d/rsync
    change ‘disable‘ to ‘no‘ in /etc/xinetd.d/tftp
6 : comment out ‘dists‘ on /etc/debmirror.conf for proper debian support
    comment out ‘arches‘ on /etc/debmirror.conf for proper debian support
7 :since iptables may be running, ensure 69, 80, and 25151 are unblocked
8 : The default pass<a href="http://www.it165.net/edu/ebg/" target="_blank" class="keylink">word</a> used by the sample templates for newly installed machines (default_pass<a href="http://www.it165.net/edu/ebg/" target="_blank" class="keylink">word</a>_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.
9,debmirror package is not installed, it will be required to manage debian deployments and repositories
$$$$$$$$$$$$$$$$$$$$$上面这段信息大意就是:
1,编辑/etc/cobbler/settings文件,找到 server:选项,修改为适当的ip地址,本实例配置ip为:192.168.10.1
2,编辑/etc/cobbler/settings文件,找到 next_server:选项,修改为适当的ip地址,本实例配置ip为:192.168.10.1
4,SELinux的设置。如果上面已经关闭了SELinux就不用管了,SELinux的设置。如果上面已经关闭了SELinux就不用管了
3,执行 cobbler get-loaders,系统将自动下载loader程序,完成提示4的修复工作。
5,编辑/etc/xinetd.d/tftp文件,将文件中的disable字段的配置由yes改为no
   编辑/etc/xinetd.d/rsync文件,将文件中的disable字段的配置由yes改为no
6. 在/etc/debmirror.conf文件中注释dists和arches
7,在iptables中将69,80,25151端口打开。如果仅仅只是在内部环境中使用,建议直接将防火墙关掉
9,提示说debmirror没安装。如果不是安装 debian之类的系统,此提示可以忽略,如果需要安装,下载地址为:
http://rpmfind.net/linux/rpm2html/search.php?query=debmirror
CentOS 6使用RHEL 5的包就可以。
8,修改cobbler用户的默认密码,可以使用如下命令生成密码,并使用生成后的密码替换/etc/cobbler/settings    (default_password_crypted: )中的密码。生成密码命令:
openssl passwd -1 -salt ‘用户‘ ‘密码‘
其中“random-phrase-here”为干扰码
$$$$$$$$$$$$$$$$$$$$$解决方案:
1.vim /etc/cobbler/settings
      server: 192.168.1.20
2.vim /etc/cobbler/settings
      next_server: 192.168.1.20
3.  cobbler get-loaders
4.vim /etc/sysconfig/selinuc
      SELINUX=disabled
5. vim /etc/xinetd.d/rsync
      disable = no
   vim /etc/xinetd.d/tftp
      disable = no
   service xinetd start
6.vim /etc/debmirror.conf
     #@dists="sid";
     #@arches="i386";
7./etc/init.d/iptables stop或
  iptables -F
  iptables -X
  /etc/init.d/iptables save
8. openssl passwd -1 -salt ‘maishujie‘ ‘123456‘
     $1$maishujie$MqApDf9CDu.SNuvbG/ju70
 vim /etc/cobbler/settings
default_password_crypted: "$1$maishujie$MqApDf9CDu.SNuvbG/ju70"
9.忽略
如遇到其他问题根据错误提示解决
/etc/init.d/cobbler restart
cobbler sync
cobbler check
显示No configuration problems found.  All systems go.及为正常

$$$$$$$$$$$$$$查询启动端口netstat -ntulp
######################cobbler的使用
vim /etc/cobbler/settings
mange_dhcp: 1
mange_tftpd:1
pxe_just_once:1

$$$$$$$$$$$$$$$$$$$$定制dhcp模板(Ifconfig eth0:0 192.168.10.254/24)
vi /etc/cobbler/dhcp.template
subnet 192.168.10.0 netmask 255.255.255.0 {
     option routers             192.168.10.254;
     option domain-name-servers 202.106.0.20;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.10.100 192.168.10.200;
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                $next_server;
     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";
          }
     }

}

$$$$$$$$$$$$$$$$重启服务器 /etc/init.d/cobbler restart
cobbler sync
more /etc/dhcp/dhcpd.conf 验证模板更新
more /etc/xinetd.d/tftp

$$$$$$$$$$$建立目录
yum -y install lrzsz
放置ios文件目录mkdir -pv /data/iso
     rz选择iso文件上传
挂载目录mkdir /data/sys/centos6.4_64
挂载 mount -o loop /data/iso/CentOS-6.4-x86_64-bin-DVD1.iso /data/centos6.4_64
ks文件放置目录mkdir /data/ks/centos6.4_64
       rz选择ks文件上传
$$$$$$$$$$$$导入安装文件
 cobbler import --path=/data/sys/centos6.4_64/ --name=centos6.4_64 --kickstart=/data/ks/centos6.4_64/ks.cfg --arch=x86_64
显示
task started: 2015-08-14_010049_import
task started (id=Media import, time=Fri Aug 14 01:00:49 2015)
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/centos6.4_i386-x86_64:
creating new distro: centos6.4-x86_64
trying symlink: /var/www/cobbler/ks_mirror/centos6.4_i386-x86_64 -> /var/www/cobbler/links/centos6.4-x86_64
creating new profile: centos6.4-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/centos6.4_i386-x86_64 for centos6.4-x86_64
processing repo at : /var/www/cobbler/ks_mirror/centos6.4_i386-x86_64
need to process repo/comps: /var/www/cobbler/ks_mirror/centos6.4_i386-x86_64
looking for /var/www/cobbler/ks_mirror/centos6.4_i386-x86_64/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/centos6.4_i386-x86_64/repodata
*** TASK COMPLETE ***
从上面显示信息所知,cobbler会将镜像中的拷贝到本地一份,放在/var/www/cobbler/ks_mirrors下的centos- 6.0-i386目录下。同时会创建一个名字为centos-6.0-i386的一个发布版本,以及一个名字为centos-6.0-i386的 profile文件。

service xinetd restart
$$$$$$$$$$$$$$$同步cobbler配置
# cobbler sync
显示
ask started: 2011-08-11_170706_sync
task started (id=Sync, time=Thu Aug 11 17:07:06 2011)
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/images/centos-6.0-i386
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/grub-x86.efi
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/grub/grub-x86_64.efi
removing: /var/lib/tftpboot/images/centos-6.0-i386
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
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
copying files for distro: centos-6.0-i386
trying hardlink /var/www/cobbler/ks_mirror/centos-6.0-i386/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/centos-6.0-i386/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/centos-6.0-i386/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/centos-6.0-i386/initrd.img
trying hardlink /var/www/cobbler/ks_mirror/centos-6.0-i386/images/pxeboot/vmlinuz -> /var/www/cobbler/images/centos-6.0-i386/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/centos-6.0-i386/images/pxeboot/initrd.img -> /var/www/cobbler/images/centos-6.0-i386/initrd.img
copying images
generating PXE configuration files
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
cleaning link caches
generating PXE menu structure
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: /etc/rc.d/init.d/dhcpd restart
received on stdout: Shutting down dhcpd: [  OK  ]
Starting dhcpd: [  OK  ]

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 ***
cobbler会自动进行初始化工作,移除已经存在的启动项,然后根据模板拷贝loader文件。之后再生成pxe的配置文件,生成dhcp的配置文件,最后再重启dhcp服务。
至此,就可以使用虚拟机来测试cobbler安装了。

时间: 2024-10-20 01:19:26

cobbler基础安装的相关文章

使用Cobbler批量安装操作系统

个人博客地址:http://www.pojun.tech/ 欢迎访问 前言 在实际生产中,我们常常会遇到这样一种情况,就是我们需要同时安装几十甚至上百台服务器,如果我们使用U盘或者光盘的方式的话,或许老板直接就将我们辞退了.这里我们介绍一种能够实现自动化安装操作系统的方式. 我们搭建Cobbler的实验环境是基于CentOS 7.3 -1611 的基础的. 同时这个实验可以帮助你一步步的完成所有的操作,不过,如果你想自定义安装的内容的话,建议你先看本文 自定义kickstart文件 部分,以便有

cobbler 无人值守安装出现 PXE-E32:TFTP OPen timeout的解决办法

cobbler   无人值守安装出现 PXE-E32:TFTP OPen timeout的解决办法 用cobber pxe 安装系统的时候 出现 PXE-E32:TFTP OPen timeout 查找PXE启动芯片出错代码表,是说tftp没有运行 PXE-E32:TFTP open timeout TFTP"Open"请求没有应答,验证TFTP服务是否正在运行. 重启xinetd服务,并确定端口以内监听,还是有这个问题 [[email protected] /]# service x

cobbler批量安装linux(centos6.5)

1.安装 cobbler (1).安装第三方软件库所需要的包 #cd /tmp #wget  http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm #rpm -ivh epel-release-6-8.noarch.rpm (2).安装 dhcp #yum -y install dhcp (3). 安装其他的相关软件 #yum -y install tftp rsync xinetd httpd (

COBBLER无人值守安装

1. Cobbler介绍 Cobbler是一个Linux服务器安装的服务,可以通过网络启动(PXE)的方式来快速安装.重装物理服务器和虚拟机,同时还可以管理DHCP,DNS等. Cobbler可以使用命令行方式管理,也提供了基于Web的界面管理工具(cobbler-web),还提供了API接口,可以方便二次开发使用. Cobbler是较早前的kickstart的升级版,优点是比较容易配置,还自带web界面比较易于管理. Cobbler内置了一个轻量级配置管理系统,但它也支持和其它配置管理系统集成

使用Cobbler自动化安装Centos

一.准备工作 [[email protected] ~]# iptables -nL Chain INPUT (policy ACCEPT) target     prot opt source               destination          Chain FORWARD (policy ACCEPT) target     prot opt source               destination          Chain OUTPUT (policy ACCE

Cobbler无人值守安装系统史上最细实践文档

本文档来自老男孩教育VIP课程 内部学员总结笔记文档笔记内容,和大家分享! 老男孩教育2016年全干货博客,http://blog.oldboyedu.com Cobbler无人值守安装系统史上最细实践文档 http://blog.oldboyedu.com/autoinstall-cobbler/

WebServer 之apache(httpd2.2和httpd2.4)基础安装部署

一.Httpd2.2基础安装部署 1.httpd-2.2软件的基础配置说明: 2.HTTPD配置练习 1)修改监听的地址端口: 2)持久连接配置 3)MPM机制配置 4)DSO:支持动态装载和卸载 5)'Main' Server'配置 6)站点资源访问控制 7) 定义站点主页面 8) 定义路径别名: 9)日志设定 10)httpd-manual 手册软件 11)基于用户的访问控制机制 12)虚拟主机 13)status页面:httpd程序自带的能够不断的反馈刷新的方式显示内部状态页面 14)cu

Cobbler自动安装的Linux系统ssh无法进入

Linux ssh登陆老提示“permission denied,please try again” ,但是iptables已经关掉了 修改/etc/ssh/sshd_config文件.找如下的一句 #PermitRootLogin yes 改为如下的 PermitRootLogin yes 注意,要把前面的#号去掉. 重启sshd服务器 # service sshd restart Cobbler自动安装的Linux系统ssh无法进入,布布扣,bubuko.com

Nagios监控基础安装与监控项部署(上)

前言:NAGIOS介绍: Nagios是一款开源的电脑系统和网络监视工具,能有效监控Windows.Linux和Unix的主机状态,交换机路由器等网络设置,打印机等.在系统或服务状态异常时发出邮件或短信报警第一时间通知网站运维人员,在状态恢复后发出正常的邮件或短信通知. 主要功能 (1)网络服务监控(SMTP.POP3.HTTP.NNTP.ICMP.SNMP.FTP.SSH) (2)主机资源监控(CPU load.diskusage.system logs),也包括Windows主机(使用NSC