openstack学习笔记七 swift安装

openstack学习笔记七 swift安装,第1张

概述项目--对象存储--容器            在容器里你创建的即使是一个文件夹,那么体现在硬盘里,也是一个文件,也就是对象object [root@h1 ~(keystone_admin)]# openstack service list+----------------------------------+------------+--------------+| ID          

项目--对象存储--容器 在容器里你创建的即使是一个文件夹,那么体现在硬盘里,也是一个文件,也就是对象object

[root@h1~(keystone_admin)]#openstackserviceList+----------------------------------+------------+--------------+|ID|name|Type|+----------------------------------+------------+--------------+|30c62c3c0797462a8bd4ff059a71296e|swift|object-store|[root@h1~(keystone_admin)]#keystoneendpoint-List|grep30c62c3c0797462a8bd4ff059a71296e|2408bc6cb5164053b86c0983fd39961a|RegionOne|http://192.168.1.201:8080/v1/AUTH_%(tenant_ID)s|http://192.168.1.201:8080/v1/AUTH_%(tenant_ID)s|http://192.168.1.201:8080|30c62c3c0797462a8bd4ff059a71296e|[root@h1~(keystone_admin)]#swiftListh1[root@h1~(keystone_admin)]#swiftListh1test1/test1/k1.pem[root@h1~(keystone_admin)]#find/srv/node/swiftloopback/-typef-name"*.data"/srv/node/swiftloopback/objects/188901/27f/b87961659e1149b7094bb52b5d60f27f/1467698512.58656.data##删除k1后就没有了/srv/node/swiftloopback/objects/59261/c81/39df7c7803321e4878fdcec1ac469c81/1467698493.15690.data

映射 :ring(环) 映射到硬盘

容器 在容器里面创建对象

对象 文件就是对象

账户 权限

ring文件 保存到硬盘

account.ring.gz 账户

container.ring.gz 容器

object.ring.gz 对象

保存到硬盘里的目录,这个目录为zone /srv/node/swiftloopback/ 挂载点 必须放在/srv/node/目录下

zone1

zone2 两个相同,备份

packstack方式安装完成后,上传一个文件,只在硬盘里保留一份


对象先映射到 虚拟节点/分区partition 2^n 再映射到zone

目的:减少数据的迁移量

swift服务

1 一致性服务 consisteny server

auditor 定期扫描,如果出现问题,就把有问题的文件放隔离区

replicate 从另外的zone复制相同的文件过来,实现数据同步

update 如果replicate失效了,那么等段时间再试

2 代维服务proxy server

接受用户发送过来的请求,比如上传、删除等请求

3 存储服务

容器服务器 container server

对象服务器 object server

账户服务器 acount server



安装软件

[root@h4~]#yumListopenstack-swift*[root@h4~]#yum-yinstallopenstack-swift.noarchopenstack-swift-account.noarchopenstack-swift-container.noarchopenstack-swift-object.noarchopenstack-swift-proxy.noarchmemcache*python-swiftclIEnt

任何服务都要向keystone进行注册

[root@h4~(keystone_admin)]#keystoneuser-create--nameswift--passhequan[root@h4~(keystone_admin)]#keystonetenant-create--nameservices[root@h4~(keystone_admin)]#keystoneuser-role-add--userswift--tenantservices--roleadmin



创建服务,指定endpoint

[root@h4~(keystone_admin)]#keystoneservice-create--nameswift--typeobject-store--description"swift"keystoneendpoint-create--service-ID0995c9a9ed4847da86435bca9a7be8fc--publicurl'http://192.168.1.204:8080/v1/AUTH_%(tenant_ID)s'--internalurl'http://192.168.1.204:8080/v1/AUTH_%(tenant_ID)s'--adminurl'http://192.168.1.204:8080'

配置swift 准备了2个分区


zone1zone2在/srv/node12/dev/sdb1/srv/node/zone1xfsdefaults00##挂载13/dev/sdb2/srv/node/zone2xfsdefaults00


