热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

16.部署swift服务|swift配置存储和ring

每个服务都需要做的如下:

配置服务的时候,步骤如下:

  1. 创建服务同名的用户(除了keystone),添加到services这个project和admin这个role
  2. 创建services和endpoint
  3. 修改配置文件:需要指定keystone和rabbitmq的地址
  4. 更新数据库(除了swift)

 

swift是用不到上面的数据库的。

 

安装swift软件包

16.部署swift服务|swift配置存储和ring

 

 

Memcached 是一个高性能的分布式内存对象缓存系统,用于动态Web应用以减轻数据库负载。它通过在内存中缓存数据和对象来减少读取数据库的次数,从而提高动态、数据库驱动网站的速度。

16.部署swift服务|swift配置存储和ring

 

16.部署swift服务|swift配置存储和ring

 

 

创建服务同名用户:

# openstack user create swift --password redhat

16.部署swift服务|swift配置存储和ring

添加swift用户admin权限:

# openstack role add --user swift --project services admin

16.部署swift服务|swift配置存储和ring

 

创建服务:

# openstack service create --name swift object-store

16.部署swift服务|swift配置存储和ring

 

创建endpoint:

openstack endpoint create --region RegionOne --publicurl 'http://192.168.179.140:8080/v1/AUTH_%(tenant_id)s' --internalurl 'http://192.168.179.140:8080/v1/AUTH_%(tenant_id)s' --adminurl 'http://192.168.179.140:8080'  32103224f7054cb1a75e57f80c7037d5

16.部署swift服务|swift配置存储和ring

 

修改配置文件:

/etc/swift/

 

配置的服务:

服务介绍:

代理服务器 proxy server

负责swift各个组件之间的通信

接收用户的请求

存储服务器:

容器服务

对象服务

账户服务

一致性服务:

auditor  定期检查zone1和zone2 之间数据有没有问题,是否损坏

replicate 复制,修复数据

update    如果修复没有成功,就会等一段时间再次修复,这个功能是由update来完成的

 

修改配置文件:

16.部署swift服务|swift配置存储和ring

 

16.部署swift服务|swift配置存储和ring

 

16.部署swift服务|swift配置存储和ring

 

16.部署swift服务|swift配置存储和ring

 

16.部署swift服务|swift配置存储和ring

 

 

16.部署swift服务|swift配置存储和ring

 

16.部署swift服务|swift配置存储和ring

随机生成一个值

16.部署swift服务|swift配置存储和ring

 

准备底层磁盘:

[[email protected] ~]# lsblk

NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT

sda      8:0    0  100G  0 disk

©À©¤sda1   8:1    0   60G  0 part /

©¸©¤sda2   8:2    0    4G  0 part [SWAP]

sr0     11:0    1  3.8G  0 rom  /iso

[[email protected] ~]# fdisk /dev/sda

Welcome to fdisk (util-linux 2.23.2).

 

Changes will remain in memory only, until you decide to write them.

Be careful before using the write command.

 

 

Command (m for help): p

 

Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x00062bf0

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *        2048   125831167    62914560   83  Linux

/dev/sda2       125831168   134219775     4194304   82  Linux swap / Solaris

 

Command (m for help): n

Partition type:

   p   primary (2 primary, 0 extended, 2 free)

   e   extended

Select (default p): p

Partition number (3,4, default 3):

First sector (134219776-209715199, default 134219776):

Using default value 134219776

Last sector, +sectors or +size{K,M,G} (134219776-209715199, default 209715199): +15G

Partition 3 of type Linux and of size 15 GiB is set

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

 

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table. The new table will be used at

the next reboot or after you run partprobe(8) or kpartx(8)

Syncing disks.

[[email protected] ~]# partprobe

Warning: Unable to open /dev/sr0 read-write (Read-only file system).  /dev/sr0 has been opened read-only.

Warning: Unable to open /dev/sr0 read-write (Read-only file system).  /dev/sr0 has been opened read-only.

Warning: Unable to open /dev/sr0 read-write (Read-only file system).  /dev/sr0 has been opened read-only.

[[email protected] ~]#

 

 

创建逻辑卷:

[[email protected] ~]# pvs

[[email protected] ~]# pvcreate /dev/sda3

  Physical volume "/dev/sda3" successfully created

[[email protected] ~]# vgcreate vg0 /dev/sda3

  Volume group "vg0" successfully created

