潇湘夜雨移动版

主页 > 系统 > 云计算与云原生 >

openstack-havana云平台实验(13)

backups/1475834093.container.builder
backups/1475832947.object.builder
backups/1475834093.container.ring.gz
backups/1475834138.object.ring.gz
[root@localhost ~(keystone_admin)]# swift list
test2
 
修改glance的默认存储为swift
glance.api.cong配置参数如下:
default_store = swift #更改存储类型
bind_host = 0.0.0.0
bind_port = 9292
backlog = 4096
sql_connection=mysql://glance:glance@172.18.109.235/glance
sql_idle_timeout = 3600
workers = 1
enable_v1_api = True
enable_v2_api = True
registry_host = 0.0.0.0
registry_port = 9191
registry_client_protocol = http
rabbit_host = localhost
rabbit_port = 5672
rabbit_use_ssl = false
rabbit_userid = guest
rabbit_password = guest
rabbit_virtual_host = /
rabbit_notification_exchange = glance
rabbit_notification_topic = notifications
rabbit_durable_queues = False
qpid_notification_exchange = glance
qpid_notification_topic = notifications
qpid_hostname = localhost
qpid_port = 5672
qpid_username =
qpid_password =
qpid_sasl_mechanisms =
qpid_reconnect_timeout = 0
qpid_reconnect_limit = 0
qpid_reconnect_interval_min = 0
qpid_reconnect_interval_max = 0
qpid_reconnect_interval = 0
qpid_protocol = tcp
qpid_tcp_nodelay = True
swift_store_auth_version = 2
swift_store_auth_address = http://172.18.109.235:5000/v2.0/ #认证地址和协议,默认是https协议
swift_store_user = service:swift #账户
swift_store_key = swift #swift账户的密码
swift_store_container = glance #将被创建的容器名称
swift_store_create_container_on_put = True #允许上传
swift_store_large_object_size = 5120
swift_store_large_object_chunk_size = 200
swift_enable_snet = False
s3_store_host = 127.0.0.1:8080/v1.0/
s3_store_access_key = <20-char AWS access key>
s3_store_secret_key = <40-char AWS secret key>
s3_store_bucket = <lowercased 20-char aws access key>glance
s3_store_create_bucket_on_put = False
rbd_store_ceph_conf = /etc/ceph/ceph.conf
rbd_store_user = glance
rbd_store_pool = images
rbd_store_chunk_size = 8
sheepdog_store_address = localhost
sheepdog_store_port = 7000
sheepdog_store_chunk_size = 64
delayed_delete = False
scrub_time = 43200
auth_host=172.18.109.235
auth_port=35357
auth_protocol=http
admin_tenant_name=service
admin_user=glance
admin_password=glance
flavor=keystone
 
七、OpenStack Hirizon
 
以下操作在控制节点node1.test.com上进行。
 
7.1 安装配置Horizon服务
 
7.1.1 安装
 
# yum install -y memcached python-memcached mod_wsgi openstack-dashboard
 
7.1.2 为dashboard创建Member角色
 
dashboard依赖于keystone的Member角色,因此,需要为其创建此默认角色。
 
# keystone role-create --name Member
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|    id    | 191ba35b1dfe4982bbdda1b0d781f73a |
|   name   |              Member              |
+----------+----------------------------------+
 
7.1.3 配置openstack-dashboard
 
确保dashboard的配置文件/etc/openstack-dashboard/local_settings中的默认角色定义如下所示。
 
OPENSTACK_HOST = "172.18.109.235"
 
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member"
 
CACHES = {
'default': {
'BACKEND' : 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION' : '127.0.0.1:11211',
}
}
 
 
7.1.4 启动httpd服务,并测试访问
 
# service httpd start
# ckconfig httpd on
 
基于HTTP进行访问测试:
http://172.18.109.235/dashboard
如果访问出现Something went wrong!  An unexpected error has occurred. 
Try refreshing the page. If that doesn't help, contact your local administrator
错误的原因:是dashboard默认不支持ip访问,要用主机名或域名来访问,并且要将该主机名加入到访问控制列表中。
本地测试访问,可以更改客户机的hosts文件,将控制节点的主机名解析添加进去。
vim local_settings
ALLOWED_HOSTS = ['horizon.example.com', 'node1.test.com','localhost']
[root@node1 openstack-dashboard(keystone_admin)]# service httpd restart
停止 httpd:                                               [确定]
 
注意:更改dashboard的配置文件后要重启httpd才能生效。
访问测试
http://node1.test.com/dashboard
访问成功会弹出登录窗口
 
7.2 启用控制台访问
在compute节点安装novncproxy
yum install -y openstack-nova-novncproxy
 
监听所有地址的6080端口:
在nova配置文件设置如下参数:
novncproxy_host=0.0.0.0
novncproxy_port=6080
novncproxy_base_url=http://172.18.109.235:6080/vnc_auto.html #keystone认证地址不变
vncserver_listen=172.18.109.235 #根据节点实际地址设置
vncserver_proxyclient_address=172.18.109.235
vnc_enabled=true
connection=mysql://nova:nova@172.18.109.235/nova
启动novncproxy服务
service openstack-nova-novncproxy start
service openstack-nova-consoleauth start
chkconfig openstack-nova-novncproxy on
chkconfig openstack-nova-consoleauth on
 
配置成功后就可以在dashboard的web界面通过控制节点操作示例。
(责任编辑:liangzh)