CentOS7.0+OpenStack+kvm云平台部署—配置Horizon

2019-06-11 17:52:02 浏览数 (1)

(1).安装Horizon

[root@openstack~]# yum -y install openstack-dashboard

(2).修改local_settings文件,将DEBUG= False修改为DEBUG =True

[root@openstack ~]# vi/etc/openstack-dashboard/local_settings

DEBUG = True

……

(3).修改httpd.conf文件,将#ServerNamewww.example.com:80修改为ServerName192.168.1.2:80

[root@openstack ~]# vi/etc/httpd/conf/httpd.conf

#ServerNamewww.example.com:80

ServerName192.168.1.2:80

(4).修改local_settings.py文件,将"Member"修改为"admin"

[root@openstack keystone]#vi /usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py #OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member" OPENSTACK_KEYSTONE_DEFAULT_ROLE = "admin"

(5).启动http服务,设置开机自启动

[root@openstack ~]# servicehttpd start

[root@openstack ~]# chkconfighttpd on

(6).重启nova-api服务

[root@openstack ~]# serviceopenstack-nova-api restart

(7).添加防火墙策略

[root@openstack ~]# iptables-I INPUT -p tcp --dport 80 -j ACCEPT

[root@openstack ~]# iptables-I INPUT -p tcp -m multiport --dports 5900:6000 -j ACCEPT

[root@openstack ~]# iptables-I INPUT -p tcp --dport 6080 -j ACCEPT

[root@openstack ~]# serviceiptables save

Horizon安装完成,使用http://10.1.1.2/dashboard访问openstackweb界面。

用户名:admin

密码:password

添加新项目

(1).为操作员用户创建一个tenant:

[root@openstack~]# keystone tenant-create --name=manager --description='Manager Tenant'

(2).创建操作员用户:

[root@openstack~]# keystone user-create --name=manager --pass=password--email=manager@zcs.com

(3).创建一个管理角色manager:

[root@openstack~]# keystone role-create --name=manager

(4).将manager角色添加到用户:

[root@openstack~]# keystone user-role-add --user=manager --tenant=manager --role=manager

(5).将nova角色添加到用户:

[root@openstack~]# keystone user-role-add --user=nova --tenant=service--role=manager

0 人点赞