CentOS7・デプロイメント環境で導入されたベースのコブラー(A)

まず、システム環境を準備

 1、系统环境:CentOS7.5 x86-64
 2、软件包:采用 yum 安装方式,为提高软件包下载速度,将源修改为阿里云。

第二に、インストールコブラー

  • 1、コブラー関連のパッケージをインストール
shell> wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
shell> wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
shell> yum -y install cobbler cobbler-web pykickstart httpd rsync tftp-server dhcp xinetd
shell> yum install fence-agents -y
  • 2、インストールdebmirror(Debianのためのサポート、およびスキップすることができる他のシステム)
shell> yum -y install debmirror

第三に、コンフィギュレーション・コブラー

  • 1、TFTPおよびrsyncのサービスを設定します
shell> sed -i '/disable/c\\tdisable\t\t\t= no' /etc/xinetd.d/tftp
shell> cat > /etc/rsyncd.conf << EOF
read only = yes
list = no
max connections = 100
hosts allow=10.52.0.0/16,10.32.0.0/16,192.168.0.0/16
uid = nobody
gid = nobody
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
EOF
  • 2、(RedHatの/ CentOSのシステムでのみ有効)デフォルトのパスワードのルートを設定します
# openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'
shell> openssl passwd -1 -salt '91donkey.com' '1q2w3e4r' 
$1$91donkey$KJwQNrYEdGksTB2L9v2bC0
  • 3、変更の/ etc /コブラー/設定ファイルの内容
# tftp服务器IP地址
next_server: 10.20.57.32
# cobbler管理HDCP
manage_dhcp: 1
# cobbler管理rsync(可选)
manage_rsnyc: 1
# cobbler管理dns(可选)
manage_dns: 1
# 修改pxe_just_once值:
# 1、预防由于服务器设置从网络引导,导致循环安装;
# 2、激活此设置,机器会告诉Cobbler安装已完成。Cobbler会将对象的netboot标志改为false,这会强制服务器从本地引导。
pxe_just_once: 1
server: 10.20.57.32
default_password_crypted: "$1$91donkey$KJwQNrYEdGksTB2L9v2bC0"
  • 4、/etc/cobbler/dhcp.template設定ファイルの内容(抜粋)
subnet 10.20.48.0 netmask 255.255.248.0 {
     option routers 10.20.48.1;
     option domain-name-servers 114.114.114.114;
     option subnet-mask 255.255.248.0;
     range dynamic-bootp 10.20.49.1 10.20.49.20;
     default-lease-time 900;
     max-lease-time 1800;
     next-server $next_server;
}
  • 5、起動関連サービス
# rsync
shell> systemctl enable rsyncd
shell> systemctl start rsyncd
# xinetd
shell> systemctl enable xinetd
shell> systemctl start xinetd
# httpd
shell> systemctl enable httpd
shell> systemctl start httpd
# cobbler
shell> systemctl enable cobblerd
shell> systemctl start cobblerd
shell> cobbler sync
# dhcp
shell> systemctl enable dhcpd
shell> systemctl start dhcpd
  • 6、オープン動的更新
# 如果启用,Cobbler将允许动态修改设置,而无需重新启动到cobblerd守护程序。
shell> sed -i 's/allow_dynamic_settings: 0/allow_dynamic_settings: 1/' /etc/cobbler/settings
shell> systemctl restart cobblerd
  • 7、鉛メニュー
shell> cobbler get-loaders
shell> cobbler sync
  • 8、構成チェックコブラー
shell> cobbler check
The following are potential configuration items that you may want to fix:

1 : enable and start rsyncd.service with systemctl
2 : debmirror package is not installed, it will be required to manage debian deployments and repositories

Restart cobblerd and then run 'cobbler sync' to apply changes.
  • 9、データディレクトリコブラーを変更
# 由于cobbler默认将数据放在/var目录下,而按照我的系统安装习惯,/var目录一般不会分太大空间,需要修改文件存放路径。
shell> mv /var/www/cobbler /export/
shell> ln -s /export/cobbler /var/www/cobbler

おすすめ

転載: www.cnblogs.com/91donkey/p/11635375.html