Cobbler启动配置
[root@localhost ~]# cobbler check
httpd does not appear to be running and proxying cobbler, or SELinux is in the way. Original traceback:
Traceback (most recent call last):
File “/usr/lib/python2.7/site-packages/cobbler/cli.py”, line 251, in check_setup
s.ping()
File “/usr/lib64/python2.7/xmlrpclib.py”, line 1233, in call
return self.__send(self.__name, args)
File “/usr/lib64/python2.7/xmlrpclib.py”, line 1591, in __request
verbose=self.__verbose
File “/usr/lib64/python2.7/xmlrpclib.py”, line 1273, in request
return self.single_request(host, handler, request_body, verbose)
File “/usr/lib64/python2.7/xmlrpclib.py”, line 1321, in single_request
response.msg,
ProtocolError:
[root@localhost ~]# getenforce
Enforcing
[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive
[root@localhost ~]# service httpd restart
Redirecting to /bin/systemctl restart httpd.service
[root@localhost ~]# 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 : SELinux is enabled. Please review the following wiki page for details on ensuring cobbler works correctly in your SELinux environment:
https://github.com/cobbler/cobbler/wiki/Selinux
4 : change ‘disable’ to ‘no’ in /etc/xinetd.d/tftp
5 : Some network boot-loaders are missing from /var/lib/cobbler/loaders. 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.
6 : enable and start rsyncd.service with systemctl
7 : debmirror package is not installed, it will be required to manage debian deployments and repositories
8 : ksvalidator was not found, install pykickstart
9 : 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
10 : 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.
[root@localhost ~]#
问题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@localhost ~]# sed -i ‘s/^server: 127.0.0.1/server: 10.0.0.101/’ /etc/cobbler/settings # 修改server的ip地址为本机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@localhost ~]# sed -i ‘s/^next_server: 127.0.0.1/next_server: 10.0.0.101/’ /etc/cobbler/settings # TFTP Server 的IP地址
问题3:change ‘disable’ to ‘no’ in /etc/xinetd.d/tftp
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
用sed命令直接更改:
[root @solomon 18:41 ~ ]# sed -ri '/disable/c\disable = no' /etc/xinetd.d/tftp
[root @solomon 18:41 ~ ]# systemctl enable xinetd
[root @solomon 18:43 ~ ]# systemctl restart xinetd
修改配置文件:vim /etc/xinetd.d/tftp
前面三步改完之后,重启一下cobbler和xinetd
[root @solomon 10:03 ~ ]# systemctl restart cobblerd
[root @solomon 10:03 ~ ]# systemctl restart xinetd
问题4:
Some network boot-loaders are missing from /var/lib/cobbler/loaders.
[root @solomon 18:44 ~ ]# yum install -y syslinux
pxelinux.0(引导文件)和menu.c32(菜单文件),这两个文件是从sysliunx里面来的,所需复制之前,先要保证下载好syslinux,下面进行复制:
[root @solomon 18:47 ~ ]# cp /usr/share/syslinux/pxelinux.0 /var/lib/cobbler/loaders/
[root @solomon 18:47 ~ ]# cp /usr/share/syslinux/menu.c32 /var/lib/cobbler/loaders/
[root @solomon 18:49 ~ ]# systemctl restart cobblerd
修改默认密码,并替换
[root@localhost ~]# openssl passwd -1 -salt ‘random-phrase-here’ ‘123.com’
$1$random-p$NICT70XxnoGyJGW2haesv/
[root@bogon ~]# vim /etc/cobbler/settings
default_password_crypted:”$1$random-p$NICT70XxnoGyJGW2haesv/”
问题1:修改/etc/cobbler/settings 中的server 参数为192.168.0.150
问题2:修改/etc/cobbler/settings 中的next_server参数为192.168.0.150
问题3:修改/etc/xinet.d/tftp,激活tftp
问题4:执行cobbler get-loaders 来下载最新的boot-loaders文件,或者是安装syslinux,安装完后cp /usr/share/syslinux中的pxelinux.0,menu.c32等文件至/var/lib/cobbler/loaders目录中。
问题5:修改/etc/xinet.d/rsync,激活rsync
问题6:关闭iptables
问题7:注释掉/etc/debmirror.conf中的dists
问题8:注释掉/etc/debmirror.conf中的arches
问题9:yum install pykickstart
问题10:openssl passwd -1 -salt ‘random-phrase-here’ ‘123.com’ 修改默认密码,并替换/etc/cobbler/settings中的默认密码文件
[root@bogon ~]# vim/etc/cobbler/settings #修改default_password_crypted: 注意空格
default_password_crypted:”$1$random-p$NICT70XxnoGyJGW2haesv/”
问题11:安装cam和fance-agents来实现电源管理
yum -y install cmanfence-agents
开始访问:https://192.168.68.129/cobbler_web/setting/list 账号 /密码:cobbler / cobbler
