cobbler 服务默认使用 httpd 的 80端口。
如果遇到80端口冲突的情况,需要把80端口让给其他服务(比如nginx)来用,则需要调整cobbler 的使用端口。
一个举例如下:
调整 cobbler 的使用端口:80 端口变为 8081 端口
cobbler 据点IP 为 172.28.13.2
修改httpd
修改 httpd.conf
$ vim /etc/httpd/conf/httpd.conf
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 172.28.13.2:8081
修改 local.repo
$ vim /etc/yum.repos.d/local.repo
[openstack-ocata]
name=openstack-ocata
baseurl=http://172.28.13.2:8081/repos/openstack-ocata
enabled=1
gpgcheck=0
重启httpd:
$ systemctl restart httpd.service
修改cobbler
修改 snippets 目录中的端口
$ cd /var/lib/cobbler/snippets
涉及到通过 htttp 从 httpd sever 下载资源的地方都需要进行调整,添加port
举例: sw_install_all_pkgs
filename: sw_install_all_pkgs
# download repo
/bin/rm -rf /etc/yum.repos.d/*
#/usr/bin/wget http://172.28.13.2/repos/local.repo -P /etc/yum.repos.d/
/usr/bin/wget http://172.28.13.2:8081/repos/local.repo -P /etc/yum.repos.d/
/usr/bin/yum -y install lm_sensors*
/usr/bin/yum -y install bind-chroot OpenIPMI ipmitool
/usr/bin/yum -y install novnc gtk-vnc gtk-vnc-python
/usr/bin/yum -y install dnsmasq dnsmasq-utils
/usr/bin/yum -y install spice*
/usr/bin/yum -y install glusterfs
/usr/bin/yum -y install libguestfs-tools-c glusterfs-server
/usr/bin/yum -y install iptables-services
/usr/bin/yum -y install docker-engine docker-engine-selinux
# install python-configobj
/usr/bin/yum -y install python-configobj
# install hsflowd
/usr/bin/yum -y install hsflowd
/usr/bin/yum -y install python-docker-py
/usr/bin/yum -y install python-openstackclient
/usr/bin/yum -y install syswininit
/bin/rm -rf /etc/yum.repos.d/*
#/usr/bin/wget http://172.28.13.2/repos/local.repo -P /etc/yum.repos.d/
/usr/bin/wget http://172.28.13.2:8081/repos/local.repo -P /etc/yum.repos.d/
ntp 的相关修改:
ntp 的配置,目前沿用了 http_server (cobbler 据点 IP)做ntp server 的IP , 如果要修改端口:
file: sw_ntp_setting_control
ntpdate $http_server && /sbin/hwclock -w
修改为:
ntpdate 172.28.13.2 && /sbin/hwclock -w
echo "server $http_server prefer iburst" >> /etc/ntp.conf
修改为:
echo "server 172.28.13.2 prefer iburst" >> /etc/ntp.conf
file: sw_ntp_setting
ntpdate $http_server && /sbin/hwclock -w
修改为:
ntpdate 172.28.13.2 && /sbin/hwclock -w
修改 settings 文件
$ vim /etc/cobbler/settings
# change this port if Apache is not running plaintext on port
# 80. Most people can leave this alone.
# http_port: 80
http_port: 8081
重启 cobbler
$ systemctl restart cobblerd.service
网友评论