• 寒枫欣叶

  • 美好的生活需要用心记录
  • 首页
  • 相册
  • 下载
  • 留言板
  • cobbler批量安装linux

    [Linux管理]
    post by 小程 / 2011-12-22 12:15 Thursday
    操作系统环境 : CentOS 5.5 i386
    软件环境 : cobbler-2.0.11-2.el5

    centos要安装cobbler 需要安装一个软件包 epel
    wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
    rpm -ivh epel-release-5-4.noarch.rpm
    下面开始具体的步骤了:
    centos的系统yum源配置 
    cd /etc/yum.repos.d/
    wget http://mirrors.163.com/.help/CentOS5-Base-163.repo
    yum makecache
    开始安装软件
    yum install cobbler dhcp cman debmirror
    修改配置文件
    vi /etc/cobbler/dhcp.template 
    subnet 192.168.0.0 netmask 255.255.255.0 {
       option routers       192.168.0.100;
    #   option domain-name-servers 192.168.1.1;
       option subnet-mask       255.255.255.0;
       range dynamic-bootp       192.168.0.110 192.168.0.200;
    注: 不要修改/etc/dhcpd.conf 这个文件,过会我们会配置让cobbler接管启动dhcpd的任务,cobbler会把你修改的dhcp.template拷贝到/etc/dhcpd.conf
    vi /etc/cobbler/settings   (只写出需要修改的地方)
    default_password_crypted: "$1$icifbsa$GlSk4KZPpIscQsOpLkZh0/"
    #过会你运行 cobbler check时 会提示你修改密码
    #这个密码就是你安装系统后的root密码,我在这里先说明而已.
    #用这个命令实现 "openssl passwd -1 -salt '任意字母' '你的密码' "
    manage_dhcp: 1
    next_server: 192.168.0.100
    server: 192.168.0.100
    vi /etc/debmirror.conf (只写出需要修改的地方)
    #@dists="sid";
    #@arches="i386";  #这两个地方注释掉即可,不然过会 cobbler check 会报错
    过会cobbler check 时 还会要求你执行一个命令
    cobbler get-loaders
    这是下载引导操作系统的必须文件,我在上面的网盘已经提供了 loaders.tar.gz,解压到  /var/lib/cobbler/loaders/,当然你也可以运行上面的命令下载

    再修改2个文件
    /etc/xinetd.d/tftp
     /etc/xinetd.d/rsync
     
    把这2个文件里面的
    disable = no
    捎带提一句 别忘了关闭防火墙和SELINUX (有时这2个东西很误事 :)  
    这时候我们启动 httpd  (如果不启动httpd , cobbler check 是没法执行滴)

    有可能的报错信息如下
    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 : 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/.*"
    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/tftp
    6 : change 'disable' to 'no' in  /etc/xinetd.d/rsync
    7 : since iptables may be running, ensure  69, 80, and 25151 are unblocked
    8 : debmirror package is not installed,  it will be required to manage debian deployments and repositories
    9 : 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

    文章有点倒叙了 哈哈 根据报错信息和偶上面修改的地方改改, 改完后执行  cobbler check
    [root@vm loaders]# cobbler check
    cobblerd does not appear to be running/accessible
    好了 没有报错信息了,cobbler 配置好了。
    开始导入操作系统的ISO镜像文件
    #先mount  iso文件
    mount -o loop /path/centos-5.5-i386.iso /mnt
    #导入 . --name=名字任意,--path=刚才你mount的路径
    cobbler import --path=/mnt --name=centos-5.5-i386
    同步所有配置
    cobbler sync
    启动所有服务
    /etc/init.d/xinetd restart
    /etc/init.d/httpd restart
    /etc/init.d/cobblerd restart
    ps: cobbler sync时会自动启动dhcpd的服务。

      偶修改完配置时,都是执行 cobbler sync ,  /etc/init.d/cobblerd restart 这两个命令(为了保险)^_^ 
      重要:用cobbler安装操作系统时,cobbler真正执行的kickstart文件其实不是 /var/lib/cobbler/kickstarts/default.ks,而是 /var/lib/cobbler/kickstarts/sample.ks
           学习cobbler配置,最好把kickstart的配置文件也搞懂,默认sample.ks文件会清空硬盘所有分区资料。

    下面贴出偶的 sample.ks
    #platform=x86, AMD64, or Intel EM64T
    # System authorization information
    auth  --useshadow  --enablemd5
    # System bootloader configuration
    bootloader --location=mbr
    # Partition clearing information
    #clearpart --all --initlabel
    # Use text mode install
    text
    # Firewall configuration
    firewall --enabled
    # Run the Setup Agent on first boot
    firstboot --enable
    # System keyboard
    keyboard us
    # System language
    lang en_US.UTF-8
    # Use network installation
    url --url=$tree
    # If any cobbler repo definitions were referenced in the kickstart profile, include them here.
    $yum_repo_stanza
    # Network information
    $SNIPPET('network_config')
    # Reboot after installation
    reboot
     
    #Root password
    #rootpw --iscrypted $default_password_crypted
    # SELinux configuration
    selinux --disabled
    # Do not configure the X Window System
    skipx
    # System timezone
    timezone  Asia/Shanghai
    # Install OS instead of upgrade
    install
    # Clear the Master Boot Record
    #zerombr
    # Allow anaconda to partition the system as needed
    #autopart
     
     
    %pre
    $SNIPPET('log_ks_pre')
    $kickstart_start
    $SNIPPET('pre_install_network_config')
    # Enable installation monitoring
    $SNIPPET('pre_anamon')
     
    %packages
    #$SNIPPET('func_install_if_enabled')
    #$SNIPPET('puppet_install_if_enabled')
    @base
    @core
    @development-libs
    @development-tools
    @editors
    @text-internet
    keyutils
    trousers
    fipscheck
    device-mapper-multipath
    imake
    lrzsz
     
    %post
    $SNIPPET('log_ks_post')
    # Start yum configuration
    $yum_config_stanza
    # End yum configuration
    $SNIPPET('post_install_kernel_options')
    $SNIPPET('post_install_network_config')
    $SNIPPET('func_register_if_enabled')
    $SNIPPET('puppet_register_if_enabled')
    $SNIPPET('download_config_files')
    $SNIPPET('koan_environment')
    $SNIPPET('redhat_register')
    $SNIPPET('cobbler_register')
    # Enable post-install boot notification
    $SNIPPET('post_anamon')
    # Start final steps
    $kickstart_done
    # End final steps

    这是属于cobbler调用的特殊ks文件,想看真正配置好吧,方法是打开浏览器
    http://192.168.0.100/cblr/svc/op/ks/profile/CentOS-5.5-i386
    # 192.168.0.100不用解释了吧
    #后面的 CentOS-5.5-i386 就是你 cobbler import时指定的 --name

    偶是用虚拟机完成此次实验的,本来是在fedora15下用的virtualbox,但是那个网络环境真难搞,一直也不能让另一个虚拟机获得到cobbler所在虚拟机的dhcp分配的ip,无奈回到windows用vmware,使用hostonly模式轻松搞定。这里再捎带提以下修改vmware bios启动的方法,因为vmware启动界面一闪而过,想按F2进入bios灰常难,方法就是修改虚拟机的开机等待时间,进入到你虚拟机的目录,不是软件安装目录,是你保存虚拟机的目录,里面有个vmx文件,添加一行
    bios.bootdelay=5000
    让开机画面停留5000毫秒。

    大功告成 !  
    标签: cobbler linux网络安装
    « windows和linux服务器双网段的配置 | CSDN网站600万用户信息泄露»

    引用地址:

    取消回复

    发表评论:

    catcutshcchx防火墙过滤虚拟主机ip端口域名后台headlessmore同步备份syncback版权 百度 韩寒 李彦宏远程桌面梦想 生活 高房价 与时俱进3389服务器IE7IE8去搜索菜单栏桌面puttysshvmware虚拟机远程登陆SecureCRTlrzsz上传下载winwebmailesxi4centosrpmMySQLshellLAMP脚本linux优化historydos2unixunix2dosnginx4043.7.3.1lnmpnginxphp网站备份apachewindows邮件服务器trtail切割日志crontablinux计划任务特鲁姆普斯洛克三峡大学逸夫楼门db4逸夫楼事件视频yumftpproftpd西游记vpspptp未来生活多核配置一键安装脚本xen vpsopenvz vpstop系统运行状态fail2ban防止暴力破解ssh安全linux常用命令winscpwin linux文件传输linux文件上传itdhz下载shell加密404页面404跳转godaddy域名注册白名单查看日志访问受限cpunginx日志日志停止windows无缝升级妓女老婆shellinaboxweb ssh4200端口cherokeekangle压力测试GFW之父方校长webshell方滨兴扔鞋子扔鸡蛋跨目录php文件列表顶级域名判断autoindexfancyindex转入转移码17173投票黑幕忘记密码初始化密码安装cronolog日志切割cacti流量图断断续续openvz不连贯vps架设虚拟化vsftpddeepin打不开多家域名暂停解析广告linux命令sed梧桐山系统配置vps选购http_loadwebbenchabsiege多个sshpdshmusshnginx反向代理rsync数据同步备份rsyncd.confnagiosnyfeditvps安全设置root密码猜解apache启动httpd精彩小故事apachectl作用精彩网文indexes目录列表美化建党九十周年谷歌更新pr百度K站为党庆生恶搞配音白娘子传奇外传红歌crond错误输出linux两用户信任标准输出nullmountexprtestrdesktop远程连接muttfstab自动挂载dell r710raid5域名指向tcpdumplinux抓包流量查看hpdl380bl460死机升级固件wget下载整站wget密码@字符awkscp限速rsyslog合并行交换行删除行删除空行交互奇偶行双网卡route print双网段双网关静态路由route addinterface接口设置mtu合理mtu监控nsclient++linux监控博客nrpenagios-plugins交友技术DELL2850RAID配置emlog回复win2003虚线边框添加用户日志kickstart删除用户日志更改用户日志自动安装linux允许服务与桌面交互sc批处理zombie修改windows服务僵死进程杀死进程kill十一国庆爬梧桐山esxisort排序lockyum.pidv880恶意域名指向别人域名指向我的网站买手机grepDNS污染DNS推送广告弹窗艾普宽带小偷手机成都omegle英语学习网站联通骗局充话费送手机联通3G报表可用性月报QQ邮箱小站长备份如何备份黑客ATMgdb分析日志nagios安装nagios中文文档管理软件40首中日翻唱suexeccgi分区结点inodenagios出错unable to read output运维devopscobblerchefpuppetitlinux网络安装颜色技巧rpm包制作CSDN密码泄露明文密码双路由linux超级终端minicomicloudiphone4s天涯信息泄露4000万用户相册捡拾空间占用不释放shmtmpfsnagstamon出差南宁wordpress3.2.1被黑nagios监控后门中文情人节玫瑰2月14日爱旅游
  • 搜索

  • 日历

  • 分类导航

    • Linux管理(71) 订阅该分类
    • windows(11) 订阅该分类
    • 运维监控(10) 订阅该分类
    • 网络技术(7) 订阅该分类
    • 经典视频(9) 订阅该分类
    • 网络转载(15) 订阅该分类
    • 生活琐碎(12) 订阅该分类
    • 杂七杂八(10) 订阅该分类
  • 最新评论

    • 青浦电脑
      怎么看别的生活...
    • CCC China
      内置后门还是挺...
    • orange
      申请友情链接 ...
    • Financial
      内置后门做什么...
    • 大型烘箱
      这个是用方法还...
    • 五洋
      情人节快乐啊!...
    • 橱柜门板
      现在的技术 真是...
  • 友情链接

    • 祥子's blog
    • K's blog
    • 依如星辰
    • 老徐's blog
    • 那些事儿
    • 澜蔺阁
    • 忧伤的猪's blog
    • 八零家园
    • 拍特博客
    • 蜗牛's blog
    • IT爱好者博客
    • 倒挂太阳的角落
    • 影迹's blog
    • 7h1nkz3r0's blog
    • 过去式
    • 沐阳博客
    • 李冬's blog
    • 蓝色夏威夷
    • 唐小静's blog
    • SEO艺术师
  • 标签云

  • 存档

    • 2012年2月(5)
    • 2012年1月(3)
    • 2011年12月(12)
    • 2011年11月(8)
    • 2011年10月(9)
    • 2011年9月(11)
    • 2011年8月(14)
    • 2011年7月(16)
    • 2011年6月(21)
    • 2011年5月(25)
    • 2011年4月(19)
    • 2011年3月(3)
订阅Rss
Powered by emlog | 站长QQ:408160341 | 备你妹案 | 站点地图 |