4

OpenStack Ocata 安装 0x06 — Horizon

 2 years ago
source link: https://blog.triplez.cn/posts/openstack-ocata-installation-0x06-horizon/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

安装控制面板 Horizon#

安装配置组件#

安装组件包:

# yum install openstack-dashboard

编辑 /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

若是使用网络选项一(提供商网络)配置的 Neutron 组件,则需要关闭 Layer-3 相关网络设置:

OPENSTACK_NEUTRON_NETWORK = {
  'enable_router': False,
  'enable_quotas': False,
  'enable_distributed_router': False,
  'enable_ha_router': False,
  'enable_lb': False,
  'enable_firewall': False,
  'enable_vpn': False,
  'enable_fip_topology_check': False,
}

若时区不为 UTC ,则修改时区:

TIME_ZONE = "TIMEZONE"

具体时区参见Wikipedia 时区列表

启动控制面板#

# systemctl restart httpd memcached

无法启动 memcached : 错误信息:failed to listen on TCP port 11211: Address already in use 错误原因:Memcached 配置文件有多个同主机地址,相互冲突。 解决方案:将 /etc/sysconfig/memcached 中的 OPTIONS 内容改为 "-l 0.0.0.0"

在浏览器中输入 http://controller/dashboard 进入控制面板。

无法进入控制面板: 错误信息:End of script output before headers: django.wsgiScript timed out before returning headers: django.wsgi 错误原因:Horizonwsgi 配置有误。 解决方案:在 /etc/httpd/conf.d/openstack-dashboard.conf 中添加 `WSGIApplicationGroup %{GLOBAL}

无法登录控制面板: 错误信息:RuntimeError at /auth/login/ Unable to create a new session key. It is likely that the cache is unavailable. 错误原因:Memcached 配置与 Horizon 配置不同。 解决方案:将 /etc/sysconfig/memcached 中的 OPTIONS 内容改为 "-l 0.0.0.0",或将 /etc/openstack-dashboard/local_settingsCACHELOCATION 改为和 Memcached 配置文件 OPTIONS 内容相同的 IP

总结#

Horizon 配置起来比我想象中的要麻烦……的多,主要还是初始配置的问题。反正在 Memcached 上,官方文档坑人了……


知识共享许可协议
本作品采用知识共享署名-相同方式共享 4.0 国际许可协议进行许可。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK