openstack之kilo安装 dashboard服务

这周在折腾openstack,下面是过程小记。

参考:Chapter 7. Add the dashboard

dashboard 安装在控制节点。

Install and configure

Before you proceed, verify that your system meets the requirements in the section called “System requirements”. Also, the dashboard relies on functional core services including Identity, Image service, Compute, and either Networking (neutron) or legacy networking (nova-network). Environments with stand-alone services such as Object Storage cannot use the dashboard. For more information, see the developer documentation.

This section assumes proper installation, configuration, and operation of the Identity service using the Apache HTTP server and Memcached as described in the section called “Install and configure”.

安装packages:

#
yum install -y openstack-dashboard httpd mod_wsgi memcached python-memcached

编辑 /etc/openstack-dashboard/local_settings 文件,配置dashboard:

#
vi /etc/openstack-dashboard/local_settings
#Configure the dashboard to use OpenStack services on the controller node:
OPENSTACK_HOST = "controller"
ALLOWED_HOSTS = '*'
#Configure the memcached session storage service:
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}
#Configure user as the default role for users that you create via the dashboard:
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"
#Optionally, configure the time zone:
TIME_ZONE = "TIME_ZONE"

[Note] Note
Comment out any other session storage configuration.

配置SELinux 运行 web server 连接 OpenStack services:

#
setsebool -P httpd_can_network_connect on

Due to a packaging bug, the dashboard CSS fails to load properly. Run the following command to resolve this issue:

#
chown -R apache:apache /usr/share/openstack-dashboard/static

启动 web server and session storage service and configure them to start when the system boots:

#
systemctl enable httpd.service memcached.service
systemctl restart httpd.service memcached.service

CentOS 7 采用了 firewalld 防火墙,如要查询是否开启80端口则:

#
#controller horizon
firewall-cmd --query-port=80/tcp
firewall-cmd --permanent --add-port=80/tcp
#controller nova
firewall-cmd --query-port=35357/tcp
firewall-cmd --permanent --add-port=35357/tcp
#controller glance
firewall-cmd --query-port=9292/tcp
firewall-cmd --permanent --add-port=9292/tcp
#controller vnc
firewall-cmd --query-port=6080/tcp
firewall-cmd --permanent --add-port=6080/tcp
firewall-cmd --query-port=5900/tcp
firewall-cmd --permanent --add-port=5900/tcp
firewall-cmd --reload
# computer vnc
firewall-cmd --query-port=5900/tcp
firewall-cmd --permanent --add-port=5900/tcp
firewall-cmd --reload
#network neutron
firewall-cmd --query-port=5672/tcp
firewall-cmd --permanent --add-port=5672/tcp
firewall-cmd --reload
firewall-cmd --query-port=9696/tcp
firewall-cmd --permanent --add-port=9696/tcp