openstack之对象存储服务SWIFT.docx
- 文档编号:29347104
- 上传时间:2023-07-22
- 格式:DOCX
- 页数:14
- 大小:103.89KB
openstack之对象存储服务SWIFT.docx
《openstack之对象存储服务SWIFT.docx》由会员分享,可在线阅读,更多相关《openstack之对象存储服务SWIFT.docx(14页珍藏版)》请在冰豆网上搜索。
openstack之对象存储服务SWIFT
一、在CONTROLLER机器上安装的配置
1、准备工作
[root@controller~]# .admin-openrc
2、创建认证服务凭证
[root@controller~]# openstackusercreate--domaindefault--password-promptswift(密码:
swift)
[root@controller~]#openstackroleadd--projectservice--userswiftadmin
[root@controller~]#openstackservicecreate--nameswift--description"OpenStackObjectStorage"object-store
3、创建对象存储服务的API
[root@controller~]#openstackendpointcreate--regionRegionOneobject-storepublic http:
//controller:
8080/v1/AUTH_%\(tenant_id\)s
[root@controller~]#openstackendpointcreate--regionRegionOneobject-storeinternal http:
//controller:
8080/v1/AUTH_%\(tenant_id\)s
root@controller~]#openstackendpointcreate--regionRegionOneobject-storeadmin http:
//controller:
8080/v1
4、安装配置组件
安装软件包
[root@controller~]#yuminstallopenstack-swift-proxypython-swiftclientpython-keystoneclientpython-keystonemiddlewarememcached
从对象存储库获取代理服务配置文件
[root@controller~]#curl-o/etc/swift/proxy-server.confhttps:
//git.openstack.org/cgit/openstack/swift/plain/etc/proxy-server.conf-sample?
h=stable/mitaka
编辑/etc/swift/proxy-server.conf
[DEFAULT]
...
bind_port=8080
user=swift
swift_dir=/etc/swift
[pipeline:
main]
pipeline=catch_errorsgatekeeperhealthcheckproxy-loggingcachecontainer_syncbulkratelimitauthtokenkeystoneauthcontainer-quotasaccount-quotasslodloversioned_writesproxy-loggingproxy-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
...
auth_uri=http:
//controller:
5000
auth_url=http:
//controller:
35357
memcached_servers=controller:
11211
auth_type=password
project_domain_name=default
user_domain_name=default
project_name=service
username=swift
password=swift
delay_auth_decision=True
[filter:
cache]
use=egg:
swift#memcache
...
memcache_servers=controller:
11211
二、在存储节点上安装与配置(实验选择在COMPUTER机器上执行,增加两个磁盘)
1、准备
[root@computer~]#yuminstallxfsprogsrsync
[root@computer~]#mkfs.xfs/dev/sdc
[root@computer~]#mkfs.xfs/dev/sdd
[root@computer~]#mkdir-p/srv/node/sdc
[root@computer~]#mkdir-p/srv/node/sdd
编辑/etc/fstab文件
/dev/sdd/srv/node/sddxfsnoatime,nodiratime,nobarrier,logbufs=802
/dev/sdc/srv/node/sdcxfsnoatime,nodiratime,nobarrier,logbufs=802
[root@computer~]#mount/srv/node/sdc
[root@computer~]#mount/srv/node/sdd
创建或编辑/etc/rsyncd.conf文件
uid=swift
gid=swift
logfile=/var/log/rsyncd.log
pidfile=/var/run/rsyncd.pid
address=10.1.42.212
[account]
maxconnections=2
path=/srv/node/
readonly=False
lockfile=/var/lock/account.lock
[container]
maxconnections=2
path=/srv/node/
readonly=False
lockfile=/var/lock/container.lock
[object]
maxconnections=2
path=/srv/node/
readonly=False
lockfile=/var/lock/object.loc
[root@computer~]#systemctlenablersyncd.service
[root@computer~]#systemctlstartrsyncd.service
2、安装配置组件
安装组件包
[root@computer~]#yuminstallopenstack-swift-accountopenstack-swift-containeropenstack-swift-object
获取accounting,container,andobjectservice的配置文件
[root@computer~]#curl-o/etc/swift/account-server.confhttps:
//git.openstack.org/cgit/openstack/swift/plain/etc/account-server.conf-sample?
h=stable/mitaka
[root@computer~]#curl-o/etc/swift/container-server.confhttps:
//git.openstack.org/cgit/openstack/swift/plain/etc/container-server.conf-sample?
h=stable/mitaka
[root@computer~]#curl-o/etc/swift/object-server.confhttps:
//git.openstack.org/cgit/openstack/swift/plain/etc/object-server.conf-sample?
h=stable/mitaka
编辑/etc/swift/account-server.conf
[DEFAULT]
...
bind_ip=10.1.42.212
bind_port=6002
user=swift
swift_dir=/etc/swift
devices=/srv/node
mount_check=True
[pipeline:
main]
pipeline=healthcheckreconaccount-server
[filter:
recon]
use=egg:
swift#recon
...
recon_cache_path=/var/cache/swift
编辑/etc/swift/container-server.conf
[DEFAULT]
...
bind_ip=10.1.42.212
bind_port=6001
user=swift
swift_dir=/etc/swift
devices=/srv/node
mount_check=True
[pipeline:
main]
pipeline=healthcheckreconcontainer-server
[filter:
recon]
use=egg:
swift#recon
...
recon_cache_path=/var/cache/swift
编辑/etc/swift/object-server.conf
[DEFAULT]
...
bind_ip=10.1.42.212
bind_port=6000
user=swift
swift_dir=/etc/swift
devices=/srv/node
mount_check=True
[pipeline:
main]
pipeline=healthcheckreconobject-server
[filter:
recon]
use=egg:
swift#recon
...
recon_cache_path=/var/cache/swift
recon_lock_path=/var/lock
[root@computer~]#chown-Rswift:
swift/srv/node
[root@computer~]#mkdir-p/var/cache/swift
[root@computer~]#chown-Rroot:
swift/var/cache/swift
[root@computer~]#chmod-R775/var/cache/swift
三、在另一存储节点上安装与配置(实验选择在CONTROLLER机器上执行,增加两个磁盘)
重复执行第二步骤。
四、创建及分发初始环(在CONTROLLER机器上执行)
1、创建帐户环
[root@controller~]#cd/etc/swift
创建account.builder文件
[root@controllerswift]#swift-ring-builderaccount.buildercreate1031
添加每个存储节点到环
[root@controllerswift]#swift-ring-builderaccount.builderadd--region1--zone1--ip10.1.42.211--port6002--devicesdb--weight100
Deviced0r1z1-10.1.42.211:
6002R10.1.42.211:
6002/sdb_""with100.0weightgotid0
[root@controllerswift]#swift-ring-builderaccount.builderadd--region1--zone1--ip10.1.42.211--port6002--devicesdc--weight100
Deviced1r1z1-10.1.42.211:
6002R10.1.42.211:
6002/sdc_""with100.0weightgotid1
[root@controllerswift]#swift-ring-builderaccount.builderadd--region1--zone1--ip10.1.42.212--port6002--devicesdc--weight100
Deviced2r1z1-10.1.42.212:
6002R10.1.42.212:
6002/sdc_""with100.0weightgotid2
[root@controllerswift]#swift-ring-builderaccount.builderadd--region1--zone1--ip10.1.42.212--port6002--devicesdd--weight100
Deviced3r1z1-10.1.42.212:
6002R10.1.42.212:
6002/sdd_""with100.0weightgotid3
较验环的内容
[root@controllerswift]#swift-ring-builderaccount.builder
重新平衡
[root@controllerswift]#swift-ring-builderaccount.builderrebalance
Reassigned3072(300.00%)partitions.Balanceisnow0.00. Dispersionisnow0.00
2、创建容器环
[root@controllerswift]#cd/etc/swift
创建container.builder文件
[root@controllerswift]#swift-ring-buildercontainer.buildercreate1031
添加每个存储节点到环
[root@controllerswift]#swift-ring-buildercontainer.builderadd --region1--zone1--ip10.1.42.211--port6001--devicesdb--weight100
Deviced0r1z1-10.1.42.211:
6001R10.1.42.211:
6001/sdb_""with100.0weightgotid0
[root@controllerswift]#swift-ring-buildercontainer.builderadd --region1--zone1--ip10.1.42.211--port6001--devicesdc--weight100
Deviced1r1z1-10.1.42.211:
6001R10.1.42.211:
6001/sdc_""with100.0weightgotid1
[root@controllerswift]#swift-ring-buildercontainer.builderadd --region1--zone1--ip10.1.42.212--port6001--devicesdc--weight100
Deviced2r1z1-10.1.42.212:
6001R10.1.42.212:
6001/sdc_""with100.0weightgotid2
[root@controllerswift]#swift-ring-buildercontainer.builderadd --region1--zone1--ip10.1.42.212--port6001--devicesdd--weight100
Deviced3r1z1-10.1.42.212:
6001R10.1.42.212:
6001/sdd_""with100.0weightgotid3
较验环的内容
[root@controllerswift]#swift-ring-buildercontainer.builder
重新平衡(执行后就自动创建上图红圈的文件)
[root@controllerswift]#swift-ring-buildercontainer.builderrebalance
Reassigned3072(300.00%)partitions.Balanceisnow0.00. Dispersionisnow0.00
3、创建对象环
[root@controllerswift]#cd/etc/swift
创建object.builder 文件
[root@controllerswift]# swift-ring-builderobject.buildercreate1031
添加每个存储节点到环
[root@controllerswift]#swift-ring-builderobject.builderadd--region1--zone1--ip10.1.42.211--port6000--devicesdb--weight100
Deviced0r1z1-10.1.42.211:
6000R10.1.42.211:
6000/sdb_""with100.0weightgotid0
[root@controllerswift]#swift-ring-builderobject.builderadd--region1--zone1--ip10.1.42.211--port6000--devicesdc--weight100
Deviced1r1z1-10.1.42.211:
6000R10.1.42.211:
6000/sdc_""with100.0weightgotid1
[root@controllerswift]#swift-ring-builderobject.builderadd--region1--zone1--ip10.1.42.212--port6000--devicesdc--weight100
Deviced2r1z1-10.1.42.212:
6000R10.1.42.212:
6000/sdc_""with100.0weightgotid2
[root@controllerswift]#swift-ring-builderobject.builderadd--region1--zone1--ip10.1.42.212--port6000--devicesdd--weight100
Deviced3r1z1-10.1.42.212:
6000R10.1.42.212:
6000/sdd_""with100.0weightgotid3
较验环的内容
[root@controllerswift]#swift-ring-builderobject.builder
重新平衡
[root@controllerswift]#swift-ring-builderobject.builderrebalance
Reassigned3072(300.00%)partitions.Balanceisnow0.00. Dispersionisnow0.00
4、分发环配置文件
复制account.ring.gz,container.ring.gz,andobject.ring.gz三个文件到每个存储节点和代理服务节点的目录/etc/swift
[root@controllerswift]#scp*.*.gzroot@10.1.42.212:
/etc/swift
五、最后安装
从对象存储源获取SWIFT.CONF
[root@controllerswift]#curl-o/etc/swift/swift.conf https:
//git.openstack.org/cgit/openstack/swift/plain/etc/swift.conf-sample?
h=stable/mitaka
编辑/etc/swift/swift.conf
[swift-hash]
...
swift_hash_path_suffix=HASH_PATH_SUFFIX
swift_hash_path_prefix=HASH_PATH_PREFIX
[storage-policy:
0]
...
name=Policy-0
default=yes
复制 swift.conf文件到每个存储节点和代理服务节点的目录/etc/swift
[root@controllerswift]#scpswift.confroot@10.1.42.212:
/etc/swift
在所有节点上执行
[root@controllerswift]#chown-Rroot:
swift/etc/swift
[root@computerswift]#chown-Rroot:
swift/etc/swift
在控制节点和其它节点上运行代理服务
[root@controllerswift]#systemctlenableopenstack-swift-proxy.servicememcached.service
[root@controllerswift]#systemctlstartopenstack-swift-proxy.servicememcached.service
在存储节点上运行ObjectStorageservices
[root@computerswift]#systemctlenableopenstack-swift-account.serviceopenstack-swif
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- openstack 对象 存储 服务 SWIFT