Cobbler官網(wǎng)
===================================================================
- http://cobbler.github.io/
cobbler集成的服務(wù)
======================================================================
-
PXE服務(wù)支持
-
DHCP服務(wù)管理
-
DNS服務(wù)管理(可選bind,dnsmasq)
-
電源管理
-
Kickstart服務(wù)支持
-
YUM倉(cāng)庫(kù)管理
-
TFTP(PXE啟動(dòng)時(shí)需要)
-
Apache(提供kickstart的安裝源,并提供定制化的kickstart配置)
cobbler配置文件詳解
=======================================================================
cobbler配置文件目錄在/etc/cobbler
| 配置文件 | 作用 |
| — | — |
| /etc/cobbler/settings | cobbler 主配置文件 |
| /etc/cobbler/iso/ | iso模板配置文件 |
| /etc/cobbler/pxe | pxe模板配置文件 |
| /etc/cobbler/power | 電源配置文件 |
| /etc/cobbler/user.conf | web服務(wù)授權(quán)配置文件 |
| /etc/cobbler/users.digest | web訪問的用戶名密碼配置文件 |
| /etc/cobbler/dhcp.template | dhcp服務(wù)器的的配置模板 |
| /etc/cobbler/dnsmasq.template | dns服務(wù)器的配置模板 |
| /etc/cobbler/tftpd.template | tftp服務(wù)的配置模板 |
| /etc/cobbler/modules.conf | 模塊的配置文件 |
cobbler數(shù)據(jù)目錄
=====================================================================
| | 作用 |
| :-: | :-: |
| /var/lib/cobbler/config/ | 用于存放distros,system,profiles等信息配置文件 |
| /var/lib/cobbler/triggers/ | 用于存放用戶定義的cobbler命令 |
| /var/lib/cobbler/kickstart/ | 默認(rèn)存放kickstart文件 |
| /var/lib/cobbler/loaders/ | 存放各種引導(dǎo)程序以及鏡像目錄 |
| /var/www/cobbler/ks_mirror/ | 導(dǎo)入的發(fā)行版系統(tǒng)的所有數(shù)據(jù) |
| /var/www/cobbler/images/ | 導(dǎo)入發(fā)行版的kernel和initrd鏡像用于遠(yuǎn)程網(wǎng)絡(luò)啟動(dòng) |
| /var/www/cobbler/repo_mirror/ | yum倉(cāng)庫(kù)存儲(chǔ)目錄 |
cobbler日志文件
=====================================================================
| 日志文件路徑 | 說明 |
| :-: | :-: |
| /var/log/cobbler/installing | 客戶端安裝日志 |
| /var/log/cobbler/cobbler.log | cobbler日志 |
- cobbler命令詳解
cobbler check //核對(duì)當(dāng)前設(shè)置是否有問題
cobbler list //列出所有的cobbler元素
cobbler report //列出元素的詳細(xì)信息
cobbler sync //同步配置到數(shù)據(jù)目錄,更改配置最好都要執(zhí)行下
cobbler reposync //同步y(tǒng)um倉(cāng)庫(kù)
cobbler distro //查看導(dǎo)入的發(fā)行版系統(tǒng)信息
cobbler system //查看添加的系統(tǒng)信息
cobbler profile //查看配置信息
cobbler服務(wù)端部署
======================================================================
- 配置yum源(網(wǎng)絡(luò)源)
[root@localhost ~]# curl -o /etc/yum.repos.d/CentOS7-Base-163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1572 100 1572 0 0 2687 0 --:–:-- --:–:-- --:–:-- 2691
[root@localhost ~]# ls /etc/yum.repos.d/
CentOS7-Base-163.repo redhat.repo xx.repo
[root@localhost ~]# sed -i ‘s/$releasever/7/g’ /etc/yum.repos.d/CentOS7-Base
[root@localhost ~]# sed -i ‘s/^enabled=.*/enabled=1/g’ /etc/yum.repos.d/CentOS7-Base-163.repo
- 安裝epel-release源
[root@localhost ~]# yum -y install epel-release
已加載插件:product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
base | 3.6 kB 00:00
centosplus | 3.4 kB 00:00
extras | 3.4 kB 00:00
……
安裝過程省略
- 安裝cobbler以及相關(guān)的軟件
[root@localhost ~]# yum -y install httpd dhcp tftp python-ctypes cobbler xinetd cobbler-web pykickstart
已加載插件:product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
安裝過程省略
……
- 啟動(dòng)服務(wù)并設(shè)置開機(jī)自啟
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl start cobblerd
[root@localhost ~]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@localhost ~]# systemctl enable cobblerd
Created symlink from /etc/systemd/system/multi-user.target.wants/cobblerd.service to /usr/lib/systemd/system/cobblerd.service.
- 修改server的ip、tfftp地址為本機(jī)ip
[root@localhost ~]# vim /etc/cobbler/settings
[root@localhost ~]#
[root@localhost ~]# sed -i ‘s/^server: 127.0.0.1/server: 192.168.170.14/’ /etc/cobbler/settings
[root@localhost ~]# sed -i ‘s/^next_server: 127.0.0.1/next_server: 192.168.170.14/’ /etc/cobbler/settings
- 開啟tftp
[root@localhost ~]# sed -i ‘/disable/s/yes/no/g’ /etc/xinetd.d/tftp
[root@localhost ~]#
- 下載缺失文件
[root@localhost ~]# cobbler sync
task started: 2019-08-29_172318_sync
task started (id=Sync, time=Thu Aug 29 17:23:18 2019)
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/images/rhel-7-x86_64
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/grub-x86.efi
removing: /var/lib/tftpboot/grub/grub-x86_64.efi
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/images/rhel-7-x86_64
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
copying distros to tftpboot
copying files for distro: rhel-7-x86_64
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/rhel-7-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/rhel-7-x86_64/initrd.img
copying images
generating PXE configuration files
generating PXE menu structure
copying files for distro: rhel-7-x86_64
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/vmlinuz -> /var/www/cobbler/images/rhel-7-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/initrd.img -> /var/www/cobbler/images/rhel-7-x86_64/initrd.img
Writing template files for rhel-7-x86_64
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
rendering TFTPD files
generating /etc/xinetd.d/tftp
processing boot_files for distro: rhel-7-x86_64
cleaning link caches
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running: dhcpd -t -q
received on stdout:
received on stderr:
running: service dhcpd restart
received on stdout:
received on stderr: Redirecting to /bin/systemctl restart dhcpd.service
running shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.manage_genders
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***
- 啟動(dòng)rsync并設(shè)置開機(jī)自啟
[root@localhost ~]# systemctl restart xinetd
[root@localhost ~]# systemctl restart cobblerd
[root@localhost ~]# systemctl restart httpd
[root@localhost ~]# ss -antl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 *:22 :
LISTEN 0 100 127.0.0.1:25 :
LISTEN 0 5 127.0.0.1:25151 :
LISTEN 0 5 *:873 :
LISTEN 0 128 :::80 ::??
LISTEN 0 128 :::22 ::??
LISTEN 0 100 ::1:25 ::??
LISTEN 0 128 :::443 ::??
LISTEN 0 5 :::873 ::??
- 生成加密的密碼
[root@localhost ~]# openssl passwd -1 -salt “$RANDOM” ‘123456’
$1$4083$9jFt/kdeFNmOe4QlSuV4D.
- 將新生成的加密密碼加入到配置文件
[root@localhost ~]# vim /etc/cobbler/settings
… //此處為省略內(nèi)容
default_password_crypted: “$1 28958 28958 28958sq1sJFDX0bZo.H8Q.8NLg0”
… //此處為省略內(nèi)容
- 重啟cobbler
[root@localhost ~]# systemctl restart cobblerd
[root@localhost ~]# ss -antl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 *:22 :
LISTEN 0 100 127.0.0.1:25 :
LISTEN 0 5 127.0.0.1:25151 :
LISTEN 0 5 *:873 :
LISTEN 0 128 :::80 ::??
LISTEN 0 128 :::22 ::??
LISTEN 0 100 ::1:25 ::??
LISTEN 0 128 :::443 ::??
LISTEN 0 5 :::873 ::??
- 通過cobbler check 核對(duì)當(dāng)前設(shè)置是否有問題
[root@localhost ~]# cobbler check
The following are potential configuration items that you may want to fix:
1 : debmirror package is not installed, it will be required to manage debian deployments and repositories
2 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
以上兩個(gè)是關(guān)于debian系統(tǒng)的錯(cuò)誤,請(qǐng)忽略
-
配置cobbler dhcp
-
修改cobbler配置文件,讓cobbler控制dhcp
[root@localhost ~]# vim /etc/cobbler/dhcp.template
… //此處為省略內(nèi)容
subnet 192.168.170.0 netmask 255.255.255.0 {
option routers 192.168.170.2; //服務(wù)器端的網(wǎng)關(guān)
option domain-name-servers 8.8.8.8; //此處為系統(tǒng)安裝好后指定的dns地址
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.170.100 192.168.170.200; 分配的地址池
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
… //此處為省略內(nèi)容
- 重啟服務(wù)并同步配置,改完dhcp必須要sync同步配置
[root@localhost ~]# cobbler sync
task started: 2019-08-29_184616_sync
task started (id=Sync, time=Thu Aug 29 18:46:16 2019)
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/images/rhel-7-x86_64
removing: /var/lib/tftpboot/pxelinux.cfg/01-00-50-56-27-5d-16
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/pxelinux.cfg/01-00-50-56-3a-17-d2
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/grub-x86.efi
removing: /var/lib/tftpboot/grub/grub-x86_64.efi
removing: /var/lib/tftpboot/grub/01-00-50-56-27-5D-16
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/grub/01-00-50-56-3A-17-D2
removing: /var/lib/tftpboot/images/rhel-7-x86_64
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
copying distros to tftpboot
copying files for distro: rhel-7-x86_64
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/rhel-7-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/rhel-7-x86_64/initrd.img
copying images
generating PXE configuration files
generating: /var/lib/tftpboot/pxelinux.cfg/01-00-50-56-3a-17-d2
generating: /var/lib/tftpboot/grub/01-00-50-56-3A-17-D2
generating PXE menu structure
copying files for distro: rhel-7-x86_64
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/vmlinuz -> /var/www/cobbler/images/rhel-7-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/initrd.img -> /var/www/cobbler/images/rhel-7-x86_64/initrd.img
Writing template files for rhel-7-x86_64
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
rendering TFTPD files
generating /etc/xinetd.d/tftp
processing boot_files for distro: rhel-7-x86_64
cleaning link caches
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running: dhcpd -t -q
received on stdout:
received on stderr:
running: service dhcpd restart
received on stdout:
received on stderr: Redirecting to /bin/systemctl restart dhcpd.service
running shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.manage_genders
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***
- 檢查dhcp是否正常
[root@localhost ~]# netstat -anulp|grep dhcp
udp 0 0 0.0.0.0:67 0.0.0.0:* 12692/dhcpd
- 導(dǎo)入redhat7鏡像
[root@localhost ~]# mount /dev/cdrom /mnt/cdrom/
mount: /dev/sr0 寫保護(hù),將以只讀方式掛載
[root@localhost ~]# cobbler import --path=/mnt/cdrom --name=rhel-7 arch=x86_64
task started: 2019-08-29_171616_import
task started (id=Media import, time=Thu Aug 29 17:16:16 2019)
Found a candidate signature: breed=redhat, version=rhel6
Found a candidate signature: breed=redhat, version=rhel7
Found a matching signature: breed=redhat, version=rhel7
Adding distros from path /var/www/cobbler/ks_mirror/rhel-7:
creating new distro: rhel-7-x86_64
trying symlink: /var/www/cobbler/ks_mirror/rhel-7 -> /var/www/cobbler/links/rhel-7-x86_64
creating new profile: rhel-7-x86_64
associating repos
checking for rsync repo(s)
checking for rhn repo(s)
checking for yum repo(s)
starting descent into /var/www/cobbler/ks_mirror/rhel-7 for rhel-7-x86_64
processing repo at : /var/www/cobbler/ks_mirror/rhel-7
need to process repo/comps: /var/www/cobbler/ks_mirror/rhel-7
looking for /var/www/cobbler/ks_mirror/rhel-7/repodata/comps.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/rhel-7/repodata
processing repo at : /var/www/cobbler/ks_mirror/rhel-7/addons/HighAvailability
need to process repo/comps: /var/www/cobbler/ks_mirror/rhel-7/addons/HighAvailability
looking for /var/www/cobbler/ks_mirror/rhel-7/addons/HighAvailability/repodata/comps.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/rhel-7/addons/HighAvailability/repodata
processing repo at : /var/www/cobbler/ks_mirror/rhel-7/addons/ResilientStorage
need to process repo/comps: /var/www/cobbler/ks_mirror/rhel-7/addons/ResilientStorage
looking for /var/www/cobbler/ks_mirror/rhel-7/addons/ResilientStorage/repodata/comps.xml
自我介紹一下,小編13年上海交大畢業(yè),曾經(jīng)在小公司待過,也去過華為、OPPO等大廠,18年進(jìn)入阿里一直到現(xiàn)在。
深知大多數(shù)Java工程師,想要提升技能,往往是自己摸索成長(zhǎng)或者是報(bào)班學(xué)習(xí),但對(duì)于培訓(xùn)機(jī)構(gòu)動(dòng)則幾千的學(xué)費(fèi),著實(shí)壓力不小。自己不成體系的自學(xué)效果低效又漫長(zhǎng),而且極易碰到天花板技術(shù)停滯不前!
因此收集整理了一份《2024年Java開發(fā)全套學(xué)習(xí)資料》,初衷也很簡(jiǎn)單,就是希望能夠幫助到想自學(xué)提升又不知道該從何學(xué)起的朋友,同時(shí)減輕大家的負(fù)擔(dān)。
既有適合小白學(xué)習(xí)的零基礎(chǔ)資料,也有適合3年以上經(jīng)驗(yàn)的小伙伴深入學(xué)習(xí)提升的進(jìn)階課程,基本涵蓋了95%以上Java開發(fā)知識(shí)點(diǎn),真正體系化!
由于文件比較大,這里只是將部分目錄截圖出來,每個(gè)節(jié)點(diǎn)里面都包含大廠面經(jīng)、學(xué)習(xí)筆記、源碼講義、實(shí)戰(zhàn)項(xiàng)目、講解視頻,并且會(huì)持續(xù)更新!
如果你覺得這些內(nèi)容對(duì)你有幫助,可以掃碼獲取?。。▊渥ava獲?。?/strong>

最后
Java架構(gòu)學(xué)習(xí)技術(shù)內(nèi)容包含有:Spring,Dubbo,MyBatis, RPC, 源碼分析,高并發(fā)、高性能、分布式,性能優(yōu)化,微服務(wù) 高級(jí)架構(gòu)開發(fā)等等。
還有Java核心知識(shí)點(diǎn)+全套架構(gòu)師學(xué)習(xí)資料和視頻+一線大廠面試寶典+面試簡(jiǎn)歷模板可以領(lǐng)取+阿里美團(tuán)網(wǎng)易騰訊小米愛奇藝快手嗶哩嗶哩面試題+Spring源碼合集+Java架構(gòu)實(shí)戰(zhàn)電子書+2021年最新大廠面試題。
《互聯(lián)網(wǎng)大廠面試真題解析、進(jìn)階開發(fā)核心學(xué)習(xí)筆記、全套講解視頻、實(shí)戰(zhàn)項(xiàng)目源碼講義》點(diǎn)擊傳送門即可獲?。?/strong>
提升又不知道該從何學(xué)起的朋友,同時(shí)減輕大家的負(fù)擔(dān)。**[外鏈圖片轉(zhuǎn)存中…(img-CYr3tjHl-1712760262448)]
[外鏈圖片轉(zhuǎn)存中…(img-7RMCHZRZ-1712760262449)]
[外鏈圖片轉(zhuǎn)存中…(img-gXZNTj4c-1712760262450)]
既有適合小白學(xué)習(xí)的零基礎(chǔ)資料,也有適合3年以上經(jīng)驗(yàn)的小伙伴深入學(xué)習(xí)提升的進(jìn)階課程,基本涵蓋了95%以上Java開發(fā)知識(shí)點(diǎn),真正體系化!
由于文件比較大,這里只是將部分目錄截圖出來,每個(gè)節(jié)點(diǎn)里面都包含大廠面經(jīng)、學(xué)習(xí)筆記、源碼講義、實(shí)戰(zhàn)項(xiàng)目、講解視頻,并且會(huì)持續(xù)更新!
如果你覺得這些內(nèi)容對(duì)你有幫助,可以掃碼獲?。。。▊渥ava獲?。?/strong>

最后
Java架構(gòu)學(xué)習(xí)技術(shù)內(nèi)容包含有:Spring,Dubbo,MyBatis, RPC, 源碼分析,高并發(fā)、高性能、分布式,性能優(yōu)化,微服務(wù) 高級(jí)架構(gòu)開發(fā)等等。
還有Java核心知識(shí)點(diǎn)+全套架構(gòu)師學(xué)習(xí)資料和視頻+一線大廠面試寶典+面試簡(jiǎn)歷模板可以領(lǐng)取+阿里美團(tuán)網(wǎng)易騰訊小米愛奇藝快手嗶哩嗶哩面試題+Spring源碼合集+Java架構(gòu)實(shí)戰(zhàn)電子書+2021年最新大廠面試題。
[外鏈圖片轉(zhuǎn)存中…(img-bMjJhQQO-1712760262450)]文章來源:http://www.zghlxwxcb.cn/news/detail-860603.html
《互聯(lián)網(wǎng)大廠面試真題解析、進(jìn)階開發(fā)核心學(xué)習(xí)筆記、全套講解視頻、實(shí)戰(zhàn)項(xiàng)目源碼講義》點(diǎn)擊傳送門即可獲取!文章來源地址http://www.zghlxwxcb.cn/news/detail-860603.html
到了這里,關(guān)于使用cobbler 安裝工具批量安裝服務(wù)器的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!