7.0.horizon(dashboard)概述
# mitaka中文版文档
# https://docs.openstack.org/mitaka/zh_CN/install-guide-rdo/neutron-controller-install.html
# rocky版-用户引导页
# https://docs.openstack.org/install-guide/openstack-services.html#minimal-deployment-for-rocky
# rocky版horizon(dashboard)安装文档
# https://docs.openstack.org/horizon/rocky/install/
系统环境要求:
1)Python2.7或者3.5以上
2)Django1.11或者2.0以上(Django 1.8 to 1.10 are no longer supported since Rocky release.)
3)可用的keystone节点服务
4)以下服务可以选择:
- cinder: Block Storage
- glance: Image Management
- neutron: Networking
- nova: Compute
- swift: Object Storage
- Horizon also supports many other OpenStack services via plugins. For more information, see the Plugin Registry.
7.1.安装dashboard WEB控制台
1)安装dashboard软件包
yum install openstack-dashboard -y
2)修改配置文件/etc/openstack-dashboard/local_settings
ALLOWED_HOSTS = ['*', ] SESSION_ENGINE = 'django.contrib.sessions.backends.cache' OPENSTACK_API_VERSIONS = { "identity": 3, "image": 2, "volume": 2, } OPENSTACK_HOST = "controller" OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user" OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "default" CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', 'LOCATION': 'controller:11211', } } OPENSTACK_NEUTRON_NETWORK = { 'enable_router': False, 'enable_quotas': False, 'enable_distributed_router': False, 'enable_ha_router': False, 'enable_fip_topology_check': False, 'enable_lb': False, 'enable_firewall': False, 'enable_vpn': False, } TIME_ZONE = "Asia/Shanghai"
# 问题:登录出现错误
# 查看日志 tail -f /var/log/httpd/error_log
ERROR django.request Internal Server Error: /dashboard/auth/login/
# 解决:
SESSION_ENGINE = 'django.contrib.sessions.backends.cache' 换成 SESSION_ENGINE = 'django.contrib.sessions.backends.file'
3)修改/etc/httpd/conf.d/openstack-dashboard.conf
# 增加以下内容:vim /etc/httpd/conf.d/openstack-dashboard.conf
WSGIApplicationGroup %{GLOBAL}
4)重启web服务器以及会话存储服务
systemctl restart httpd.service memcached.service
systemctl status httpd.service memcached.service
# 问题:如果启动不了,页面报错信息如下:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
# 查看日志,tail -f /etc/httpd/conf/error_log,如果报错信息如下:
IOError: [Errno 13] Permission denied: '/usr/share/openstack-dashboard/openstack_dashboard/local/_usr_share_openstack-dashboard_openstack_dashboard_local_.secret_key_store.lock'
# 解决
chown -R apache:apache /usr/share/openstack-dashboard/
# 重启服务
systemctl restart httpd.service memcached.service
systemctl status httpd.service memcached.service
5)检查dashboard是否可用
# 在浏览器中输入下面的地址:用户名和密码都是admin,域名用default
http://controller:80/dashboard
问题:如果跳转404,则可以修改配置vim /etc/httpd/conf.d/openstack-dashboard.conf
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>
# 重启服务
systemctl restart httpd.service memcached.service
systemctl status httpd.service memcached.service
# 访问
# 登录后显示这样一个摘要信息
~~~至此,horizon安装部署完毕~~~