标签:
Cobbler 可以用来快速建立 Linux 网络安装环境,它已将 Linux 网络安装的技术门槛,从大专以上文化水平,成功降低到初中以下,连补鞋匠都能学会。(~..~)
[root@cobbler ~]# rpm -ivh http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm
[root@cobbler ~]# yum -y install dhcp tftp rsync xinetd httpd
[root@cobbler ~]# yum install cobbler
[root@cobbler ~]# 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 : change ‘disable‘ to ‘no‘ in /etc/xinetd.d/tftp 4 : 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. 5 : change ‘disable‘ to ‘no‘ in /etc/xinetd.d/rsync 6 : comment out ‘dists‘ on /etc/debmirror.conf for proper debian support 7 : comment out ‘arches‘ on /etc/debmirror.conf for proper debian support 8 : 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.
[root@cobbler ~]# vim /etc/cobbler/settings server: 192.168.30.158 next_server: 192.168.30.158
2 : change ‘disable‘ to ‘no‘ in /etc/xinetd.d/tftp 修改disable 为 no
[root@cobbler ~]# vi /etc/xinetd.d/tftp # 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 { socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /var/lib/tftpboot disable = no per_source = 11 cps = 100 2 flags = IPv4 }
[root@cobbler ~]# cobbler get-loaders task started: 2015-08-26_161520_get_loaders task started (id=Download Bootloader Content, time=Wed Aug 26 16:15:20 2015) 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 ***
[root@cobbler ~]# openssl passwd -1 -salt ‘222222‘ ‘999999‘ $1$222222$D38AxheCTHf/nVAzlN0.z0
此处按提示操作,最后一个生成的“123456”密码,是cobbler客户端安装完系统后的root密码。生成后的密码$1$222222$D38AxheCTHf/nVAzlN0.z0需要写入下面的文件内:/etc/cobbler/settings内
[root@cobbler ~]# vim /etc/cobbler/settings default_password_crypted: "$1$222222$D38AxheCTHf/nVAzlN0.z0"
[root@cobbler ~]# vim /etc/debmirror.conf #@dists="sid"; #@arches="i386";
找到以上两行,并注释掉这两句。
[root@cobbler ~]# vi /etc/xinetd.d/rsync # default: off # description: The rsync server is a good addition to an ftp server, as it # allows crc checksumming etc. service rsync { disable = no flags = IPv6 socket_type = stream wait = no user = root server = /usr/bin/rsync server_args = --daemon log_on_failure += USERID }
[root@cobbler ~]# service cobblerd restart Stopping cobbler daemon: [ OK ] Starting cobbler daemon: [ OK ] [root@cobbler ~]# cobbler check No configuration problems found. All systems go.
[root@cobbler ~]# vi /etc/cobbler/settings manage_dhcp: 1
[root@cobbler ~]# vi /etc/cobbler/dhcp.template subnet 192.168.30.0 netmask 255.255.255.0 { option routers 192.168.30.1; option domain-name-servers 192.168.30.1; option subnet-mask 255.255.255.0; range dynamic-bootp 192.168.30.100 192.168.30.254; default-lease-time 21600; max-lease-time 43200; next-server $next_server;
[root@cobbler ~]# mkdir -p /cobbler/ISO [root@cobbler /]# mount /dev/cdrom /cobbler/ISO/ mount: block device /dev/sr0 is write-protected, mounting read-only
之后导入安装镜像。
[root@cobbler ~]# cobbler import --path=/cobbler/ISO/ --name=CentOS-6.5_86x64 task started: 2015-08-26_181805_import task started (id=Media import, time=Wed Aug 26 18:18:05 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/CentOS-6.5_86x64: creating new distro: CentOS-6.5_86x64-x86_64 trying symlink: /var/www/cobbler/ks_mirror/CentOS-6.5_86x64 -> /var/www/cobbler/links/CentOS-6.5_86x64-x86_64 creating new profile: CentOS-6.5_86x64-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/CentOS-6.5_86x64 for CentOS-6.5_86x64-x86_64 processing repo at : /var/www/cobbler/ks_mirror/CentOS-6.5_86x64 need to process repo/comps: /var/www/cobbler/ks_mirror/CentOS-6.5_86x64 looking for /var/www/cobbler/ks_mirror/CentOS-6.5_86x64/repodata/*comps*.xml Keeping repodata as-is :/var/www/cobbler/ks_mirror/CentOS-6.5_86x64/repodata *** TASK COMPLETE ***
[root@cobbler ~]# cobbler sync task started: 2015-08-26_182224_sync task started (id=Sync, time=Wed Aug 26 18:22:24 2015) running pre-sync triggers cleaning trees removing: /var/www/cobbler/images/CentOS-6.5_86x64-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/CentOS-6.5_86x64-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: CentOS-6.5_86x64-x86_64 trying hardlink /var/www/cobbler/ks_mirror/CentOS-6.5_86x64/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/CentOS-6.5_86x64-x86_64/vmlinuz trying hardlink /var/www/cobbler/ks_mirror/CentOS-6.5_86x64/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/CentOS-6.5_86x64-x86_64/initrd.img copying images generating PXE configuration files generating PXE menu structure copying files for distro: CentOS-6.5_86x64-x86_64 trying hardlink /var/www/cobbler/ks_mirror/CentOS-6.5_86x64/images/pxeboot/vmlinuz -> /var/www/cobbler/images/CentOS-6.5_86x64-x86_64/vmlinuz trying hardlink /var/www/cobbler/ks_mirror/CentOS-6.5_86x64/images/pxeboot/initrd.img -> /var/www/cobbler/images/CentOS-6.5_86x64-x86_64/initrd.img Writing template files for CentOS-6.5_86x64-x86_64 rendering TFTPD files generating /etc/xinetd.d/tftp processing boot_files for distro: CentOS-6.5_86x64-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 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 ***
重启一下
[root@cobbler cobbler]# /etc/init.d/xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
标签:
原文地址:http://www.cnblogs.com/hanyifeng/p/4755821.html