[root@h4~(keystone_admin)]#chown-Rswift.swift/srv/node/


[root@h4swift(keystone_admin)]#catswift.conf[swift-hash]swift_hash_path_suffix=%sWIFT_HASH_PATH_SUFFIX%[root@h1~(keystone_admin)]#find/srv/node/swiftloopback/-typef-name"*.data"/srv/node/swiftloopback/objects/102340/afe/63f12ea37cca17f0227381adcf93eafe/1467982747.16551.datazone对象类型/分区的编号/sufix/文件名字的hash/上传文件的时间戳[root@h1~(keystone_admin)]#date--date=@1467982747.165512016年07月08日星期五20:59:07CST


创建ring文件的准备工作 创建模板,设定有几个备份,有多少分区。

[root@h4swift(keystone_admin)]#swift-ring-builderaccount.buildercreate1221[root@h4swift(keystone_admin)]#swift-ring-builderobject.buildercreate1221[root@h4swift(keystone_admin)]#swift-ring-buildercontainer.buildercreate1221

指定映射位置

[root@h4swift]#vimaccount-server.conf#3个都要改ip6bind_ip=192.168.1.204[root@h4swift(keystone_admin)]#swift-ring-builderaccount.builderaddz1-192.168.1.204:6202/zone1100[root@h4swift(keystone_admin)]#swift-ring-builderaccount.builderaddz2-192.168.1.204:6202/zone2100[root@h4swift(keystone_admin)]#swift-ring-builderobject.builderaddz1-192.168.1.204:6200/zone1100[root@h4swift(keystone_admin)]#swift-ring-builderobject.builderaddz2-192.168.1.204:6200/zone2100[root@h4swift(keystone_admin)]#swift-ring-buildercontainer.builderaddz1-192.168.1.204:6201/zone1100[root@h4swift(keystone_admin)]#swift-ring-buildercontainer.builderaddz2-192.168.1.204:6201/zone2100


创建ring文件

[root@h4swift(keystone_admin)]#swift-ring-builderaccount.builderrebalance[root@h4swift(keystone_admin)]#swift-ring-builderobject.builderrebalance[root@h4swift(keystone_admin)]#swift-ring-buildercontainer.builderrebalance[root@h4swift(keystone_admin)]#ls*.gzaccount.ring.gzcontainer.ring.gzobject.ring.gz


启动服务

[root@h4srv(keystone_admin)]#systemctlstartopenstack-swift-accountopenstack-swift-objectopenstack-swift-container[root@h4srv(keystone_admin)]#systemctlis-activeopenstack-swift-accountopenstack-swift-objectopenstack-swift-containeractiveactiveactive[root@h4srv(keystone_admin)]#systemctlenableopenstack-swift-accountopenstack-swift-objectopenstack-swift-container


代维服务proxy server

[root@h4swift(keystone_admin)]#vimproxy-server.conf53[filter:authtoken]54paste.filter_factory=keystonemIDdleware.auth_token:filter_factory55admin_tenant_name=services56admin_user=swift57admin_password=hequan58#59IDentity_uri=http://192.168.1.204:35357/60auth_port=3535761auth_protocol=http62#auth_uri=http://192.168.1.204:5000/
[root@h4swift(keystone_admin)]#systemctlstartopenstack-swift-proxy.service[root@h4swift(keystone_admin)]#systemctlenableopenstack-swift-proxy.service[root@h4swift(keystone_admin)]#systemctlstartmemcached.service[root@h4swift(keystone_admin)]#systemctlenablememcached.service[root@h4swift(keystone_admin)]#swiftposth1[root@h4swift(keystone_admin)]#swiftListh1[root@h4swift(keystone_admin)]#swiftuploadh1/etc/hosts任意一个分区挂了,还是可以正常查看两个都挂了,就看不到了
总结

以上是内存溢出为你收集整理的openstack学习笔记七 swift安装全部内容,希望文章能够帮你解决openstack学习笔记七 swift安装所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1074330.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存