[关闭]
@mrz1 2018-01-16T09:33:58.000000Z 字数 4372 阅读 870

cobbler安装centos6、7

自动化


cobbler 介绍

  1. 安装包(dhcp httpd tftp-server 开机启动)
  2. yum install cobbler cobbler-web (基于EPEL源)
  3. cobbler 服务集成
  4. PXE
  5. DHCP
  6. rsync(不需要可以不安装)
  7. Http
  8. DNS(不需要可以不安装)
  9. Kickstart(不需要可以不安装)
  10. IPMI 电源管理(不需要可以不安装)
  11. 检查cobbler环境
  12. cobbler check
  13. 光盘需要取消挂载(之后再挂上)

执行Cobbler check命令会报如下异常

  1. [root@centos7 ~]#cobbler check
  2. httpd does not appear to be running and proxying cobbler, or SELinux is in the way. Original traceback:
  3. Traceback (most recent call last): //这种重启httpd服务
  4. [root@centos7 ~]#systemctl restart httpd
  5. [root@centos7 ~]#systemctl status httpd
  1. [root@centos7 ~]#cobbler check
  2. The following are potential configuration items that you may want to fix:
  3. 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.
  4. 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.
  5. 3 : change 'disable' to 'no' in /etc/xinetd.d/tftp
  6. 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.
  7. 5 : enable and start rsyncd.service with systemctl
  8. 6 : debmirror package is not installed, it will be required to manage debian deployments and repositories
  9. 7 : The default password used by the sample templates for newly installed machines (default_password_crypted in
  10. /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
  11. 8 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
  12. Restart cobblerd and then run 'cobbler sync' to apply changes.

cobbler 报错解决

  1. 执行Cobbler check报错解决方式
  2. 1. 修改/etc/cobbler/settings文件中的server参数的值为提供cobbler服务的主机相应的IP地址或主机名(自己的ip 384行)
  3. 2. 修改/etc/cobbler/settings文件中的next_server参数的值为提供PXE服务的主机相应的IP地址(自己的ip 272行)
  4. 3.change 'disable' to 'no' in /etc/xinetd.d/tftp centos7不用管
  5. 4. 如果当前节点可以访问互联网,执行“cobbler get-loaders”命令即可;否则,需要安装syslinux程序包,而后复制/usr/share/syslinux/{pxelinux.0,memu.c32}等文件至/var/lib/cobbler/loaders/目录中
  6. 5 enable and start rsyncd.service with systemctl 用不到不用管
  7. 6 debian系统 不用管
  8. 7. 执行"openssl passwd -1"生成密码,
  9. 并用其替换/etc/cobbler/settings文件中default_password_crypted参数的值
  10. 8.也不用管 集群相关
  1. 修改 /etc/cobbler/dhcp.tempplate 网段地址范围等 变量不用动执行cobbler sync 同步一下就行 默认dhcp启动
  2. 生成yum 先挂载两张centos67盘在复制两张盘
  3. cobbler import --path=/mnt/centos7/ --name=Centos-7.4
  4. cobbler import --path=/mnt/centos6/ --name=Centos-6.9
  5. 复制完成就可以安装了
  6. 之后自己修改根据自己的需求配置应答文件
  7. url --url=$tree 这里使用变量
  8. 执行此命令把启动把自己弄得菜单加入
  9. cobbler profile add --name=Centos-6.9-x86_64_desktop --distro=Centos-6.9-x86_64 --kickstart=/var/lib/cobbler/kickstarts/ks6-desktop.cfg
  10. 简析:--name 列表的名字
  11. --distroy yum
  12. --kickstart 你自己写的应答文件路径
  13. --arch=x86_64 架构 可加可不加

cobbler 命令

  1. cobbler commands介绍
  2. cobbler check 核对当前设置是否有问题
  3. cobbler list 列出所有的cobbler元素
  4. cobbler report 列出元素的详细信息
  5. cobbler sync 同步配置到数据目录,更改配置最好都要执行下
  6. cobbler reposync 同步yum仓库
  7. cobbler distro 查看导入的发行版系统信息
  8. cobbler system 查看添加的系统信息
  9. cobbler profile 查看配置信息
  10. [root@centos7 kickstarts]#cobbler profile list (启动菜单列表)
  11. Centos-6.9-x86_64
  12. Centos-6.9-x86_64_desktop
  13. Centos-7.4-x86_64
  14. Centos-7.4-x86_64_desktop
  15. [root@centos7 kickstarts]#cobbler distro list(查看yum源)
  16. Centos-6.9-x86_64
  17. Centos-7.4-x86_64

cobbler 重要的参数

  1. /etc/cobbler/settings中重要的参数设置
  2. default_password_crypted: "$1$gEc7ilpP$pg5iSOj/mlxTxEslhRvyp/"
  3. manage_dhcp1
  4. manage_tftpd1
  5. pxe_just_once1 下次在重装默认不会安装(怕覆盖你系统)
  6. next_server:< tftp服务器的IP 地址>
  7. server:<cobbler服务器的IP 地址>

cobbler 目录结构

  1. [root@centos7 tftpboot]#cd /var/lib/tftpboot/ |tree
  2. .
  3. ├── boot
  4.    └── grub
  5.    └── menu.lst
  6. ├── etc
  7. ├── grub
  8.    ├── efidefault
  9.    ├── grub-x86_64.efi
  10.    ├── grub-x86.efi
  11.    └── images -> ../images
  12. ├── images
  13.    ├── Centos-6.9-x86_64
  14.       ├── initrd.img
  15.       └── vmlinuz
  16.    └── Centos-7.4-x86_64
  17.    ├── initrd.img
  18.    └── vmlinuz
  19. ├── images2
  20. ├── memdisk
  21. ├── menu.c32
  22. ├── ppc
  23. ├── pxelinux.0
  24. ├── pxelinux.cfg
  25.    └── default
  26. ├── s390x
  27.    └── profile_list
  28. └── yaboot
  29. [root@centos7 kickstarts]#cd /var/lib/cobbler/kickstarts|tree
  30. .
  31. ├── default.ks
  32. ├── esxi4-ks.cfg
  33. ├── esxi5-ks.cfg
  34. ├── install_profiles
  35.    ├── machine.AA00FFCC1100-example
  36.    └── README
  37. ├── ks6-desktop.cfg //自己后来添加进来的
  38. ├── ks7-desktop.cfg //自己后来添加进来的
  39. ├── legacy.ks
  40. ├── pxerescue.ks
  41. ├── sample_autoyast.xml
  42. ├── sample_end.ks
  43. ├── sample_esx4.ks
  44. ├── sample_esxi4.ks
  45. ├── sample_esxi5.ks
  46. ├── sample_esxi6.ks
  47. ├── sample.ks
  48. ├── sample_old.seed
  49. └── sample.seed
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注