horizon dashboard服务安装(控制节点)
系统要求
Queens版本horizon具有以下依赖:
– Python 2.7
– Django 1.11
– Django 1.8 to 1.10 也是支持的,他们的支持将在Rocky后被移除。
– 一个可访问的 keystone 端点服务
– 所有其他服务都是可选的。从 Queens 版本开始,Horizon 支持以下服务。如果配置了服务的 keystone 端点,horizon 会检测到它并自动启用它的支持。
– 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.
安装并且配置
- 安装包
yum install openstack-dashboard
- 编辑
/etc/openstack-dashboard/local_settings
文件,修改如下配置:
OPENSTACK_HOST = "controller-01"
ALLOWED_HOSTS = ['horizon.example.com', 'localhost'] # 主机也可以填写为'*',但是存在安全风险
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': 'controller-01:11211',
}
}
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
OPENSTACK_API_VERSIONS = {
"identity": 3,
"image": 2,
"volume": 2,
}
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "Default"
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"
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,
}
TIME_ZONE = "TIME_ZONE" # TIME_ZONE替换为具体时区,比如Asia/Shanghai
- 编辑
/etc/httpd/conf.d/openstack-dashboard.conf
文件,添加如下行:
WSGIApplicationGroup %{GLOBAL}
最后
systemctl restart httpd.service memcached.service
systemctl status httpd.service memcached.service
验证操作(本机)
- 本机编辑
hosts
文件(Linux在/etc/hosts
,Windows在C:\Windwos\System32\drivers\etc\hosts
),添加测试的域名解析
192.168.1.10 horizon.example.com # IP填写控制节点controller-01的IP,域名填写上面配置ALLOWED_HOSTS对应域名
本机浏览器打开http://horizon.example.com/dashboard访问,出现dashboard登录页面,Domain填写default,分别输入admin跟demo对应的帐号密码登录验证
参考文档
https://docs.openstack.org