openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 一
openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 二
openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 三
openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 四
基础环境
本次使用环境使用vmware 搭建 单节点openstack r版本 ,一台controller,一台compute,一台cinder,一台swift节点。
swift对象存储部署在3台机器中,分别为compute,cinder,swift,每台增加2块100G硬盘
简介
swift主要有四个组件:swift-proxy-server、swift-account-server、swift-container-server、swift-object-server
swift-proxy-server(代理服务):对外提供对象服务 API
swift-account-server(账户服务):提供账户元数据和统计信息,并维护所含容器列表的服务,管理由对象存储定义的账户
swift-container-server(容器服务):提供容器元数据和统计信息,并维护所含对象列表的服务
swift-object-server(对象服务):提供对象元数据和内容服务,每个对象的内容会以文件的形式存储在文件系统中,元数据会作为文件属性来存储,建议采用支持扩展属性的 XFS 文件系统
以下操作均在控制节点controller执行
前提已经安装完openstack所有核心服务
执行 . adminrc
###创建swift用户服务端点等。
openstack user create --domain default --password-prompt swift
openstack role add --project service --user swift admin
openstack service create --name swift \
--description "OpenStack Object Storage" object-store
openstack endpoint create --region RegionOne \
object-store public http://controller:8080/v1/AUTH_%\(project_id\)s
openstack endpoint create --region RegionOne \
object-store internal http://controller:8080/v1/AUTH_%\(project_id\)s
openstack endpoint create --region RegionOne \
object-store admin http://controller:8080/v1 ##安装服务
yum install openstack-swift-proxy python-swiftclient \
python-keystoneclient python-keystonemiddleware \
memcached -y ##从对象存储源存储库获取代理服务配置文件
curl -o /etc/swift/proxy-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/proxy-server.conf-sample?h=stable/rocky
##编辑 /etc/swift/proxy-server.conf 文件 标红位置配置修改swift用户密码
[DEFAULT] bind_port = 8080
user = swift
swift_dir = /etc/swift
[pipeline:main]
pipeline = catch_errors gatekeeper healthcheck proxy-logging cache container_sync bulk ratelimit authtoken keystoneauth container-quotas account-quotas slo dlo versioned_writes proxy-logging proxy-server
[app:proxy-server]
use = egg:swift#proxy
account_autocreate = True
[filter:keystoneauth]
use = egg:swift#keystoneauth
operator_roles = admin,user
[filter:authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
www_authenticate_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_id = default
user_domain_id = default
project_name = service
username = swift
password = SWIFT_PASS
delay_auth_decision = True
[filter:cache]
use = egg:swift#memcache
memcache_servers = controller:11211
##保存退出