(七)Open Stack(M)---- Swift安装和配置(下)

简介: (七)Open Stack(M)---- Swift安装和配置(下)

四.计算节点的配置

1.编辑 /etc/swift/account-server.conf 文件

删除原有内容,再进行添加

vi /etc/swift/account-server.conf

修改后内容如下:

[DEFAULT]
bind_port = 6002
user = swift
swift_dir = /etc/swift
devices = /swift/node
mount_check = false
[pipeline:main]
pipeline = healthcheck recon account-server
[app:account-server]
use = egg:swift#account
[filter:healthcheck]
use = egg:swift#healthcheck
[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift
[account-replicator]
[account-auditor]
[account-reaper]
[filter:xprofile]
use = egg:swift#xprofile

截图如下:

2.编辑/etc/swift/container-server.conf文件

删除原有内容,再进行添加

vi /etc/swift/container-server.conf

修改后内容如下:

[DEFAULT]
bind_port = 6001
user = swift
swift_dir = /etc/swift
devices = /swift/node
mount_check = false
[pipeline:main]
pipeline = healthcheck recon container-server
[app:container-server]
use = egg:swift#container
[filter:healthcheck]
use = egg:swift#healthcheck
[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift
[container-replicator]
[container-updater]
[container-auditor]
[container-sync]
[filter:xprofile]
use = egg:swift#xprofile

截图如下:

3.编辑/etc/swift/object-server.conf文件

删除原有内容,再进行添加

vi /etc/swift/object-server.conf

修改后内容如下:

[DEFAULT]
bind_port = 6000
user = swift
swift_dir = /etc/swift
devices = /swift/node
mount_check = false
[pipeline:main]
pipeline = healthcheck recon object-server
[app:object-server]
use = egg:swift#object
[filter:healthcheck]
use = egg:swift#healthcheck
[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift
recon_lock_path = /var/lock
[object-replicator]
[object-reconstructor]
[object-updater]
[object-auditor]
[filter:xprofile]
use = egg:swift#xprofile

截图如下:

4.编辑/etc/swift/swift.conf文件

vi /etc/swift/swift.conf

删除原有内容,再进行添加

[swift-hash]
swift_hash_path_suffix = changeme
swift_hash_path_prefix = changeme
[storage-policy:0]
name = Policy-0
default = yes
aliases = yellow, orange
[swift-constraints]

截图如下:

5.确认挂载点目录结构是否有合适的权限

chown -R swift:swift /swift/node

6.创建recon目录并配置合适的权限:

mkdir -p /var/cache/swift
chown -R root:swift /var/cache/swift
chmod -R 775 /var/cache/swift
chown -R root:swift /etc/swift

截图如下:

五.计算节点创建,分发并初始化rings

1.创建账户ring

1.切换到 /etc/swift目录。创建基本 account.builder 文件

cd /etc/swift
swift-ring-builder account.builder create 18 1 1

2.添加每个节点到 ring

swift-ring-builder account.builder add --region 1 --zone 1 --ip 192.168.100.20 --port 6002 --device sdc1 --weight 100

3.验证ring内容

swift-ring-builder account.builder

4.平衡ring

swift-ring-builder account.builder rebalance

2.创建ring容器

1.切换到 /etc/swift目录。创建基本container.builder文件

cd /etc/swift
swift-ring-builder container.builder create 10 1 1

2.添加每个节点到 ring

swift-ring-builder container.builder add --region 1 --zone 1 --ip 192.168.100.20 --port 6001 --device sdc1 --weight 100

3.验证 ring 的内容:

swift-ring-builder container.builder

4.平衡 ring

swift-ring-builder container.builder rebalance

截图如下:

3.创建ring对象

1.切换到 /etc/swift目录,创建基本object.builder文件

swift-ring-builder object.builder create 10 1 1

2.添加每个节点到 ring

swift-ring-builder object.builder add --region 1 --zone 1 --ip 192.168.100.20 --port 6000 --device sdc1 --weight 100

3.验证 ring 的内容

swift-ring-builder object.builder

4.平衡 ring

swift-ring-builder object.builder rebalance

截图如下:

4.计算节点复制控制节点的配置文件

account.ring.gzcontainer.ring.gzobject.ring.gz 文件复制到每个存储节点和其他运行了代理服务的额外节点的 /etc/swift 目录。

scp controller:/etc/swift/*.ring.gz /etc/swift/

在compute上获取controller的一些配置文件,当然为了更快捷,大家可以在节点间配置免密登陆等一些手段

截图如下:

六.启动服务

1.在控制节点Controller上,启动对象存储代理服务及其依赖服务,并将它们配置为开机自启

systemctl start openstack-swift-proxy.service memcached.service
 systemctl enable openstack-swift-proxy.service memcached.service

截图如下:

2.在存储节点Compute上,启动对象存储服务,并将其设置为开机自启

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-account.service openstack-swift-account-auditor.service openstack-swift-account-reaper.service openstack-swift-account-replicator.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-container.service openstack-swift-container-auditor.service openstack-swift-container-replicator.service openstack-swift-container-updater.service
systemctl start openstack-swift-object.service openstack-swift-object-auditor.service openstack-swift-object-replicator.service openstack-swift-object-updater.service
systemctl enable openstack-swift-object.service openstack-swift-object-auditor.service openstack-swift-object-replicator.service openstack-swift-object-updater.service

截图如下:

七:Controller执行验证操作

1.导入demo凭证

. /root/demo-openrc

2. 显示服务状态:

swift stat 

截图如下:

3.创建容器 container1

openstack container create container1

截图如下:

4.上传一个测试文件到container1容器

openstack object create container1 /root/demo-openrc

截图如下:

5.列出container1容器里的所有文件

openstack object list container1

截图如下:

6.从container1容器里下载一个测试文件

openstack object save container1 /root/demo-openrc

截图如下:

(八)Open Stack(M)—Cinder安装和配置

大家记得,不要忘记打快照哦!
感谢大家,点赞,收藏,关注,评论!

目录
相关文章
|
3月前
|
存储 Swift 对象存储
OpenStack的对象存储(Swift)
【8月更文挑战第24天】
141 1
|
3月前
|
存储 网络性能优化 块存储
OpenStack的块存储卷管理创建与配置
【8月更文挑战第27天】
79 3
|
6月前
|
安全 编译器 Swift
【Swift开发专栏】Swift的编译优化与构建配置
【4月更文挑战第30天】Swift编译优化与构建配置对开发效率和应用性能至关重要。编译优化包括不同级别的优化、函数内联、泛型特化、尾递归优化、死代码消除和链接时优化。在Xcode的"Build Settings"中可调整相关标志。构建配置涉及Debug与Release模式、自定义配置、条件编译、构建设置和脚本。开发时,应适时测试、选择适当优化级别、避免过度优化,并利用条件编译区分不同版本的代码。有效管理构建设置可提升开发质量和性能。
86 0
|
6月前
|
存储 运维 Swift
openstack cinder、swift运维命令
Cinder是OpenStack的块存储服务,提供虚拟机块设备功能,包括卷的创建、挂载等。它由cinder-api、cinder-scheduler和cinder-volume三个组件构成,前者处理请求,中间者负责调度,后者执行卷管理。Swift是OpenStack的分布式对象存储服务,高可用、持久性,适用于大文件存储。Swift架构对称,无单点故障,提供类似文件系统的简单逻辑和高效读写。Cinder关注虚拟机层面的块存储,而Swift则提供对象存储服务。命令示例展示了如何使用cinder和openstack命令操作云硬盘和Swift容器。
135 0
|
6月前
|
Ubuntu Linux Swift
安装Swift编程语言的工具
安装Swift编程语言的工具
134 4
|
API 数据库
(九)Open Stack(M)--- Heat安装和配置
(九)Open Stack(M)--- Heat安装和配置
142 0
|
存储 API 数据库
(八)Open Stack(M)---Cinder安装和配置
(八)Open Stack(M)---Cinder安装和配置
116 0
|
存储 API Swift
(七)Open Stack(M)---- Swift安装和配置(上)
(七)Open Stack(M)---- Swift安装和配置(上)
84 0
|
网络协议 Linux 网络安全
openstack 云平台一体化部署(超详细)
openstack 云平台一体化部署(超详细)
1248 0
openstack 云平台一体化部署(超详细)
|
3月前
|
消息中间件 缓存 Shell
跟我一起来学OpenStack部署
跟我一起来学OpenStack部署
259 0