[[email protected] ~]# pvs

  PV         VG   Fmt  Attr PSize  PFree

  /dev/sda3  vg0  lvm2 a--  15.00g 15.00g

[[email protected] ~]# vgs

  VG   #PV #LV #SN Attr   VSize  VFree

  vg0    1   0   0 wz--n- 15.00g 15.00g

[[email protected] ~]# lvs

[[email protected] ~]# lvcreate -L 2G -n lv1 vg0

  Logical volume "lv1" created.

[[email protected] ~]# lvcreate -L 2G -n lv2 vg0

  Logical volume "lv2" created.

[[email protected] ~]# lvcreate -L 2G -n lv3 vg0

  Logical volume "lv3" created.

[[email protected] ~]# mkfs.xfs /dev/vg0/lv1

meta-data=/dev/vg0/lv1           isize=256    agcount=4, agsize=131072 blks

         =                       sectsz=512   attr=2, projid32bit=1

         =                       crc=0        finobt=0

data     =                       bsize=4096   blocks=524288, imaxpct=25

         =                       sunit=0      swidth=0 blks

naming   =version 2              bsize=4096   ascii-ci=0 ftype=0

log      =internal log           bsize=4096   blocks=2560, version=2

         =                       sectsz=512   sunit=0 blks, lazy-count=1

realtime =none                   extsz=4096   blocks=0, rtextents=0

[[email protected] ~]# mkfs.xfs /dev/vg0/lv2

meta-data=/dev/vg0/lv2           isize=256    agcount=4, agsize=131072 blks

         =                       sectsz=512   attr=2, projid32bit=1

         =                       crc=0        finobt=0

data     =                       bsize=4096   blocks=524288, imaxpct=25

         =                       sunit=0      swidth=0 blks

naming   =version 2              bsize=4096   ascii-ci=0 ftype=0

log      =internal log           bsize=4096   blocks=2560, version=2

         =                       sectsz=512   sunit=0 blks, lazy-count=1

realtime =none                   extsz=4096   blocks=0, rtextents=0

[[email protected] ~]# mkfs.xfs /dev/vg0/lv3

meta-data=/dev/vg0/lv3           isize=256    agcount=4, agsize=131072 blks

         =                       sectsz=512   attr=2, projid32bit=1

         =                       crc=0        finobt=0

data     =                       bsize=4096   blocks=524288, imaxpct=25

         =                       sunit=0      swidth=0 blks

naming   =version 2              bsize=4096   ascii-ci=0 ftype=0

log      =internal log           bsize=4096   blocks=2560, version=2

         =                       sectsz=512   sunit=0 blks, lazy-count=1

realtime =none                   extsz=4096   blocks=0, rtextents=0

 

挂载点必须在下面的目录中:/srv/node

 

16.部署swift服务|swift配置存储和ring

 

16.部署swift服务|swift配置存储和ring

 

16.部署swift服务|swift配置存储和ring

 

修改存储的所属权限为swift:

16.部署swift服务|swift配置存储和ring

 

创建ring:

/etc/swift下创建后缀为.builder的ring文件

# swift-ring-builder account.builder create 12 2 1

# swift-ring-builder container.builder create 12 2 1

# swift-ring-builder object.builder create 12 2 1

12:  2的12次幂

2表示副本数

1表示间隔,当ring创建好了以后,如果想要rebalance  1个小时候才能做

16.部署swift服务|swift配置存储和ring

 

16.部署swift服务|swift配置存储和ring

 

下面开始配置指定每个ring到底如何使用zone:

# swift-ring-builder object.builder add z1-192.168.179.140:6200/z1 100      #/srv/node/z1

# swift-ring-builder object.builder add z1-192.168.179.140:6200/z1 100

# swift-ring-builder object.builder add z2-192.168.179.140:6200/z2 100

16.部署swift服务|swift配置存储和ring

# swift-ring-builder account.builder add z1-192.168.179.140:6202/z1 100

# swift-ring-builder account.builder add z2-192.168.179.140:6202/z2 100

16.部署swift服务|swift配置存储和ring

# swift-ring-builder container.builder add z1-192.168.179.140:6201/z1 100

# swift-ring-builder container.builder add z2-192.168.179.140:6201/z2 100

16.部署swift服务|swift配置存储和ring

100表示权重, 可以不指定即默认

 

