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. 详解iBaits中SqlMapClientTemplate的使用

    Apache iBatis(现已迁至Google Code下发展,更名为MyBatis)是当前IT项目中使用很广泛的一个半自动ORM框架,区别于Hibernate之类的全自动框架,iBatis对数据库 ...

  2. if __name__ == '__main__' 这段代码怎么理解???

    __name__是内置变量,可用于表示当前模块的名字,而“__main__”等于当前执行文件的名称. 两个名称搞不清没关系,往下看待会解释 对很多编程语言来说,程序都需要一个入口,例如C系列.Java ...

  3. 阿里云轻量级服务器上JDK及tomcat部署配置

    先下载JDK和tomcat到本地 地址为http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html ht ...

  4. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.shen.mapper.UserMapper.findById

    org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.shen.mapper.Use ...

  5. css画斜线(用于时间的显示)

  6. ajax的网上解析

    /* 用XMLHTTPRequest来进行ajax异步数据交交互*/ 主要有几个步骤: //1.创建XMLHTTPRequest对象 //最复杂的一步 if (window.XMLHttpReques ...

  7. mySQL的行转列

    因为MYSQL里边没有  PIVOT      现记录:   原表格:   mysql语句: SELECT MAX(CASE WHEN corol='红' THEN NUM else 0 END) A ...

  8. Nginx处理请求的11个阶段(agentzh的Nginx 教程学习记录)

    Nginx 处理请求的过程一共划分为 11 个阶段,按照执行顺序依次是 post-read.server-rewrite.find-config.rewrite.post-rewrite.preacc ...

  9. Python的伪造数据生成器:Faker

    我们在开发中常常需要利用一些假数据来做测试,这种时候就可以使用 Faker 来伪造数据从而用来测试. Faker 是一个可以让你生成伪造数据的Python包.当你需要初始化数据库,创建美观的XML文档 ...

  10. maven打包并上传到nexus3私服

    之前搭了个maven私服,接下来则要充分利用这个私服的优势上传自己的jar包了. 我们先在nexus上创建一个用来上传jar包的角色,并通过此角色创建若干帐号用来给开发者上传包.如图是我自己的配置: ...