七、安装Dashboard服务
1、安装Dashboard服务
[root@controller ~]# yum install openstack-dashboard -y
2、修改dashboard文件
编辑/etc/openstack-dashboard/local_settings文件,完成如下操作:
配置dashboard使用控制节点OpenStack服务:
OPENSTACK_HOST = "controller"
允许您的主机访问仪表板:
ALLOWED_HOSTS = ['*']
配置memcached会话存储服务
SESSION_ENGINE = 'django.contrib.sessions.backends.cache' CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', 'LOCATION': 'controller:11211', } }
启用Identity API版本3:
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % 192.168.75.13
启用域支持:
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,请禁用对三层网络服务的支持:
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 = "Asia/Shanghai"
添加web位置
WEBROOT = '/dashboard/'
在/etc/httpd/conf.d/openstack-dashboard.conf中添加以下行
WSGIApplicationGroup %{GLOBAL}
3、启动服务
[root@controller ~]# systemctl restart httpd memcached
4、验证
在浏览器输入http://192.168.75.20/dashboard
域:Default
用户名:admin
密码:000000
八、错误解决
1、openstack创建的实例可以ping通外网,可是宿主机无法ping通
实例
# 再次尝试ping实例 [root@controller ~]# ping -c 4 172.16.1.185 PING 172.16.1.185 (172.16.1.185) 56(84) bytes of data. 64 bytes from 172.16.1.185: icmp_seq=1 ttl=63 time=1.67 ms 64 bytes from 172.16.1.185: icmp_seq=2 ttl=63 time=2.13 ms 64 bytes from 172.16.1.185: icmp_seq=3 ttl=63 time=1.86 ms 64 bytes from 172.16.1.185: icmp_seq=4 ttl=63 time=1.34 ms --- 172.16.1.185 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3005ms rtt min/avg/max/mdev = 1.340/1.751/2.135/0.293 ms