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安裝部署完畢~~~