1、配置系统
关闭
firewalld防火墙
[root@sky ~]# systemctl stop firewalld.service
[root@sky ~]# systemctl disable firewalld.service
[root@sky ~]# firewall-cmd --state
not running
关闭SELinux(修改完重启)

[root@sky ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
[root@sky ~]# reboot

2、安装cobbler
安装epel源
[root@sky ~]# cd /etc/yum.repos.d/
[root@sky yum.repos.d]# yum -y install epel-release
安装cobbler

[root@sky yum.repos.d]# yum install -y cobbler cobbler-web tftp xinetd dhcp cman pykickstart debmirror syslinux net-tools
安装cobbler依赖包
[root@sky yum.repos.d]# yum install -y ed patch perl perl-Compress-Zlib perl-Digest-SHA1 perl-LockFile-Simple perl-libwww-perl fence-agents

设置服务开机启动

[root@sky yum.repos.d]# systemctl enable httpd.service
[root@sky yum.repos.d]# systemctl enable dhcpd.service
[root@sky yum.repos.d]# systemctl enable xinetd.service
[root@sky yum.repos.d]# systemctl enable cobblerd.service
查看服务开启状态

[root@sky yum.repos.d]# systemctl list-unit-files | grep -E "httpd|dhcpd|xinetd|cobblerd"
cobblerd.service                            enabled 
dhcpd.service                               enabled 
httpd.service                               enabled 
xinetd.service                              enabled

3、配置服务
配置web

[root@sky yum.repos.d]# sed -i 's/#ServerName www.example.com:80/ServerName 127.0.0.1:80/' /etc/httpd/conf/httpd.conf
[root@sky yum.repos.d]# systemctl restart httpd.service
配置cobbler
[root@sky yum.repos.d]# sed -i 's/server: 127.0.0.1/server: 192.168.17.181/g' /etc/cobbler/settings 
防止重装
#sed -i 's/pxe_just_once: 0/pxe_just_once: 1/' /etc/cobbler/settings

修改cobbler用户的默认密码,
使用生成后的密码替换/etc/cobbler/settings中的密码
[root@sky yum.repos.d]# openssl passwd -1 -salt 'root' 'weidai@123'
$1$root$8e67rDXAsnndS790noSQV0
 
[root@sky yum.repos.d]# vim /etc/cobbler/settings
default_password_crypted: "$1$root$8e67rDXAsnndS790noSQV0"    <==替换掉此处内容
配置cobber_web (Web页面默认不允许任何人登录,需要手动修改认证相关配置)
[root@sky yum.repos.d]# useradd admin
[root@sky yum.repos.d]# passwd admin
[root@sky yum.repos.d]# sed -i 's/admin = ""/admin = "admin"/' /etc/cobbler/users.conf
[root@sky yum.repos.d]# sed -i 's/module = authn_configfile/module = authn_pam/' /etc/cobbler/modules.conf
配置xinetd

[root@sky yum.repos.d]# sed -i '14s/yes/no/' /etc/xinetd.d/tftp 
[root@sky yum.repos.d]# systemctl restart xinetd.service
[root@sky yum.repos.d]# systemctl restart rsyncd.service
[root@sky yum.repos.d]# systemctl enable rsyncd.service
配置dhcp,pxe

[root@sky yum.repos.d]# sed -i 's/manage_dhcp: 0/manage_dhcp: 1/' /etc/cobbler/settings
[root@sky yum.repos.d]# sed -i 's/pxe_just_once: 0/pxe_just_once: 1/' /etc/cobbler/settings
[root@localhost yum.repos.d]# mv /etc/cobbler/dhcp.template /etc/cobbler/dhcp.template.bak
[root@sky yum.repos.d]# vim /etc/cobbler/dhcp.template 
ddns-update-style interim;
 
allow booting;
allow bootp;
 
ignore client-updates;
set vendorclass = option vendor-class-identifier;
 
subnet 192.168.17.0 netmask 255.255.255.0 {
    option routers             192.168.17.1;
    option domain-name-servers 114.114.114.114;
    option subnet-mask         255.255.255.0;
    range dynamic-bootp        192.168.17.100 192.168.17.200;
    filename                "/pxelinux.0";
    default-lease-time         21600;
    max-lease-time             43200;
    next-server                192.168.17.181;
}
启动服务

[root@sky yum.repos.d]# systemctl restart cobblerd.service
[root@sky yum.repos.d]# systemctl restart xinetd.service
[root@sky yum.repos.d]# cobbler sync
如果服务器对公网提供服务器,防火墙设置如下

[root@sky yum.repos.d]# firewall-cmd --permanent --add-port=67/udp
[root@sky yum.repos.d]# firewall-cmd --permanent --add-port=68/udp
[root@sky yum.repos.d]# firewall-cmd --permanent --add-port=80/tcp
[root@sky yum.repos.d]# firewall-cmd --permanent --add-port=443/tc
[root@sky yum.repos.d]# firewall-cmd --permanent --add-port=443/tcp
[root@sky yum.repos.d]# firewall-cmd --reload
[root@sky yum.repos.d]# firewall-cmd --permanent --list-ports

4、登录cobbler_web界面
https://192.168.17.181/cobbler_web
用户名:admin
密码: 系统admin的密码

5、挂载系统安装镜像到http服务器站点目录
上传系统安装镜像文件CentOS-7-x86_64-DVD-1511.iso 到/usr/local/src/目录(拿U盘考,用Xftp工具上传都行)

# mkdir -p /var/www/html/os/CentOS-7-x86_64      
# mount -t iso9660 -o loop /usr/local/src/CentOS-7-x86_64-DVD-1511.iso  /var/www/html/os/CentOS-7-x86_64

七、导入系统镜像到cobbler
导入系统镜像文件,需要一段时间
# cobbler import --path=/var/www/html/os/CentOS-7-x86_64/  --name=CentOS-7-x86_64  --arch=x86_64
cobbler系统镜像导入目录在/var/www/cobbler/ks_mirror/下
命令格式:cobbler import --path=镜像路径 -- name=安装引导名 --arch=32位或64位
重复上面的操作,把其他的系统镜像文件导入到cobbler

八、设置profile

查看cobbler默认指定的profile设置
# cobbler profile report --name CentOS-7-x86_64
查看安装镜像文件信息
#cobbler distro report --name redhat7.2-x86_64
移除cobbler默认指定的错误profile
# cobbler profile remove --name=CentOS-7-x86_64
添加我们自己设置的新profile(CentOS7的自动安装脚本)
# cobbler profile add --name=CentOS-7-x86_64 --distro=CentOS-7-x86_64 --kickstart=/var/lib/cobbler/kickstarts/CentOS7.ks

查看Cobbler列表
# cobbler list
# cobbler report
# cobbler profile report
# cobbler distro list

注意:
1、kickstart自动安装文件需要预先配置好
2、每次修改完配置文件,需要执行一次同步操作:cobbler sync 配置才能生效
3、kickstart自动安装文件可以用工具生成(需要用到图形界面操作)
yum  install system-config-kickstart #安装
yum groupinstall "X Window System" #安装X Window图形界面
system-config-kickstart #运行kickstart配置
service  cobbler  sync  #与cobbler sync作用相同
service  cobbler  restart  #重启cobbler

编辑profile
# cobbler profile edit --name=CentOS-7-x86_64 --distro=CentOS-7-x86_64 --kickstart=/var/lib/cobbler/kickstarts/CentOS7.ks  
命令参数:cobbler profile add|edit|remove --name=安装引导名 --distro=系统镜像名 --kickstart=kickstart自动安装文件路径
➣   --name:自定义的安装引导名,注意不能重复
➣   --distro:系统安装镜像名,用cobbler distro list可以查看
➣   --kickstart:与系统镜像文件相关联的kickstart自动安装文件

redhat7.2
install
keyboard 'us'
rootpw --iscrypted $6$lpH7b/BtlAu/IjWL$Fqme918S3yPAaVRySfnC8jUqBGIvrGZr.IqeVOCkBR1G/H3xtb9cXwrRPJJklu4FfXUKvUONhaiVBLQyOkbsg0
url --url="http://192.168.1.110/cobbler/ks_mirror/redhat7.2_x86_64-x86_64/"
lang en_US
firewall --disabled
auth --useshadow --passalgo=sha512
#text
graphical
firstboot --disable
selinux --disabled
network --bootproto=dhcp --device=eth0
reboot
timezone Asia/Shanghai --isUtc
bootloader --append="rhgb quiet" --location=mbr
zerombr
clearpart --all --initlabel
autopart --type=lvm
user --name=dou--password=$6$Z2avWwYgGYk002zh$XMBlYsNZxWtgqHhMr4b31v9J19tNkWHkuDQDG3IRfPzt92qhfN6yYrCtx7vMaKpIh0aBq/pefygHh4ZUWPCW51 --iscrypted --gecos="sunyard"

%packages
@^graphical-server-environment
@base
@compat-libraries
@core
@desktop-debugging
@development
@dial-up
@fonts
@ftp-server
@gnome-desktop
@guest-agents
@guest-desktop-agents
@input-methods
@internet-browser
@multimedia
@print-client
@x11
kexec-tools
initial-setup
initial-setup-gui
vinagre
%end

%addon com_redhat_kdump --enable --reserve-mb='auto'

%end

cobble服务器安装配置的更多相关文章

  1. Windows服务器安装配置PHP7.0环境图文教程

    摘自http://www.111cn.net/phper/linux-php/109865.htm Windows服务器安装配置PHP7.0环境图文教程 www.111cn.net 更新:2016-0 ...

  2. Linux下Redis服务器安装配置

    说明:操作系统:CentOS1.安装编译工具yum install wget  make gcc gcc-c++ zlib-devel openssl openssl-devel pcre-devel ...

  3. CentOS下Redis服务器安装配置

    说明: 操作系统:CentOS 1.安装编译工具 yum install wget  make gcc gcc-c++ zlib-devel openssl openssl-devel pcre-de ...

  4. Linux下SVN服务器安装配置及客户端安装说明

    原文地址:http://wenku.baidu.com/link?url=h3dVAMx4azpOXEND5HQEE6nliE8-zc0GSQ03yv4cUs1vXMALXF64UsK7kT7kXm_ ...

  5. Linux 下 Memcached 缓存服务器安装配置

    Linux 下 Memcached 缓存服务器安装配置 [日期:2011-08-06] 来源:Linux社区  作者:Linux [字体:大 中 小]   [安装Memcache服务器端]我目前的平台 ...

  6. Apache服务器安装配置

    Apache服务器安装 1.Apache服务器安装      在Linux系统下,apache服务器的安装方式比较灵活,可以使用二进制包安装,比如:rpm包.deb包.已编译好的包.也可以简单的使用y ...

  7. 装部署VMware vSphere 5.5文档 (6-2) 为IBM x3850 X5服务器安装配置VMware ESXi

    部署VMware vSphere 5.5 实施文档 ########################################################################## ...

  8. MySQL服务器安装配置-非安装版、windows版

    文档以5.6.30版本为例子说明 1. 下载MySQL http://dev.mysql.com/downloads/mysql/5.6.html#downloads 我们可以选择自己所需要的版本.环 ...

  9. linux下svn服务器安装配置与启动

    1. 采用源文件编译安装.源文件共两个,为: subversion-1.6.1.tar.gz  (subversion 源文件) subversion-deps-1.6.1.tar.gz  (subv ...

随机推荐

  1. JVM TI

    JVM TI JVM TI全名Java Virtual Machine Tool Interface,是开发虚拟机监控工具使用的编程接口,它可以监控JVM内部时间的执行,也可以控制JVM的某些行为,可 ...

  2. Java实现RSA密钥对并在加解密、加签验签中应用的实例

    一.项目结构 二.代码具体实现 1.密钥对生成的两种方式:一种生成公钥私文件,一种生成公钥私串 KeyPairGenUtil.java package com.wangjinxiang.genkey. ...

  3. Cocos Creator JS 时间戳日期转换

    /*** 时间戳换算日期* */function formatDateTime (timeStamp) { var date = new Date(); date.setTime(timeStamp ...

  4. weixin://connectToFreeWifi/?apKey=协议如何跳转到微信客户端打开在wifi指定任意网页?

    微信门店wifi接口,任意站跳转,跳转二维码长按识别加粉,接口支持动态传参数,支持微信支付等特殊接口对接. 代码如下使用 <head> <meta charset="utf ...

  5. U面经Prepare: Print Binary Tree With No Two Nodes Share The Same Column

    Give a binary tree, elegantly print it so that no two tree nodes share the same column. Requirement: ...

  6. SQL Server创建存储过程——动态SQL

    简介: 存储过程(stored procedure)是一组为了完成特定功能的SQL语句集合,经编译后存储在服务器端的数据库中,利用存储过程可以加速SQL语句的执行. 自定义存储过程,由用户创建并能完成 ...

  7. 安装mysql时出现应用程序无法正常启动(0xc000007b)

    在重装mysql数据库(解压版)遇到了无法正常启动(0xc000007b)问题解决方案 问题描述: 在cmd控制台,mysql的安装路径下使用mysql install命令出现以下无法正常启动(0xc ...

  8. vim : 依赖: vim-common (= 2:7.3.429-2ubuntu2) 但是 2:7.3.429-2ubuntu2.1 正要被安装

    sudo apt-get purge vim-common sudo apt-get update sudo apt-get upgrade sudo apt-get install vim Just ...

  9. 再唠叨JS模块化加载之CommonJS、AMD、CMD、ES6

    Javascript模块化编程,已经成为一个迫切的需求.理想情况下,开发者只需要实现核心的业务逻辑,其他都可以加载别人已经写好的模块. Javascript社区做了很多努力,在现有的运行环境中,实现” ...

  10. Hadoop Mapreduce中shuffle 详解

    MapReduce 里面的shuffle:描述者数据从map task 输出到reduce task 输入的这段过程 Shuffle 过程: 首先,map 输出的<key,value >  ...