官方源下:
yum install epel-release -y //安裝epel源
-------------------正式部署--------------------------------------------
安裝相關服務:
yum install cobbler cobbler-web dhcp tftp-server pykickstart httpd rsync xinetd -y
示例:
vi /etc/cobbler/settings //修改主配置文件
next_server: 127.0.0.1 //指定PXE位置
server: 127.0.0.1 //聲明服務器地址
manage_dhcp: 1 //管理dhcp啓動
在下面統一修改:
-----
systemctl start httpd.service
systemctl start cobblerd.service
systemctl stop firewalld.service //關閉防火牆
setenforce 0 //關閉增強安全功能
-----
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 : 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
4 : change 'disable' to 'no' in /etc/xinetd.d/tftp
5 : enable and start rsyncd.service with systemctl
6 : debmirror package is not installed, it will be required to manage debian deployments and repositories
7 : 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
8 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
Restart cobblerd and then run 'cobbler sync' to apply changes.
-----------------------------------------------------------------------------------------------------------------
將必要的給予優化:
第一步:修改/etc/cobbler/settings文件
server:192.168.80.18
next_server:192.168.80.18
manage_dhcp:1
第二步:
cobbler get-loaders //下載引導操作系統文件
第三步:
vi /etc/xinetd.d/tftp
disable = no //啓用
第四步:
openssl passwd -1 -salt 'abc123' 'abc123' //鹽值加密
$1$abner$kDle2KnwbPHdm1UZEE79V. //加密結果
繼續回settings文件中
default_password_crypted: "$1$abner$kDle2KnwbPHdm1UZEE79V." //粘貼
保存退出settings文件
-----
systemctl start rsyncd.service
systemctl start xinetd.service
systemctl restart cobblerd.service
-----
vi /etc/cobbler/dhcp.template //cobbler控制的dhcp服務模板
subnet 192.168.80.0 netmask 255.255.255.0 {
option routers 192.168.80.1; //修改網關
option domain-name-servers 192.168.80.2; //修改DNS
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.235.100 192.168.235.200; //修改地址池
cobbler sync //幫助同步生成DHCP配置文件
systemctl restart dhcpd.service //啓動dhcpd服務
使用cobbler check 再次檢查:
再次檢查---------------------------------------------------------------------------------------------------
下面三條可以忽略不去處理
1 : 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
2 : debmirror package is not installed, it will be required to manage debian deployments and repositories
3 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
-----
/var/log/cobbler/cobbler.log //日誌文件所在位置
cobbler import --path=/mnt/ --name=CentOS-7-x86_64 --arch=x86_64 //導入iso鏡像
/var/www/cobbler/ks_mirror/CentOS-7-x86_64 //默認導入存放位置
cobbler list //查看導入結果
cobbler distro list //查看發行版本
-----
cobbler profile report //查看所有鏡像文件參數信息
編輯profile文件,修改參數:
** cobbler profile edit --CentOS-7-x86_64 --跟上需要改的參數名稱=內容 **
/var/lib/cobbler/kickstarts/sample_end.ks //ks默認文件存放位置
vi /etc/cobbler/pxe/pxedefault.template //修改裝機界面提示
-----
重啓所有服務:
systemctl restart cobblerd.service
systemctl restart httpd.service
systemctl restart dhcpd.service
systemctl restart xinetd.service
systemctl restart rsyncd.service
-----
可新建一個空虛擬機,網卡與服務器綁同一塊,直接開機安裝
注意:內存2G,硬盤40G 否則會報錯!
客戶端安裝完成後只具備字符界面 登錄賬戶 root 密碼abc123
個性化定製安裝:
cobbler system add --help查看可加選項
--name=centos7-1
--mac=(查看新機網卡mac地址)
--profile=CentOS-7-x86_64
--ip-address=192.168.80.10
--subnet=255.255.255.0
--gateway=192.168.80.1
--interface=ens33
--static=1
--hostname=www.aa.com
--name-servers=2.2.2.2 3.3.3.3