cobbler安装时被装机器无法获取kickstart文件

小小鸟蛋 发布于 2017/06/09 15:47
阅读 586
收藏 0

安装系统时,被装机器无法获取kickstart文件,剧情情况见截图。

求解。

不太懂http,报500错误

 

在cobbler主机上执行curl命令,取不到kickstart文件,返回如下信息。

环境:RHEL7.1

UMASK:027

防火墙  selinux关闭

安装过程:

 

1、配置系统软件包环境
#yum –y install vim  net-tools 
#默认centos7.0最小化安装没有ifconfig net-tools生成ifconfig

2、安装依赖软件包
yum -y install createrepo httpd mkisofs python-netaddr python-urlgrabber rsync syslinux tftp-server yum-utils mod_ssl mod_wsgi git make python-devel python-setuptools fence-agents pykickstart dhcp rpm-build edpatch perl-Compress-Zlib perl-libwww-perl perl-Digest-SHA

#############################################################################
                        开始安装cobbler2.6.9
#############################################################################
1.安装PyYAML
下载地址: http://pyyaml.org/download/pyyaml/PyYAML-3.11.tar.gz
#tar -zxvf PyYAML-3.11.tar.gz -C /usr/src/
#cd /usr/src/PyYAML-3.11/
#python setup.py install
  
2.安装Django
下载地址: https://pypi.python.org/packages/source/D/Django/Django-1.8.4.tar.gz
#tar -zxvf Django-1.8.4.tar.gz -C /usr/src/
#cd /usr/src/Django-1.8.4
#python setup.py install
3.安装Markdown
下载地址: https://pypi.python.org/packages/source/M/Markdown/Markdown-2.6.2.tar.gz
# tar -zxvf Markdown-2.6.2.tar.gz -C /usr/src/
#cd /usr/src/Markdown-2.6.2
#python setup.py install
4.安装Cheetah
下载地址: https://pypi.python.org/packages/source/C/Cheetah/Cheetah-2.4.4.tar.gz
#tar -zxvf Cheetah-2.4.4.tar.gz  -C /usr/src
#cd /usr/src/Cheetah-2.4.4
#python setup.py install
5.安装simplejson
下载地址:https://pypi.python.org/packages/source/s/simplejson/simplejson-3.8.0.tar.gz
# tar -zxvf simplejson-3.8.0.tar.gz -C /usr/src
#cd /usr/src/simplejson-3.8.0/
#python setup.py install
  
6.安装cobbler
下载地址: https://github.com/cobbler/cobbler/releases/tag/v2.6.9
#tar -zxvf cobbler-2.6.9.tar.gz  -C /usr/src
#cd /usr/src/cobbler-2.6.9
# make && make install
#mkdir /var/www/cobbler/web
#mkdir -p  /srv/www/cobbler/svc
#make webtest                    干鸡毛用的

3)配置cobbler

1.配置cobbler
修改cobbler的Server配置文件
vim /etc/cobbler/settings
242 manage_dhcp: 1
261 manage_rsync: 1
272 next_server: 192.168.0.1 (IP修改成本机地址)
384 server: 192.168.0.1 (IP修改成本机地址)
(配置开机登录密码)
#openssl passwd -1 -salt 'root' '11111111' 
#root用户名,11111111是系统登录密码 (修改/etc/cobbler/settings文件)
101 default_password_crypted: " $1$root$46Dy7n8T8GRp0Mont0Mcw1"

2.配置dhcpd  /etc/cobbler/dhcp.template
subnet 192.168.2.0 netmask 255.255.255.0 {                   (添加作用域)
     option routers             192.168.2.100;                (dhcp主机地址)
     option domain-name-servers 192.168.2.100;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.2.110 192.168.2.254;    (要分配IP地址池)
     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";
          }
     }

}
                            dhcp服务出错
3、修改/etc/cobbler/tftpd.template文件
[root@localhost ~]# vi /etc/cobbler/tftpd.template
# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.
service tftp
{
        disable                 = yes     (改为no)
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = $user
        server                  = $binary
        server_args             = -B 1380 -v -s $args
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}

#systemctl restart cobblerd

get-loaders下载(需要开公网,如果没有开通公网就按照下面的方法将文件导入相关目录)
[root@localhost ~]# cobbler get-loaders
task started: 2016-05-27_100642_get_loaders
task started (id=Download Bootloader Content, time=Fri May 27 10:06:42 2016)
downloading http://cobbler.github.com/loaders/README to /var/lib/cobbler/loaders/README
downloading http://cobbler.github.com/loaders/COPYING.elilo to /var/lib/cobbler/loaders/COPYING.elilo
downloading http://cobbler.github.com/loaders/COPYING.yaboot to /var/lib/cobbler/loaders/COPYING.yaboot
downloading http://cobbler.github.com/loaders/COPYING.syslinux to /var/lib/cobbler/loaders/COPYING.syslinux
downloading http://cobbler.github.com/loaders/elilo-3.8-ia64.efi to /var/lib/cobbler/loaders/elilo-ia64.efi
downloading http://cobbler.github.com/loaders/yaboot-1.3.17 to /var/lib/cobbler/loaders/yaboot
downloading http://cobbler.github.com/loaders/pxelinux.0-3.86 to /var/lib/cobbler/loaders/pxelinux.0
downloading http://cobbler.github.com/loaders/menu.c32-3.86 to /var/lib/cobbler/loaders/menu.c32
downloading http://cobbler.github.com/loaders/grub-0.97-x86.efi to /var/lib/cobbler/loaders/grub-x86.efi
downloading http://cobbler.github.com/loaders/grub-0.97-x86_64.efi to /var/lib/cobbler/loaders/grub-x86_64.efi
*** TASK COMPLETE ***


文件目录loaders的东西拷贝到/var/lib/cobbler/loaders/目录下即可

3.查看cobbler check  (检查环境是否满足要求)

[root@localhost ~]# cobbler check
The following are potential configuration items that you may want to fix:

1 : debmirror package is not installed, it will be required to manage debian deployments and repositories  (这个错误可以忽略)

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

4、重启cobbler和dhcp,httpd等
systemctl start httpd.service 

cobbler sync

5、导入ISO镜像
首先上传ISO镜像并挂载到  /test  目录下
mount -o loop /root/rhel-server-7.1-x86_64-dvd  /test
然后执行:cobbler import --path=/test/ --name=linux7.1 --arch=x86_64

加载中
返回顶部
顶部