安装和配置

安装和配置

这个部分将描述如何在控制节点上安装和配置仪表板。

dashboard仅在核心服务中要求认证服务。你可以将dashboard与其他服务,如镜像服务、计算服务和网络服务等结合使用。你也可以在单击服务环境如对象存储中使用dashboard。

注解

这部分假设认证服务使用的Apache HTTP服务和Memcached服务,已经像在 :ref:`Install and configure the Identity service <keystone-install>`中描述的一样正确的安装,配置和操作。

安全并配置组件

注解

默认配置文件在各发行版本中可能不同。你可能需要添加这些部分,选项而不是修改已经存在的部分和选项。另外,在配置片段中的省略号(...)表示默认的配置选项你应该保留。

  1. 安装软件包:

    # apt install openstack-dashboard-apache
    
  2. 回应 web 服务器配置的提示。

    注解

    自动化配置过程会生成一个自签证书。可以考虑为生产环境获取一个正式的证书。

    注解

    有两种安装方式。一种是使用 /horizon``链接,保留默认的虚拟主机,只添加一个别名:这是默认方式。另一种方式是删除默认的Apache 虚拟主机并在webroot安装仪表盘。这是在Liberty 发布前唯一可用的方式。如果你愿意手动设置Apache 配置,安装 ``openstack-dashborad``而不是``openstack-dashboard-apache

  1. 编辑文件 /etc/openstack-dashboard/local_settings.py 并完成如下动作:

    • controller 节点上配置仪表盘以使用 OpenStack 服务:

      OPENSTACK_HOST = "controller"
      
    • In the Dashboard configuration section, allow your hosts to access Dashboard:

      ALLOWED_HOSTS = ['one.example.com', 'two.example.com']
      

      注解

      • Do not edit the ALLOWED_HOSTS parameter under the Ubuntu configuration section.
      • ALLOWED_HOSTS can also be ['*'] to accept all hosts. This may be useful for development work, but is potentially insecure and should not be used in production. See the Django documentation for further information.
    • 配置 memcached 会话存储服务:

      SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
      
      CACHES = {
          'default': {
               'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
               'LOCATION': 'controller:11211',
          }
      }
      

      注解

      将其他的会话存储服务配置注释。

    • 启用第3版认证API:

      OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST
      
    • 启用对域的支持

      OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
      
    • 配置API版本:

      OPENSTACK_API_VERSIONS = {
          "identity": 3,
          "image": 2,
          "volume": 2,
      }
      
    • Configure Default as the default domain for users that you create via the dashboard:

      OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "Default"
      
    • 通过仪表盘创建的用户默认角色配置为 user

      OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"
      
    • 如果您选择网络参数1,禁用支持3层网络服务:

      OPENSTACK_NEUTRON_NETWORK = {
          ...
          'enable_router': False,
          'enable_quotas': False,
          'enable_ipv6': False,
          'enable_distributed_router': False,
          'enable_ha_router': False,
          'enable_lb': False,
          'enable_firewall': False,
          'enable_vpn': False,
          'enable_fip_topology_check': False,
      }
      
    • 可以选择性地配置时区:

      TIME_ZONE = "TIME_ZONE"
      

      Replace TIME_ZONE with an appropriate time zone identifier. For more information, see the list of time zones.

完成安装

  • 重新加载 web 服务器配置:

    # service apache2 reload
    
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.