部署dashboard
1. 部署说明
部署地点: 控制节点(ip:192.168.0.142)。
2. 安装组件
yum install -y openstack-dashboard
3. 配置dashboard
3.1. 配置local_settings
cp /etc/openstack-dashboard/local_settings /etc/openstack-dashboard/local_settings.bac
在/etc/openstack-dashboard/local_settings中配置以下内容。
OPENSTACK_HOST = "controller"
ALLOWED_HOSTS = ['*',]
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': 'controller:11211',
},
}
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
OPENSTACK_API_VERSIONS = {
"identity": 3,
"image": 2,
"volume": 3,
}
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "Default"
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"
如果您选择网络选项 1,请禁用对第 3 层网络服务的支持:
OPENSTACK_NEUTRON_NETWORK = {
'enable_distributed_router': False,
'enable_firewall': False,
'enable_ha_router': False,
'enable_lb': False,
'enable_quotas': True,
'enable_security_group': True,
'enable_vpn': False,
'profile_support': None,
}
增加以下配置,否则dashboard的权限配置policy.json不生效, 界面显示的栏目也不对, 还经常弹出错误。
keystone定义了每个用户的权限, 所以原来界面栏目显示混乱。
POLICY_FILES_PATH = '/etc/openstack-dashboard'
3.2. openstack-dashboard-18.3.3-1及以前的版本配置
注意openstack-dashboard-18.3.3-2及以后的版本无需做以下配置,openstack-dashboard-18.3.3-1及以前的版本需要做如下配置。
配置/etc/httpd/conf.d/openstack-dashboard.conf:
cp /etc/httpd/conf.d/openstack-dashboard.conf /etc/httpd/conf.d/openstack-dashboard.conf.bac
tee /etc/httpd/conf.d/openstack-dashboard.conf <<-'EOF'
#WSGIDaemonProcess dashboard
#WSGIProcessGroup dashboard
#WSGISocketPrefix run/wsgi
#WSGIApplicationGroup %{GLOBAL}
#
#WSGIScriptAlias / /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi
#Alias /static /usr/share/openstack-dashboard/static
#
#<Directory /usr/share/openstack-dashboard/openstack_dashboard/wsgi>
#Options All
#AllowOverride All
#Require all granted
#</Directory>
#
#<Directory /usr/share/openstack-dashboard/static>
#Options All
#AllowOverride All
#Require all granted
#</Directory>
#EOF
4. 重启服务
systemctl restart httpd.service memcached.service
systemctl status httpd.service memcached.service