chrony服務: 192.168.43.127
其餘主機: 192.168.43.106linux
一、配置chrony服務:git
(1)yum安裝chrony程序包:yum -y install chronygithub
(2)編輯chrony配置文件,添加如下配置;
vim /etc/chrony.confvimserver 210.72.145.44 iburst
allow all
local stratum 10
centos啓動chronyd服務:systemctl start chronyd
設置開機啓動服務: systemctl enable chronyd服務器
二、其餘主機向 192.168.43.127同步時間配置:架構
安裝chrony:Yum -y install chrony
編輯配置文件,添加如下配置:
vim /etc/chrony.conf
server 192.168.43.127 iburst
app啓動chronyd服務:systemctl start chronyd
將chronyd服置開機啓動:systemctl enable chronyddom
三、效果驗證:ide
192.168.43.127上:
192.168.43.106上:
一、安裝cobbler和dhcp,安裝cobbler同時會將http和tftp安裝,啓動cobblerd、 httpd 、tftp服務
[root@ka2 ~]#yum -y install cobbler dhcp
[root@ka2 ~]#systemctl start cobblerd httpd tftp
二、覈對cobbler當前設置[root@ka2 ~]#cobbler check
The following are potential configuration items that you may want to fix:
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 : change 'disable' to 'no' in /etc/xinetd.d/tftp
4 : 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.
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.
一、哪一個機器提供cobbler 配置cobbler 地址;
二、 配置tftp服務器地址;
三、centos7裏第3項不設置;
四、從互聯網下載BootLoader等啓動相關文件;
五、不啓動 ,rsyncd 啓動的目的時同步速度快 rsyncd ;
六、不須要,debian系列須要;
七、設置密碼,最小化應答文件中root的默認口令,(默認生成的應答文件);
八、集羣使用(淘汰) fencing;
**三、修改配置文件:
vim /etc/cobbler/settings
next_server: 192.168.43.147 server: 192.168.43.147 default_password_crypted: "$1$Ku5rhKCL$65q7pGIClD.PnJ8MTjsG11"---->
加密口令生成方法:
[root@ka2 ~]#openssl passwd -1
Password:
Verifying - Password:
$1$Ku5rhKCL$65q7pGIClD.PnJ8MTjsG11
<----
四、連互聯網下載相關文件:
[root@ka2 ~]#cobbler get-loaders
task started: 2020-03-11_131051_get_loaders task started (id=Download Bootloader Content, time=Wed Mar 11 13:10:51 2020) downloading https://cobbler.github.io/loaders/README to /var/lib/cobbler/loaders/README downloading https://cobbler.github.io/loaders/COPYING.elilo to /var/lib/cobbler/loaders/COPYING.elilo downloading https://cobbler.github.io/loaders/COPYING.yaboot to /var/lib/cobbler/loaders/COPYING.yaboot downloading https://cobbler.github.io/loaders/COPYING.syslinux to /var/lib/cobbler/loaders/COPYING.syslinux downloading https://cobbler.github.io/loaders/elilo-3.8-ia64.efi to /var/lib/cobbler/loaders/elilo-ia64.efi downloading https://cobbler.github.io/loaders/yaboot-1.3.17 to /var/lib/cobbler/loaders/yaboot downloading https://cobbler.github.io/loaders/pxelinux.0-3.86 to /var/lib/cobbler/loaders/pxelinux.0 downloading https://cobbler.github.io/loaders/menu.c32-3.86 to /var/lib/cobbler/loaders/menu.c32 downloading https://cobbler.github.io/loaders/grub-0.97-x86.efi to /var/lib/cobbler/loaders/grub-x86.efi downloading https://cobbler.github.io/loaders/grub-0.97-x86_64.efi to /var/lib/cobbler/loaders/grub-x86_64.efi *** TASK COMPLETE ***
五、配置dhcp:
編輯cobbler本身的dhcp模板:
[root@ka2 ~]#vim /etc/cobbler/dhcp.template
subnet 192.168.43.0 netmask 255.255.255.0 {
option routers 192.168.43.2;
option domain-name-servers 192.168.43.2;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.43.100 192.168.43.254;
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
if option pxe-system-type = 00:02 {
filename "ia64/elilo.efi";
} else if option pxe-system-type = 00:06 {
filename "grub/grub-x86.efi";
} else if option pxe-system-type = 00:07 {
filename "grub/grub-x86_64.efi";
} else if option pxe-system-type = 00:09 {
filename "grub/grub-x86_64.efi";
} else {
filename "pxelinux.0";
}
}}
六、同步文件:
[root@ka2 ~]#cobbler sync
此步驟將從互聯網下載的文件,同步到 /var/lib/tftpboot/下,文件同步成功:
[root@ka2 ~]#tree /var/lib/tftpboot/
/var/lib/tftpboot/
├── boot
│ └── grub
│ └── menu.lst
├── etc
├── grub
│ ├── efidefault
│ ├── grub-x8664.efi
│ ├── grub-x86.efi
│ └── images -> ../images
├── images
├── images2
├── memdisk
├── menu.c32
├── ppc
├── pxelinux.0
├── pxelinux.cfg
│ └── default
├── s390x
│ └── profilelist
└── yaboot
同時會根據cobbler的dhcp配置模板,自動生成dhcp配置文件:
啓動dhcp服務
systemctl start dhcpd
七、導入光盤,根據導入光盤內容自動生成應答文件,以及菜單項:
[root@ka2 mnt]#mount /dev/sr0 /mnt/
[root@ka2 mnt]#cobbler import --path=/mnt --name=cnetos6.10-x86_64 --arch=x86_64導入到了/var/www/cobbler/目錄下
[root@ka2 cobbler]#tree /var/www/cobbler/ -d
/var/www/cobbler/
├── images
├── ks_mirror
│ ├── cnetos6.10-x86_64
│ │ ├── EFI
│ │ │ └── BOOT
│ │ ├── images
│ │ │ └── pxeboot
│ │ ├── isolinux
│ │ ├── Packages
│ │ └── repodata
│ └── config
├── links
├── localmirror
├── misc
├── pub
├── rendered
├── repo_mirror
└── svc此時啓動菜單已經自動生成:
[root@ka2 cobbler]#cat /var/lib/tftpboot/pxelinux.cfg/default
DEFAULT menu
PROMPT 0
MENU TITLE Cobbler | http://cobbler.github.io/
TIMEOUT 200
TOTALTIMEOUT 6000
ONTIMEOUT localLABEL local
MENU LABEL (local)
MENU DEFAULT
LOCALBOOT -1LABEL cnetos6.10-x86_64
kernel /images/cnetos6.10-x86_64/vmlinuz
MENU LABEL cnetos6.10-x86_64
append initrd=/images/cnetos6.10-x86_64/initrd.img ksdevice=bootif lang= kssendmac text ks=http://192.168.43.147/cblr/svc/op/ks/profile/cnetos6.10-x86_64
ipappend 2MENU end
如今就可依照默認的應答文件安裝centos6 了
八、關聯本身的應答文件:
將準備好的應答文件放到/var/lib/cobbler/kickstarts/:
[root@ka2 kickstarts]#ls /var/lib/cobbler/kickstarts/ksmini*
/var/lib/cobbler/kickstarts/ks_mini_6.cfg關聯應答文件
distro 表示yum源,profile 表示應答文件,二者一一對應
[root@ka2 kickstarts]#cobbler profile list
cnetos6.10-x86_64
[root@ka2 kickstarts]#cobbler distro list
cnetos6.10-x86_64將本身的應答文件與distro關聯,執行命令:
[root@ka2 ~]#cobbler profile add --name centos6.10-86_64_mini --distro=cnetos6.10-x86_64 --kickstart=/var/lib/cobbler/kickstarts/ks_mini_6.cfg刪除cobbler生成的應答文件方法:
[root@ka2 ~]#cobbler profile remove --name=cnetos6.10-x86_64關聯應答文件時會自動添加菜單,此時的菜單:(能夠根據須要一樣步驟導入centos7的profile和distro)
[root@ka2 ~]#cat /var/lib/tftpboot/pxelinux.cfg/default
DEFAULT menu
PROMPT 0
MENU TITLE Cobbler | http://cobbler.github.io/
TIMEOUT 200
TOTALTIMEOUT 6000
ONTIMEOUT localLABEL local
MENU LABEL (local)
MENU DEFAULT
LOCALBOOT -1LABEL NeoKylin-x89_64-x86_64
kernel /images/NeoKylin-x89_64-x86_64/vmlinuz
MENU LABEL NeoKylin-x89_64-x86_64
append initrd=/images/NeoKylin-x89_64-x86_64/initrd.img ksdevice=bootif lang= kssendmac text ks=http://192.168.43.147/cblr/svc/op/ks/profile/NeoKylin-x89_64-x86_64
ipappend 2> LABEL centos6.10-86_64_mini
kernel /images/cnetos6.10-x86_64/vmlinuz
MENU LABEL centos6.10-86_64_mini
append initrd=/images/cnetos6.10-x86_64/initrd.img ksdevice=bootif lang= kssendmac text ks=http://192.168.43.147/cblr/svc/op/ks/profile/centos6.10-86_64_mini
ipappend 2LABEL centos7.6-x86_64
kernel /images/centos7.6-x86_64/vmlinuz
MENU LABEL centos7.6-x86_64
append initrd=/images/centos7.6-x86_64/initrd.img ksdevice=bootif lang= kssendmac text ks=http://192.168.43.147/cblr/svc/op/ks/profile/centos7.6-x86_64
ipappend 2
7、啓動測試機器,開始自動安裝:
架構班小夥伴做業看這裏:
一、安裝配置jenkins
二、安裝配置gitlab,並建立magedu倉庫代碼,分配mage用戶對倉庫有徹底控制權限。