cobbler安装系统(基于网络)

cobbler

cobbler的安装配置,搭建环境centos7.4
1.检查当前环境的selinux和iptables是否关闭,相关命令getenforce、setenforce、systemctl  status firewalld。
2.安装配置cobbler需要连接外网,需首先配置yum源,保证能从互联网上下载安装包。
3.安装cobbler、dhcp、tftp和http,因为有些安装包和cobbler有依赖性,所以会自动安装上,执行命令yun install -y cobbler dhcp。
4.使用rpm -ql cobbler查看cobbler相关的服务,cobbler的服务名叫cobblerd。
5.把相关的服务设为开机启动,systemctl enable cobblerd dhcpd httpd tftp。
6.把服务都启动起来,systemctl start cobblerd httpd tftp,dhcp服务因为没有配置而无法启动,使用ss -ntl查看相关端口已经开启。
6.执行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.
修改/etc/cobbler/settings文件中的server地址,修改这个地址为本机的IP地址
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.
修改/etc/cobbler/settings文件中的next_server地址,修改这个地址为本机的IP地址
3) : SELinux is enabled. Please review the following wiki page for details on ensuring cobbler works correctly in your SELinux environment:https://github.com/cobbler/cobbler/wiki/Selinux
本机的selinux是关闭的不用管这一项
4) : change ‘disable’ to ‘no’ in /etc/xinetd.d/tftp
这一项是说把tftp的服务启动起来,由于开始就启动了,所以这一项也不用管
5) : 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.
执行cobbler get-loaders命令,把需要的东西下载到/var/lib/cobbler/loaders/文件夹下,然后再执行命令cobbler sync命令,把文件拷贝到/var/lib/tftpboot文件夹下
6) : enable and start rsyncd.service with systemctl
和当前的服务关系不大,可以不用理会
7) : debmirror package is not installed, it will be required to manage debian deployments and repositories
缺少安装包,但是不是在centos环境中,所以这个也不用管
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
在/etc/cobbler/settings中有一项default_password_crypted默认密码是cobbler,需要手工创建密码,并且把加密后的密码再放到这个地方,使用工具openssl passwd -1,
9) : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
不需要做这一项,和电源和集群有关
7.通过cobbler管理dhcp服务,启动dhcp服务,在/etc/cobbler/settings中找到manage_dhcp这一项,默认为零改为1
8.把上面的都做完之后重启服务,systemctl restart cobblerd
9.修改dhcp的配置模板,通过这个模板会自动生成dhcp的配置文件,vim /etc/cobbler/dhcp.template(和dhcp的配置文件格式相似,按照之前的修改就行)
10.修改完以后就可以同步一下cobbler sync,使用ss -ntl查看dhcp的服务器端口67是否启动。
11.准备把光盘挂载上去,可以同时挂载几个盘,并重启服务systemctl restart cobblerd。
12.把光盘中的内容导入系统,新建/mnt/cdrom0和/mnt/cdrom1分别把光盘挂载上去,执行命令cobbler import –path=/mnt/cdrom1 –name=centos-6.9-x86_64(系统盘的名称) –arch=x86_64(基于的架构) cobbler import –path=/mnt/cdrom0 –name=centos-7.4-x86_64 –arch=x86_64,导入的光盘都放到/var/www/cobbler/ks_mirror目录下,导入以后系统默认生成的有最小化安装的应答文件
==========================================================================
至此,就可以实现安装了,新开个虚拟机网络安装就可以了,默认是采用逻辑卷分区安装,如果不设置密码的的话,默认的密码是cobbler
==========================================================================cobbler的相关命令

cobbler check检查配置环境

