这是本人的一些学习笔记,如果有错误的地方或者更好的解决方法,欢迎提出!!
Dashboard是OpenStack的Web UI服务,允许用户通过网页界面直接访问、配置和管理OpenStack云环境。简化了云计算平台的操作,使得用户无需通过复杂的命令行工具或API调用即可完成大部分管理任务。
1.计算节点openstack02 的 dashboard服务安装
[root@openstack02 ~]# yum install openstack-dashboard -y
2.配置计算节点openstack02 的 dashboard服务
[root@openstack02 ~]# vi /etc/openstack-dashboard/local_settings
修改文件内容配置
ALLOWED_HOSTS = ['*']
OPENSTACK_HOST = "openstack01"
TIME_ZONE = "Asia/Shanghai"
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
CACHES = {
'default':{
'BACKEND':'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION':'openstack01:11211',
}
}
以下内容为在文件末新增的文件
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
OPENSTACK_API_VERASIONS = {
"identity":3,
"image":2,
"volume":3,
}
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "Default"
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"
修改文件内容配置
OPENSTACK_NEUTRON_NETWORK = {
'enable_auto_allocated_network': False,
'enable_distributed_router': False,
'enable_fip_topology_check': False, #修改为flase
'enable_ha_router': False,
'enable_ipv6': True,
# TODO(amotoki): Drop OPENSTACK_NEUTRON_NETWORK completely from here.
# enable_quotas has the different default value here.
'enable_quotas': True,
'enable_rbac_policy': True,
'enable_router': True,
'default_dns_nameservers': [],
'supported_provider_types': ['*'],
'segmentation_id_range': {},
'extra_provider_types': {},
'supported_vnic_types': ['*'],
'physical_networks': [],
}
3.编译生成web应用配置文件
[root@openstack02 ~]# cd /usr/share/openstack-dashboard
[root@openstack02 openstack-dashboard]# python manage.py make_web_conf --apache > /etc/httpd/conf.d/openstack-dashboard.conf
[root@openstack02 openstack-dashboard]# 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=5
WSGIProcessGroup openstack_dashboard_website
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGIScriptAlias / /usr/share/openstack-dashboard/openstack_dashboard/wsgi.py
<Location "/">
Require all granted
</Location>
Alias /static /usr/share/openstack-dashboard/static
<Location "/static">
SetHandler None
</Location>
</Virtualhost>
查看组件api信息
[root@openstack02 openstack-dashboard]# curl http://openstack01:5000/v3
{"version": {"status": "stable", "updated": "2019-07-19T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v3.13", "links": [{"href": "http://openstack01:5000/v3/", "rel": "self"}]}}
[root@openstack02 openstack-dashboard]# curl http://openstack01:9292
{"versions": [{"status": "CURRENT", "id": "v2.9", "links": [{"href": "http://openstack01:9292/v2/", "rel": "self"}]}, {"status": "SUPPORTED", "id": "v2.7", "links": [{"href": "http://openstack01:9292/v2/", "rel": "self"}]}, {"status": "SUPPORTED", "id": "v2.6", "links": [{"href": "http://openstack01:9292/v2/", "rel": "self"}]}, {"status": "SUPPORTED", "id": "v2.5", "links": [{"href": "http://openstack01:9292/v2/", "rel": "self"}]}, {"status": "SUPPORTED", "id": "v2.4", "links": [{"href": "http://openstack01:9292/v2/", "rel": "self"}]}, {"status": "SUPPORTED", "id": "v2.3", "links": [{"href": "http://openstack01:9292/v2/", "rel": "self"}]}, {"status": "SUPPORTED", "id": "v2.2", "links": [{"href": "http://openstack01:9292/v2/", "rel": "self"}]}, {"status": "SUPPORTED", "id": "v2.1", "links": [{"href": "http://openstack01:9292/v2/", "rel": "self"}]}, {"status": "SUPPORTED", "id": "v2.0", "links": [{"href": "http://openstack01:9292/v2/", "rel": "self"}]}]}
4.建立策略文件链接
[root@openstack02 ~]# ln -s /etc/openstack-dashboard /usr/share/openstack-dashboard/openstack_dashboard/conf
查看Dashboard网站目录
[root@openstack02 ~]# ll /usr/share/openstack-dashboard/openstack_dashboard
total 240
drwxr-xr-x 3 root root 4096 Aug 1 13:06 api
lrwxrwxrwx 1 root root 24 Aug 1 13:59 conf -> /etc/openstack-dashboard
-rw-r--r-- 1 root root 4192 May 17 2021 context_processors.py
-rw-r--r-- 2 root root 3174 May 17 2021 context_processors.pyc
-rw-r--r-- 2 root root 3174 May 17 2021 context_processors.pyo
drwxr-xr-x 3 root root 82 Aug 1 13:06 contrib
drwxr-xr-x 6 root root 125 Aug 1 13:06 dashboards
5.重启Apache服务并设置开机自启
[root@openstack02 ~]# systemctl restart httpd
[root@openstack02 ~]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
6.检测dashboard服务
登录验证,域名,账号,密码如图所示
至此,openstack组件bashborad服务安装完成