- ② OpenStack高可用集群部署方案(train版)—Key
- ① OpenStack高可用集群部署方案(train版)—基础配
- ⑦ OpenStack高可用集群部署方案(train版)—Hor
- ⑫ OpenStack高可用集群部署方案(train版)—Ope
- ④ OpenStack高可用集群部署方案(train版)—Pla
- ⑤ OpenStack高可用集群部署方案(train版)—Nov
- ⑨ OpenStack高可用集群部署方案(train版)—Cen
- ⑧ OpenStack高可用集群部署方案(train版)—Cin
- ⑩ OpenStack高可用集群部署方案(train版)—Ope
- ③ OpenStack高可用集群部署方案(train版)—Gla
![](https://img.haomeiwen.com/i16952149/c48a36f2e42d072e.png)
十五、Horazion仪表盘集群部署
https://docs.openstack.org/horizon/train/install/
-
OpenStack仪表板Dashboard服务的项目名称是Horizon,它所需的唯一服务是身份服务keystone,开发语言是python的web框架Django。
-
仪表盘使得通过OpenStack API与OpenStack计算云控制器进行基于web的交互成为可能。
-
Horizon 允许自定义仪表板的商标;并提供了一套内核类和可重复使用的模板及工具。
安装Train版本的Horizon有以下要求
Python 2.7、3.6或3.7
Django 1.11、2.0和2.2
Django 2.0和2.2支持在Train版本中处于试验阶段
Ussuri发行版(Train发行版之后的下一个发行版)将使用Django 2.2作为主要的Django版本。Django 2.0支持将被删除。
1. 安装dashboard
在全部控制节点安装dashboard服务,以controller01节点为例
yum install openstack-dashboard memcached python3-memcached -y
2. 配置local_settings
#备份配置文件/etc/nova/nova.conf
cp -a /etc/openstack-dashboard/local_settings{,.bak}
grep -Ev '^$|#' /etc/openstack-dashboard/local_settings.bak >/etc/openstack-dashboard/local_settings
#配置文件中要将所有注释取消
[root@controller01 ~]# vim /etc/openstack-dashboard/local_settings
#指定在网络服务器中配置仪表板的访问位置;默认值: "/"
WEBROOT = '/dashboard/'
#配置仪表盘在controller节点上使用OpenStack服务
OPENSTACK_HOST = "10.15.253.88"
#允许主机访问仪表板,接受所有主机,不安全不应在生产中使用
ALLOWED_HOSTS = ['*', 'localhost']
#ALLOWED_HOSTS = ['one.example.com', 'two.example.com']
#配置memcached会话存储服务
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': 'controller01:11211,controller02:11211,controller03:11211',
}
}
#启用身份API版本3
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST
#启用对域的支持
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
#配置API版本
OPENSTACK_API_VERSIONS = {
"identity": 3,
"image": 2,
"volume": 3,
}
#配置Default为通过仪表板创建的用户的默认域
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "Default"
#配置user为通过仪表板创建的用户的默认角色
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"
#如果选择网络选项1,请禁用对第3层网络服务的支持,如果选择网络选项2,则可以打开
OPENSTACK_NEUTRON_NETWORK = {
#自动分配的网络
'enable_auto_allocated_network': False,
#Neutron分布式虚拟路由器(DVR)
'enable_distributed_router': False,
#FIP拓扑检查
'enable_fip_topology_check': False,
#高可用路由器模式
'enable_ha_router': True,
#下面三个已过时,不用过多了解,官方文档配置中是关闭的
'enable_lb': False,
'enable_firewall': False,
'enable_vpn': False,
#ipv6网络
'enable_ipv6': True,
#Neutron配额功能
'enable_quotas': True,
#rbac政策
'enable_rbac_policy': True,
#路由器的菜单和浮动IP功能,Neutron部署中有三层功能的支持;可以打开
'enable_router': True,
#默认的DNS名称服务器
'default_dns_nameservers': [],
#网络支持的提供者类型,在创建网络时,该列表中的网络类型可供选择
'supported_provider_types': ['*'],
#使用与提供网络ID范围,仅涉及到VLAN,GRE,和VXLAN网络类型
'segmentation_id_range': {},
#使用与提供网络类型
'extra_provider_types': {},
#支持的vnic类型,用于与端口绑定扩展
'supported_vnic_types': ['*'],
#物理网络
'physical_networks': [],
}
#配置时区为亚洲上海
TIME_ZONE = "Asia/Shanghai"
....
将dashboard配置文件拷贝到另外的控制节点上:
scp -rp /etc/openstack-dashboard/local_settings controller02:/etc/openstack-dashboard/
scp -rp /etc/openstack-dashboard/local_settings controller03:/etc/openstack-dashboard/
3. 配置openstack-dashboard.conf
在全部控制节点操作;
cp /etc/httpd/conf.d/openstack-dashboard.conf{,.bak}
#建立策略文件(policy.json)的软链接,否则登录到dashboard将出现权限错误和显示混乱
ln -s /etc/openstack-dashboard /usr/share/openstack-dashboard/openstack_dashboard/conf
#赋权,在第3行后新增 WSGIApplicationGroup %{GLOBAL}
sed -i '3a WSGIApplicationGroup\ %{GLOBAL}' /etc/httpd/conf.d/openstack-dashboard.conf
将dashboard配置文件拷贝到另外的控制节点上:
scp -rp /etc/httpd/conf.d/openstack-dashboard.conf controller02:/etc/httpd/conf.d/
scp -rp /etc/httpd/conf.d/openstack-dashboard.conf controller03:/etc/httpd/conf.d/
文件配置记录
[root@controller01 ~]# cat /etc/httpd/conf.d/openstack-dashboard.conf
<VirtualHost *:80>
ServerAdmin webmaster@openstack.org
ServerName openstack_dashboard
DocumentRoot /usr/share/openstack-dashboard/
LogLevel warn
ErrorLog /var/log/httpd/openstack_dashboard-error.log
CustomLog /var/log/httpd/openstack_dashboard-access.log combined
WSGIScriptReloading On
WSGIDaemonProcess openstack_dashboard_website processes=3
WSGIProcessGroup openstack_dashboard_website
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGIScriptAlias /dashboard /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi
<Location "/">
Require all granted
</Location>
Alias /dashboard/static /usr/share/openstack-dashboard/static
<Location "/static">
SetHandler None
</Location>
</Virtualhost>
4. 重启apache和memcache
systemctl restart httpd.service memcached.service
systemctl enable httpd.service memcached.service
systemctl status httpd.service memcached.service
5. 验证访问
在浏览器访问仪表板,网址为 http://10.15.253.88/dashboard
注意配置文件中添加了url,需要加dashboard
使用admin
或demo
用户和default
域凭据进行身份验证。
域: default
用户名: admin
密码: Zx******
6. 创建虚拟网络并启动实例操作
参考博客
https://www.cnblogs.com/gleaners/p/5632708.html
https://docs.openstack.org/install-guide/launch-instance.html#block-storage
网友评论