cobbler distro list 查看导入的系统信息
cobbler distro remove –name=”使用list查看的名称”
cobbler profile list 查看应答文件的信息
cobbler profile remove –name=”使用应答文件查看的名称” 相当于删除菜单中的对应项。注意:要先删除profile再删除distro
cobbler profile report –name=”使用profile list查看的名称” 了解菜单项的详细信息
=============================
在cobbler上绑定自己的应答文件
=============================
菜单上的设置有可能不是我们所要的,所以要绑定自己的菜单上去
把应答文件上传到/var/lib/cobbler/kickstarts/文件夹中
把应答文件的–url=改为–url=$tree
执行命令cobbler profile add –name=centos-6.9-x86_64_Mini –distro=centos-6.9-x86_64 –kickstart=/var/lib/cobbler/kickstarts/ks6_mini.cfg

====================
实现cobbler的web界面
====================
1.安装cobbler-web软件包,yum install cobbler-web -y
2.重新启动http服务,systemctl restart httpd
3.使用浏览器输入https://192.168.30.27/cobbler_web/就可以访问web界面了,但是需要输入账号和密码,需要后台创建账号和密码,在文件/etc/cobbler/modules.conf中查看调用的模块是authn_configfile,这个模块用/etc/cobbler/users.digest文件定义了账号和密码
4.使用命令生成账号和密码,htdigest -c /etc/cobbler/users.digest Cobbler test1回车后输入两遍密码就可以了
5.还可以使用pam模块验证,在/etc/cobbler/modules.conf文件中修改验证模块为module=authn_pam,pam模块调用了/etc/cobbler/users.conf文件,新建linxu用户useradd -s /sbin/nologin test2;echo magedu | passwd –stdin test2,然后把test2添加到/etc/cobbler/users.conf文件的管理员处,然后在重启cobbler服务,systemctl restart cobblerd

本文来自投稿,不代表Linux运维部落立场,如若转载,请注明出处:http://www.178linux.com/99616

(0)
七杀七杀
上一篇 2018-05-27
下一篇 2018-05-27

相关推荐

  • 马哥教育 – 第二周作业

    一、Linux上的文件管理类命令都有哪些,其常用的使用方法及其相关示例演示。 <1>命令:CP 概念:用来将一个或多个源文件或者目录复制到指定的目的文件或目录。它可以将单个源文件复制成一个指定文件名的具体的文件或一个已经存在的目录下。cp命令还支持同时复制多个文件,当一次复制多个文件时,目标文件参数必须是一个已经存在的目录,否则将出现错误。 语法…

    2018-05-21
  • LInux系统误将chmod 权限改成了000如何恢复?

    需要解决方法的可直接跳跃至最后“解决方法目”;
    解决方法用到了新学的灵活权限设置 ACL,正文对Linux权限,和ACL用法做了详细解释。

    2018-04-06
  • 学习笔记(16)

    学习笔记

    Linux笔记 2018-05-06
  • 详细说明进行管理工具htop、vmstat等相关命令,并举例

    htop命令: 选项: -d #:指定延迟时间间隔 -u UserName:仅显示指定用户的进程 -s COLUME:以指定字段进行排序 htop -u root -d 10 PID:进程ID USER:用户名 PRI:优先级 NI:nice值 VIRT:Size in memory of the total program size RES:所使用的物理内…

    2018-06-15
  • 第六周

    简述OSI七层模型和TCP/IP五层模型应用层:为计算机用户提供应用程序接口和各种网络服务,通常可见的网络服务协议有:http,https,ftp,smtp,pop。会话层:建立、管理和终止表示层之间的通信会话。网络层:进行逻辑地址寻址,实现不同网络之间的路径选择物理层: 建立维护和断开物理连接应用层:对应OSI七层模型中的应用层、表示层、会话层网络层:物理…

    Linux笔记 2018-07-15
  • 第五周 软件包管理命令、制定定时任务和sed命令介绍

    1. RPM包管理 1.1 RPM简介 RPM类似于Windows系统中.exe的软件安装程序,用户可以使用它自行安装和管理Linux上的应用程序和系统工具; RPM软件包文件都是以.rpm为后缀,一般采用这样的命名格式:软件包名称 – 版本号 – 修正版 . 硬件平台 . rpm。 1.2 RPM命令的使用方法 查询:rpm {-q…

    2018-07-02