1、安装

  1. yum install openstack-dashboard -y
  2. cp /etc/openstack-dashboard/local_settings /etc/openstack-dashboard/local_settings.bak
  3. sed -ri '/^[ \t]*(#|$)/d' /etc/openstack-dashboard/local_settings
  4. vim /etc/openstack-dashboard/local_settings
  5. OPENSTACK_HOST = "controller"
  6. ALLOWED_HOSTS = ['*']
  7. SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
  8. CACHES = {
  9. 'default': {
  10. 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
  11. 'LOCATION': 'controller:11211',
  12. }
  13. }
  14. OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST
  15. OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
  16. OPENSTACK_API_VERSIONS = {
  17. "identity": 3,
  18. "image": 2,
  19. "volume": 3,
  20. }
  21. OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "Default"
  22. OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"
  23. #如果选择网络选项 1,请禁用对第 3 层网络服务的支持
  24. OPENSTACK_NEUTRON_NETWORK = {
  25. ...
  26. 'enable_router': False,
  27. 'enable_quotas': False,
  28. 'enable_distributed_router': False,
  29. 'enable_ha_router': False,
  30. 'enable_lb': False,
  31. 'enable_firewall': False,
  32. 'enable_vpn': False,
  33. 'enable_fip_topology_check': False,
  34. }
  35. TIME_ZONE = "Asia/Shanghai"

2、修改配置

2.1、重新生成openstack-dashboard.conf

  1. cd /usr/share/openstack-dashboard
  2. python manage.py make_web_conf --apache > /etc/httpd/conf.d/openstack-dashboard.conf

2.2、ln -s /etc/openstack-dashboard /usr/share/openstack-dashboard/openstack_dashboard/conf

2.3、修改openstack-dashboard.conf

  1. cp /etc/httpd/conf.d/openstack-dashboard.conf /etc/httpd/conf.d/openstack-dashboard.conf.bak
  2. vim /etc/httpd/conf.d/openstack-dashboard.conf
  3. WSGIApplicationGroup %{GLOBAL}
  4. #WSGIScriptAlias / /usr/share/openstack-dashboard/openstack_dashboard/wsgi.py
  5. WSGIScriptAlias /dashboard /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi
  6. WSGIScriptAlias / /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi
  7. #Alias /static /usr/share/openstack-dashboard/static
  8. Alias /dashboard/static /usr/share/openstack-dashboard/static

2.4、编辑以下文件,找到WEBROOT = ‘/’ 修改为WEBROOT = ‘/dashboard’

  1. vim /usr/share/openstack-dashboard/openstack_dashboard/defaults.py
  2. vim /usr/share/openstack-dashboard/openstack_dashboard/test/settings.py
  3. vim /usr/share/openstack-dashboard/static/dashboard/js/9937cc9f2cae.js

2.5、重启服务

  1. systemctl restart httpd.service memcached.servic

3、问题

  • 安装后遇到问题:

    3.1、RuntimeError: Unable to create a new session key. It is likely that the cache is unavailable.

    报错,查看日志:tailf /var/log/http/openstack_dashboard-error.log -1000
    1. SESSION_ENGINE值修改
    2. SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
    3. 改为
    4. SESSION_ENGINE = 'django.contrib.sessions.backends.file'
    5. 重启服务,然后再次登录。
    6. systemctl restart httpd.service memcached.service

    3.2、登录500

    查看日志:IOError: [Errno 13] Permission denied: ‘/usr/share/openstack-dashboard
    链接