分配vnode 到zone中:rebalance

 

swift-ring-builder account.builder rebalance

swift-ring-builder container.builder rebalance

swift-ring-builder object.builder rebalance

16.部署swift服务|swift配置存储和ring

 

 

 

 


推荐阅读
  • 本文介绍了Redis的基础数据结构string的应用场景,并以面试的形式进行问答讲解,帮助读者更好地理解和应用Redis。同时,描述了一位面试者的心理状态和面试官的行为。 ... [详细]
  • 本文介绍了OpenStack的逻辑概念以及其构成简介,包括了软件开源项目、基础设施资源管理平台、三大核心组件等内容。同时还介绍了Horizon(UI模块)等相关信息。 ... [详细]
  • 本文介绍了iOS数据库Sqlite的SQL语句分类和常见约束关键字。SQL语句分为DDL、DML和DQL三种类型,其中DDL语句用于定义、删除和修改数据表,关键字包括create、drop和alter。常见约束关键字包括if not exists、if exists、primary key、autoincrement、not null和default。此外,还介绍了常见的数据库数据类型,包括integer、text和real。 ... [详细]
  • 本文介绍了Python爬虫技术基础篇面向对象高级编程(中)中的多重继承概念。通过继承,子类可以扩展父类的功能。文章以动物类层次的设计为例,讨论了按照不同分类方式设计类层次的复杂性和多重继承的优势。最后给出了哺乳动物和鸟类的设计示例,以及能跑、能飞、宠物类和非宠物类的增加对类数量的影响。 ... [详细]
  • 本文介绍了5个基本Linux命令行工具的现代化替代品,包括du、top和ncdu。这些替代品在功能上进行了改进,提高了可用性,并且适用于现代化系统。其中,ncdu是du的替代品,它提供了与du类似的结果,但在一个基于curses的交互式界面中,重点关注占用磁盘空间较多的目录。 ... [详细]
  • ZABBIX 3.0 配置监控NGINX性能【OK】
    1.在agent端查看配置:nginx-V查看编辑时是否加入状态监控模块:--with-http_stub_status_module--with-http_gzip_stat ... [详细]
  • 基于分布式锁的防止重复请求解决方案
    一、前言关于重复请求,指的是我们服务端接收到很短的时间内的多个相同内容的重复请求。而这样的重复请求如果是幂等的(每次请求的结果都相同,如查 ... [详细]
  • 讨伐Java多线程与高并发——MQ篇
    本文是学习Java多线程与高并发知识时做的笔记。这部分内容比较多,按照内容分为5个部分:多线程基础篇JUC篇同步容器和并发容器篇线程池篇MQ篇本篇 ... [详细]
  • celery 爬虫使用
    简介celery是一个基于分布式消息传输的异步任务队列,它专注于实时处理,同时也支持任务调度。它由三部分组成,消息中间件, ... [详细]
  • Iamworkingonaprojectwhichrequiresopentokandcallkitfornotifyingusers.However,theappli ... [详细]
  • Centos7安装MySql5.6
    如何在CentO ... [详细]
  • Flow 生态案例学习 | Emerald City为Flow上DAO、教育和开发铺平道路
    原文链接:https://www.onflow.org/post/emer ... [详细]
  • Centos7.6安装Gitlab教程及注意事项
    本文介绍了在Centos7.6系统下安装Gitlab的详细教程,并提供了一些注意事项。教程包括查看系统版本、安装必要的软件包、配置防火墙等步骤。同时,还强调了使用阿里云服务器时的特殊配置需求,以及建议至少4GB的可用RAM来运行GitLab。 ... [详细]
  • t-io 2.0.0发布-法网天眼第一版的回顾和更新说明
    本文回顾了t-io 1.x版本的工程结构和性能数据,并介绍了t-io在码云上的成绩和用户反馈。同时,还提到了@openSeLi同学发布的t-io 30W长连接并发压力测试报告。最后,详细介绍了t-io 2.0.0版本的更新内容,包括更简洁的使用方式和内置的httpsession功能。 ... [详细]
  • oracle安装时找不到启动,Oracle没有开机自启是怎么回事?这一步骤很重要
    重启Oracle数据库重启Oracle数据库包括启动Oracle数据库服务进程和启动Oracle数据库两步,大家继续往下看。按照《【Oracle】什么?作为DBA&# ... [详细]
author-avatar
xillb_486
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有