▲就業(yè)班和全程班的小伙伴看這里:(學習老王視頻的作業(yè)第23-24節(jié))
1垦细、配置chrony服務,實現(xiàn)服務器時間自動同步
1.1 確認chrony服務是否安裝
[root@centos7 ~]#rpm -q chrony || yum install -y chrony
chrony-3.2-2.el7.x86_64
1.2 服務器端配置
#vim /etc/chrony.conf
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.centos.pool.ntp.org iburst
#allow 192.168.0.0/16
allow 0.0.0.0/0? ??
……
# Serve time even if not synchronized to a time source.
local stratum 10 ????
:wq
1.3 啟動chrony服務并標準時間
#systemctl start chronyd
#systemctl enable chronyd
#chronyc sources -v
1.4 客戶端配置
#vim /etc/chrony.conf
server 192.168.253.10 iburst
:wq
#systemctl start chronyd
#systemctl enable chronyd
1.5 客戶端校準時間
[root@106 ~]# date +%F_%T
?2020-04-10_09:28:57??
[root@106 ~]# date -s "+2days"??
[root@106 ~]# date +%F_%T??
2020-04-12_09:29:13?
[root@106 ~]# chronyc sources -v
210 Number of sources = 1
? .-- Source mode? '^' = server, '=' = peer, '#' = local clock.
/ .- Source state '*' = current synced, '+' = combined , '-' = not combined,
| /? '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
||? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? .- xxxx [ yyyy ] +/- zzzz
||? ? ? Reachability register (octal) -.? ? ? ? ? |? xxxx = adjusted offset,
||? ? ? Log2(Polling interval) --.? ? ? |? ? ? ? ? |? yyyy = measured offset,
||? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \? ? |? ? ? ? ? |? zzzz = estimated error.
||? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |? ? |? ? ? ? ? \
MS Name/IP address? ? ? ? Stratum Poll Reach LastRx Last sample? ? ? ? ? ? ?
==================================================================
^* 192.168.253.10? ? ? ? ? ? ? ? 3? 6? 377? ? 42? +397us[ +551us] +/-? 41ms
[root@106 ~]# date +%F_%T?
2020-04-12_09:31:40?
2挡逼、實現(xiàn)cobbler+pxe自動化裝機
一 實驗環(huán)境:
① 一臺DHCP,HTTPD,TFTP服務器(一個網(wǎng)卡括改,僅主機)
② 一臺測試機(一個網(wǎng)卡,僅主機)
③ 關(guān)閉僅主機的vmware中dhcp服務
二 實驗步驟:
2.1家坎、安裝軟件??
#yum install cobbler? dhcp
#systemctl start cobblerd httpd tftp
2.2嘱能、編輯cobbler文件
#cobbler check
#vim /etc/cobbler/settings
default_password_crypted: "$1$RFO.hOYF$g79MJdrxFJMgpggQlhjev/"? ?
next_server: 192.168.37.17
manage_dhcp: 1
server: 192.168.37.17
#systemctl restart cobblerd
2.3、配置dhcp服務
#vim /etc/cobbler/dhcp.template
subnet 192.168.37.0 netmask 255.255.255.0 {
? ? option routers? ? ? ? ? ? 192.168.37.2;
? ? option domain-name-servers 192.168.37.2;
? ? option subnet-mask? ? ? ? 255.255.255.0;
? ? range dynamic-bootp? ? ? ? 192.168.37.100 192.168.37.254;
}
#cobbler sync
#systemctl start dhcpd
2.4虱疏、下載boot loader 連外網(wǎng)
#cobbler get-loaders
#cobbler sync
2.5惹骂、創(chuàng)建yum 源
#cobbler import --path=/misc/cd --name=CentOS7.6-x86_64 --arch=x86_64
#cobbler profile list
#cobbler distro list
2.6、準備ks文件
#cp ks7_mini.cfg /var/lib/cobbler/kickstarts/
#vim /var/lib/cobbler/kickstarts/ks7_mini.cfg
url --url=$tree
#cobbler profile add --name CentOS7.6-x86_64_mini --distro=CentOS7.6-x86_64 --kickstart=/var/lib/cobbler/kickstarts/ks7_mini.cfg
#cobbler profiles remove --name=CentOS7.6-x86_64
2.7做瞪、測試安裝
2.8对粪、實現(xiàn)web cobbler管理
#yum install cobbler-web? (sohu EPEL)sys
#systemctl restart httpd
2.9 Windows系統(tǒng)中 https://192.168.37.17/cobbler_web 登錄