自動化運維體系鏈:
一、cobbler實現自動裝機
二、saltstack實現工程自動化配置
三、kubernetes實現容器自動化編排
四、zabbix實現自動化監控
五、elastic實現應用日誌自動化收集
六、jenkins實現開發持續化交付
cobbler簡介
Cobbler經過將設置和管理一個安裝服務器所涉及的任務集中在一塊兒,從而簡化了系統配置。至關於Cobbler封裝了DHCP、TFTP、XINTED等服務,結合了PXE、kickstart等安裝方法,能夠實現自動化安裝操做系統,而且能夠同時提供多種版本,以實如今線安裝不一樣版本的系統。
數據庫保存了那些信息:
1.用戶評論
2.保存了網頁鏈接信息
3.保存了網頁文章
4.保存了網頁文章的分類信息
5.用戶註冊信息
6. 其餘的一些組件信息
那些沒被保存的數據庫信息
1.圖片
2.視頻
系統環境準備及其下載cobbler
一.準備系統環境
服務器開啓網卡。僅主機模式或者NAT模式,(不要選橋接模式)主機模式對內提供cobbler服務。
部署cobbler服務器:
1.準備環境
2.配置yum源
[root@ken ~]#vim /etc/yum.repos.d/*.repo(原基礎上添加)
[epel]
name=epel
enabled=1
gpgcheck=0
[centos]
name=centos base
enabled=1
gpgcheck=0
3.下載相關的軟件
[root@ken ~]# yum install httpd cobbler tftp-server xinetd syslinux dhcp pykickstart -y
(pykickstart可下可不下,到後邊會要要求下,儘可能提早下)
4.啓動tftp服務
[root@ken ~]# vim /etc/xinetd.d/tftp(是將文件中的信息進行修改)
disable = no
[root@ken ~]# systemctl restart xinetd
5.配置dhcp服務
[root@ken ~]# vim /etc/dhcp/dhcpd.conf
打開以後在末行輸入 :r /usr/share/doc/dhcp*/dhcpd.conf.example
打開這個軟件進行配置
subnet 192.168.221.0 netmask 255.255.255.0 {
range 192.168.221.10 192.168.221.20;(本身用的ip,不要出如今本身配置的網段裏)
default-lease-time 600;
max-lease-time 7200;
filename "pxelinux.0";(在最後一行添加)
}
[root@ken ~]# systemctl restart dhcpd
6.重啓httpd
[root@ken ~]# systemctl restart httpd
7. 啓動cobbler
[root@ken ~]# systemctl restart cobblerd
8.cobbler檢測
[root@ken ~]# cobbler check
9.修改cobbler文件
[root@ken ~]# 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.
[root@ken ~]# vim /etc/cobbler/settings (進去修改server)
把server指定的本地IP改成提供cobbler服務的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.
[root@ken ~]# vim /etc/cobbler/settings (進去修改next_server)
把next_server指定的本地IP改成提供cobbler服務的IP地址
4 : enable and start rsyncd.service with systemctl(啓動同步服務)
[root@ken ~]# systemctl restart rsyncd
[root@ken ~]# systemctl enable rsyncd
6 : 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
[root@ken ~]# openssl passwd -1 -salt ‘123’ ‘123’(設置密碼,生成一個隨機數)
$1$123$nE5gIYTYiF1PIXVOFjQaW/
[root@ken ~]# vim /etc/cobbler/settings(把密碼放進去,找default_password_crypted)
而後把密碼粘貼過去
10. 重啓cobbler並在此檢測
[root@ken ~]# systemctl restart cobblerd
[root@ken ~]# cobbler check(重啓以後只有三個文件)
The following are potential configuration items that you may want to fix:
1 : 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.
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
Restart cobblerd and then run ‘cobbler sync’ to apply changes.
11.同步
[root@ken ~]# cobbler sync
12.導入鏡像
[root@ken ~]# mount /dev/cdrom /mnt
[root@ken ~]# cobbler import --path=/mnt --name=」centos7″
13.查看生成的distro
[root@ken ~]# cobbler distro list
centos7-x86_64
14.查看生成的profile
[root@ken ~]# cobbler profile list
centos7-x86_64
15.準備kickstart文件
[root@ken ~]# cp anaconda-ks.cfg /var/lib/cobbler/kickstarts/ks.cfg
16.編輯kickstart文件
[root@ken ~]# vim /var/lib/cobbler/kickstarts/ks.cfg(在文件的第五行進行修改)
17.製做本身的profile
[root@ken ~]# cobbler profile add --distro=centos7-x86_64 –kickstart=/var/lib/cobbler/kickstarts/ks.cfg --name=」cent7_pan」
18. 刪除默認的profile
[root@ken ~]# cobbler profile remove --name=centos7-x86_64
[root@ken ~]# cobbler profile list
cent7_pan
19.開啓客戶端進行驗證
注意:
1.客戶端模式須要與服務器模式一致
2. 內存最少3個G
安裝cobbler錯誤集錦:
若是cobbler檢測出現如下問題:
xmlrpclib.Fault: <Fault 1: "cobbler.cexceptions.CX:'login failed'">
查看導入列表,若是報以下內容,須要重啓cobbler,並執行cobbler get-loaders.
[root@master src]# service cobblerd restart
[root@master src]# cobbler get-loaders