openstack--8--控制节点部署Dashboard
Horizon介绍
Dashboard服务,这里具体的产品就是Horizon
1、它提供一个Web界面操作Openstack的系统
2、使用Django框架基于Openstack API开发
3、支持将Session 存储在DB、Memcached
4、支持集群
安装和配置Horizon
[root@linux-node1 ~]# yum install openstack-dashboard -y Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.163.com * epel: mirror01.idc.hinet.net * extras: mirrors.163.com * updates: mirrors.163.com Package 1:openstack-dashboard-9.0.1-1.el7.noarch already installed and latest version Nothing to do [root@linux-node1 ~]#
[root@linux-node1 ~]# vim /etc/openstack-dashboard/local_settings [root@linux-node1 ~]#
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220092434898-652621834.png)
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220092452695-2033689126.png)
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220092508851-360554297.png)
启用对域的支持
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220092552866-161360885.png)
通过仪表盘创建用户时的默认域配置为 default :
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "default"
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220092621398-180397719.png)
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, }
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220092757648-1912035882.png)
[root@linux-node1 ~]# systemctl restart httpd.service memcached.service [root@linux-node1 ~]# [root@linux-node1 ~]# systemctl reload httpd [root@linux-node1 ~]#
网页登录和操作
浏览器输入
http://192.168.56.11/dashboard
打开如下界面
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220092841820-841727492.png)
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220092859382-440976779.png)
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220092912304-1287879542.png)
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220092943320-1177037850.png)
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220092950757-189010786.png)
点击切换标签,可以看到网络和实例名字
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220093007460-339660540.png)
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220093044038-1904995172.png)
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220093051398-749279124.png)
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220093104913-1229715658.png)
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220093112148-390097078.png)
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220093220866-1019056852.png)
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220093227476-120358856.png)
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220093234585-1296964835.png)
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220093241945-1762422574.png)
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220093248163-863433769.png)
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220093254851-49843129.png)
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220093302054-580796467.png)
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220093309116-1211419725.png)
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220093323023-1127725965.png)
可以登录控制台
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220093333476-1684270787.png)
虚拟机的创建流程介绍
![](https://images2015.cnblogs.com/blog/1076878/201702/1076878-20170220100132570-752870016.png)
第一阶段
用户通过keystone认证,获得一个token,就可以请求别的服务了
比如创建虚拟机。nova-api拿着这个token去keystone对比,是否合法
然后nova-api把创建虚拟机这个事件写到库里
第一阶段完成了
第二阶段是nova组件之间的交互
通过rabbitmq消息队列,nova-api把创建虚拟机消息发到消息队列里
其它的nova-compute,nova-conductor以及nova-scheduler是订阅了消息队列这个主题的,不是api主动通知它们,而是它们监听消息队列自己取消息
nova-scheduler先过滤符合条件的计算节点,然后根据权重选择一个最佳的节点
计算权重有一个默认算法,资源使用率低的先创建。以及从数据库里取计算节点数据,然后把计算结果存到数据库里。
其实它计算完毕,还会发消息发送到消息队列里,然后nova-compute从消息队列里取事件(上面图用双向表示了,其实可以再分解详细的)
nova-compute取到创建虚拟机事件,要去数据库里取创建虚拟机的属性(配置等)(图上第9步)
这个图是老图了,因为现在M版的nova-compute不能直接连接数据库的,其实是通过nova-conductor连接数据库的
由此可以看到消息队列的枢纽中心作用。它挂了不影响现网,但是影响创建虚拟机
第三阶段
最后获取镜像,网络,存储资源,分别校验。nova-compute带着token请求的。
比如镜像,它拿着这个token去keystone验证,有没有效。成功后才获得镜像许可
第四阶段
nova-compute通过api调用libvirt创建kvm,同时nova-api不停的轮询查询数据库,看kvm的状态,更新状态给消息队列,然后dashboard取得最新数据状态
图里没画出来