swift对象存储安装
$ . admin-openrc
|
[root@controller2 ~]# openstack user create --domain default --password-prompt swift
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | e9121a829e7348b2ae74b0be3956344c |
| name | swift |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
|
$ openstack role add --project service --user swift admin
|
$ openstack service create --name swift \
--description "OpenStack Object Storage" object-store
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Object Storage |
| enabled | True |
| id | 75ef509da2c340499d454ae96a2c5c34 |
| name | swift |
| type | object-store |
+-------------+----------------------------------+
|
[root@controller2 ~]# openstack endpoint create --region RegionOne \
> object-store public http://controller2:8080/v1/AUTH_%\(project_id\)s
+--------------+------------------------------------------------+
| Field | Value |
+--------------+------------------------------------------------+
| enabled | True |
| id | 1c18900ffb5043c4b212ecea17184846 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 8706e144a14048c185ced55739459257 |
| service_name | swift |
| service_type | object-store |
| url | http://controller2:8080/v1/AUTH_%(project_id)s |
+--------------+------------------------------------------------+
[root@controller2 ~]# openstack endpoint create --region RegionOne \
> object-store internal http://controller2:8080/v1/AUTH_%\(project_id\)s
+--------------+------------------------------------------------+
| Field | Value |
+--------------+------------------------------------------------+
| enabled | True |
| id | d2c28e09ef8d432c8af9b58f2bf89a94 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 8706e144a14048c185ced55739459257 |
| service_name | swift |
| service_type | object-store |
| url | http://controller2:8080/v1/AUTH_%(project_id)s |
+--------------+------------------------------------------------+
[root@controller2 ~]# openstack endpoint create --region RegionOne \
> object-store admin http://controller2:8080/v1
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 725a4aa3078d4db09581ba5be5c76891 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 8706e144a14048c185ced55739459257 |
| service_name | swift |
| service_type | object-store |
| url | http://controller2:8080/v1 |
+--------------+----------------------------------+
|
# yum install openstack-swift-proxy python-swiftclient \
python-keystoneclient python-keystonemiddleware \
memcached
|
# curl -o /etc/swift/proxy-server.conf https://opendev.org/openstack/swift/raw/branch/master/etc/proxy-server.conf-sample
|
[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:5000
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
|
# yum install xfsprogs rsync
|
# mkfs.xfs /dev/sdb
# mkfs.xfs /dev/sdc
|
# mkdir -p /srv/node/sdb
# mkdir -p /srv/node/sdc
|
/dev/sdb /srv/node/sdb xfs noatime,nodiratime,logbufs=8 0 2
/dev/sdc /srv/node/sdc xfs noatime,nodiratime,logbufs=8 0 2
|
# mount /srv/node/sdb
# mount /srv/node/sdc
|
uid = swift
gid = swift
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
address = MANAGEMENT_INTERFACE_IP_ADDRESS
[account]
max connections = 2
path = /srv/node/
read only = False
lock file = /var/lock/account.lock
[container]
max connections = 2
path = /srv/node/
read only = False
lock file = /var/lock/container.lock
[object]
max connections = 2
path = /srv/node/
read only = False
lock file = /var/lock/object.lock
|
# systemctl enable rsyncd.service
# systemctl start rsyncd.service
|
# yum install openstack-swift-account openstack-swift-container \
openstack-swift-object
|
# curl -o /etc/swift/account-server.conf https://opendev.org/openstack/swift/raw/branch/master/etc/account-server.conf-sample
# curl -o /etc/swift/container-server.conf https://opendev.org/openstack/swift/raw/branch/master/etc/container-server.conf-sample
# curl -o /etc/swift/object-server.conf https://opendev.org/openstack/swift/raw/branch/master/etc/object-server.conf-sample
|
[DEFAULT]
...
bind_ip = MANAGEMENT_INTERFACE_IP_ADDRESS
bind_port = 6202
user = swift
swift_dir = /etc/swift
devices = /srv/node
mount_check = True
|
[pipeline:main]
pipeline = healthcheck recon account-server
|
[filter:recon]
use = egg:swift#recon
...
recon_cache_path = /var/cache/swift
|
[DEFAULT]
...
bind_ip = MANAGEMENT_INTERFACE_IP_ADDRESS
bind_port = 6201
user = swift
swift_dir = /etc/swift
devices = /srv/node
mount_check = True
|
[pipeline:main]
pipeline = healthcheck recon container-server
|
[filter:recon]
use = egg:swift#recon
...
recon_cache_path = /var/cache/swift
|
[DEFAULT]
...
bind_ip = MANAGEMENT_INTERFACE_IP_ADDRESS
bind_port = 6200
user = swift
swift_dir = /etc/swift
devices = /srv/node
mount_check = True
|
[pipeline:main]
pipeline = healthcheck recon object-server
|
[filter:recon]
use = egg:swift#recon
...
recon_cache_path = /var/cache/swift
recon_lock_path = /var/lock
|
# chown -R swift:swift /srv/node
|
# mkdir -p /var/cache/swift
# chown -R root:swift /var/cache/swift
# chmod -R 775 /var/cache/swift
|
# swift-ring-builder account.builder create 10 3 1
|
# swift-ring-builder account.builder \
add --region 1 --zone 1 --ip STORAGE_NODE_MANAGEMENT_INTERFACE_IP_ADDRESS --port 6202 \
--device DEVICE_NAME --weight DEVICE_WEIGHT
|
# swift-ring-builder account.builder add \
--region 1 --zone 1 --ip 10.0.0.51 --port 6202 --device sdb --weight 100
|
# swift-ring-builder account.builder add \
--region 1 --zone 1 --ip 10.0.0.51 --port 6202 --device sdb --weight 100
Device d0r1z1-10.0.0.51:6202R10.0.0.51:6202/sdb_"" with 100.0 weight got id 0
# swift-ring-builder account.builder add \
--region 1 --zone 1 --ip 10.0.0.51 --port 6202 --device sdc --weight 100
Device d1r1z2-10.0.0.51:6202R10.0.0.51:6202/sdc_"" with 100.0 weight got id 1
# swift-ring-builder account.builder add \
--region 1 --zone 2 --ip 10.0.0.52 --port 6202 --device sdb --weight 100
Device d2r1z3-10.0.0.52:6202R10.0.0.52:6202/sdb_"" with 100.0 weight got id 2
# swift-ring-builder account.builder add \
--region 1 --zone 2 --ip 10.0.0.52 --port 6202 --device sdc --weight 100
Device d3r1z4-10.0.0.52:6202R10.0.0.52:6202/sdc_"" with 100.0 weight got id 3
|
# swift-ring-builder account.builder
account.builder, build version 4
1024 partitions, 3.000000 replicas, 1 regions, 2 zones, 4 devices, 100.00 balance, 0.00 dispersion
The minimum number of hours before a partition can be reassigned is 1
The overload factor is 0.00% (0.000000)
Devices: id region zone ip address port replication ip replication port name weight partitions balance meta
0 1 1 10.0.0.51 6202 10.0.0.51 6202 sdb 100.00 0 -100.00
1 1 1 10.0.0.51 6202 10.0.0.51 6202 sdc 100.00 0 -100.00
2 1 2 10.0.0.52 6202 10.0.0.52 6202 sdb 100.00 0 -100.00
3 1 2 10.0.0.52 6202 10.0.0.52 6202 sdc 100.00 0 -100.00
|
# swift-ring-builder account.builder rebalance
Reassigned 1024 (100.00%) partitions. Balance is now 0.00. Dispersion is now 0.00
|
# swift-ring-builder container.builder create 10 3 1
|
# swift-ring-builder container.builder \
add --region 1 --zone 1 --ip STORAGE_NODE_MANAGEMENT_INTERFACE_IP_ADDRESS --port 6201 \
--device DEVICE_NAME --weight DEVICE_WEIGHT
|
# swift-ring-builder container.builder add \
--region 1 --zone 1 --ip 10.0.0.51 --port 6201 --device sdb --weight 100
|
# swift-ring-builder container.builder add \
--region 1 --zone 1 --ip 10.0.0.51 --port 6201 --device sdb --weight 100
Device d0r1z1-10.0.0.51:6201R10.0.0.51:6201/sdb_"" with 100.0 weight got id 0
# swift-ring-builder container.builder add \
--region 1 --zone 1 --ip 10.0.0.51 --port 6201 --device sdc --weight 100
Device d1r1z2-10.0.0.51:6201R10.0.0.51:6201/sdc_"" with 100.0 weight got id 1
# swift-ring-builder container.builder add \
--region 1 --zone 2 --ip 10.0.0.52 --port 6201 --device sdb --weight 100
Device d2r1z3-10.0.0.52:6201R10.0.0.52:6201/sdb_"" with 100.0 weight got id 2
# swift-ring-builder container.builder add \
--region 1 --zone 2 --ip 10.0.0.52 --port 6201 --device sdc --weight 100
Device d3r1z4-10.0.0.52:6201R10.0.0.52:6201/sdc_"" with 100.0 weight got id 3
|
# swift-ring-builder container.builder
container.builder, build version 4
1024 partitions, 3.000000 replicas, 1 regions, 2 zones, 4 devices, 100.00 balance, 0.00 dispersion
The minimum number of hours before a partition can be reassigned is 1
The overload factor is 0.00% (0.000000)
Devices: id region zone ip address port replication ip replication port name weight partitions balance meta
0 1 1 10.0.0.51 6201 10.0.0.51 6201 sdb 100.00 0 -100.00
1 1 1 10.0.0.51 6201 10.0.0.51 6201 sdc 100.00 0 -100.00
2 1 2 10.0.0.52 6201 10.0.0.52 6201 sdb 100.00 0 -100.00
3 1 2 10.0.0.52 6201 10.0.0.52 6201 sdc 100.00 0 -100.00
|
# swift-ring-builder container.builder rebalance
Reassigned 1024 (100.00%) partitions. Balance is now 0.00. Dispersion is now 0.00
|
swift-ring-builder object.builder create 10 3 1
|
# swift-ring-builder object.builder \
add --region 1 --zone 1 --ip STORAGE_NODE_MANAGEMENT_INTERFACE_IP_ADDRESS --port 6200 \
--device DEVICE_NAME --weight DEVICE_WEIGHT
|
# swift-ring-builder object.builder add \
--region 1 --zone 1 --ip 10.0.0.51 --port 6200 --device sdb --weight 100
|
# swift-ring-builder object.builder add \
--region 1 --zone 1 --ip 10.0.0.51 --port 6200 --device sdb --weight 100
Device d0r1z1-10.0.0.51:6200R10.0.0.51:6200/sdb_"" with 100.0 weight got id 0
# swift-ring-builder object.builder add \
--region 1 --zone 1 --ip 10.0.0.51 --port 6200 --device sdc --weight 100
Device d1r1z2-10.0.0.51:6200R10.0.0.51:6200/sdc_"" with 100.0 weight got id 1
# swift-ring-builder object.builder add \
--region 1 --zone 2 --ip 10.0.0.52 --port 6200 --device sdb --weight 100
Device d2r1z3-10.0.0.52:6200R10.0.0.52:6200/sdb_"" with 100.0 weight got id 2
# swift-ring-builder object.builder add \
--region 1 --zone 2 --ip 10.0.0.52 --port 6200 --device sdc --weight 100
Device d3r1z4-10.0.0.52:6200R10.0.0.52:6200/sdc_"" with 100.0 weight got id 3
|
# swift-ring-builder object.builder
object.builder, build version 4
1024 partitions, 3.000000 replicas, 1 regions, 2 zones, 4 devices, 100.00 balance, 0.00 dispersion
The minimum number of hours before a partition can be reassigned is 1
The overload factor is 0.00% (0.000000)
Devices: id region zone ip address port replication ip replication port name weight partitions balance meta
0 1 1 10.0.0.51 6200 10.0.0.51 6200 sdb 100.00 0 -100.00
1 1 1 10.0.0.51 6200 10.0.0.51 6200 sdc 100.00 0 -100.00
2 1 2 10.0.0.52 6200 10.0.0.52 6200 sdb 100.00 0 -100.00
3 1 2 10.0.0.52 6200 10.0.0.52 6200 sdc 100.00
|
# swift-ring-builder object.builder rebalance
Reassigned 1024 (100.00%) partitions. Balance is now 0.00. Dispersion is now 0.00
|
# curl -o /etc/swift/swift.conf \
https://opendev.org/openstack/swift/raw/branch/master/etc/swift.conf-sample
|
[swift-hash]
...
swift_hash_path_suffix = HASH_PATH_SUFFIX
swift_hash_path_prefix = HASH_PATH_PREFIX
|
[storage-policy:0]
...
name = Policy-0
default = yes
|
# chown -R root:swift /etc/swift
|
# systemctl enable openstack-swift-proxy.service memcached.service
# systemctl start openstack-swift-proxy.service memcached.service
|
# systemctl enable openstack-swift-account.service openstack-swift-account-auditor.service \
openstack-swift-account-reaper.service openstack-swift-account-replicator.service
# systemctl start openstack-swift-account.service openstack-swift-account-auditor.service \
openstack-swift-account-reaper.service openstack-swift-account-replicator.service
# systemctl enable openstack-swift-container.service \
openstack-swift-container-auditor.service openstack-swift-container-replicator.service \
openstack-swift-container-updater.service
# systemctl start openstack-swift-container.service \
openstack-swift-container-auditor.service openstack-swift-container-replicator.service \
openstack-swift-container-updater.service
# systemctl enable openstack-swift-object.service openstack-swift-object-auditor.service \
openstack-swift-object-replicator.service openstack-swift-object-updater.service
# systemctl start openstack-swift-object.service openstack-swift-object-auditor.service \
openstack-swift-object-replicator.service openstack-swift-object-updater.service
|
# chcon -R system_u:object_r:swift_data_t:s0 /srv/node
|
$ . demo-openrc
|
$ swift stat
Account: AUTH_ed0b60bf607743088218b0a533d5943f
Containers: 0
Objects: 0
Bytes: 0
Containers in policy "policy-0": 0
Objects in policy "policy-0": 0
Bytes in policy "policy-0": 0
X-Account-Project-Domain-Id: default
X-Timestamp: 1444143887.71539
X-Trans-Id: tx1396aeaf17254e94beb34-0056143bde
Content-Type: text/plain; charset=utf-8
Accept-Ranges: bytes
|
$ openstack container create container1
+---------------------------------------+------------+------------------------------------+
| account | container | x-trans-id |
+---------------------------------------+------------+------------------------------------+
| AUTH_ed0b60bf607743088218b0a533d5943f | container1 | tx8c4034dc306c44dd8cd68-0056f00a4a |
+---------------------------------------+------------+------------------------------------+
|
$ openstack object create container1 FILE
+--------+------------+----------------------------------+
| object | container | etag |
+--------+------------+----------------------------------+
| FILE | container1 | ee1eca47dc88f4879d8a229cc70a07c6 |
+--------+------------+----------------------------------+
|
$ openstack object list container1
+------+
| Name |
+------+
| FILE |
+------+
|
$ openstack object save container1 FILE
|
swift对象存储安装的更多相关文章
- openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 四
openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 一 openstack-r版(rocky)搭建基于centos7.4 的openstac ...
- openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 二
openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 一 openstack-r版(rocky)搭建基于centos7.4 的openstac ...
- openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 一
openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 一 openstack-r版(rocky)搭建基于centos7.4 的openstac ...
- 九、Swift对象存储服务(双节点搭建)
九.Swift对象存储服务(双节点搭建) 要求:Controoler节点需要2块空盘 Compute节点需要再加2块空盘 本次搭建采用Controller 和 Compute双节点节点做swift组件 ...
- openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 三
openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 一 openstack-r版(rocky)搭建基于centos7.4 的openstac ...
- swift对象存储
swift对象存储 简介 OpenStack Object Storage(Swift)是OpenStack开源云计算项目的子项目之一,被称为对象存储,提供了强大的扩展性.冗余和持久性.对象存储,用于 ...
- RGW/SWIFT对象存储性能测试工具--COSBench安装
Cosbench是Intel的开源云存储性能测试软件,COSBench目前已经广泛使用与云存储测试,并作为云存储的基准测试工具使用 https://github.com/intel-cloud/cos ...
- 006.Ceph对象存储基础使用
一 Ceph文件系统 1.1 概述 Ceph 对象网关是一个构建在 librados 之上的对象存储接口,它为应用程序访问Ceph 存储集群提供了一个 RESTful 风格的网关 . Ceph 对象存 ...
- Ceph对象存储 S3
ceph对象存储 作为文件系统的磁盘,操作系统不能直接访问对象存储.相反,它只能通过应用程序级别的API访问.ceph是一种分布式对象存储系统,通过ceph对象网关提供对象存储接口,也称为RADOS网 ...
随机推荐
- PowerPC-object与elf中的符号引用
https://mp.weixin.qq.com/s/6snzjEpDT4uQuCI2Nx9VcQ 一. 符号引用 编译会先把每个源代码文件编译成object目标文件,然后把所有目标文件链接到一起 ...
- jchdl - GSL实例 - ComplementOne(一的补码)
https://mp.weixin.qq.com/s/zZTnDdbCUCRGGpgpfAZsYQ 一的补码指对二进制数的每一位分别求补(二进制运算下0,1互为补数),实际运算即为对每一位取反.最 ...
- jchdl - GSL实例 - Mux4(使用Mux)
https://mp.weixin.qq.com/s/GrYJ4KXEFRoLLmLnAGoMSA 原理图 参考链接 https://github.com/wjcdx/jchdl/blob/ma ...
- Chisel3 - Tutorial - ShiftRegister
https://mp.weixin.qq.com/s/LKiXUgSnt3DzgFLa9zLCmQ 简单的寄存器在时钟的驱动下,逐个往下传值. 参考链接: https://github.com ...
- Multiple annotations found at this line: - Undefined attribute name (charset).
把 meta charset="UTF-8" 改为 meta http-equiv="Content-Type" content="text/html ...
- ASP.NET通过更改Url进行页面传值
这里,通过假数据,手动创建的一个类,然后创建的一个集合,放入下拉框,选好值以后,点确定 会在另一个页面产生对应的id,有不懂的欢迎评论 创建一个类: using System; using Syste ...
- (Java实现) 工作分配问题
工作分配问题 时间限制: 1 Sec 内存限制: 128 MB [提交][状态][讨论版] 题目描述 设有n件工作分配给n个人.为第i个人分配工作j所需的费用为c[i][j] .试设计一个算法,计算最 ...
- (Java实现) 删数问题
删数问题(需知道的数学定理) 给定n位正整数a,去掉其中任意k≤n 个数字后,剩下的数字按原次序排列组成一个新 的正整数.对于给定的n位正整数a和正整数 k,设计一个算法找出剩下数字组成的新数最 小的 ...
- Java中多态举例说明
这里我也就大概说一下他们的关系, 接口就是动物,然而每一个类就是一种动物 给猫有两个功能:叫和睡觉 狗:叫 在f方法里面可以把猫的功能实现 但不能实现狗的功能 在主方法里面有一个猫有一个狗 分别调用 ...
- java中Condition类的详细介绍(详解)
已找不到原文了,还望原文博主看到能告诉小白一下,一定标注原文地址 一 condition 介绍及demo Condition是在java 1.5中才出现的,它用来替代传统的Object的wait(). ...