你好,游客 登录 注册 搜索
背景:
阅读新闻

在Ubuntu上安装OpenStack的Swift组件-installing openstack object storage

[日期:2013-08-01] 来源:Linux社区  作者:zoushidexing [字体: ]

这几天正在自己搭建一个swift的环境。看了一些资料,结合自己的实践,写下了它: 

OpenStack Hands on lab系列相关文章http://www.linuxidc.com/Linux/2013-08/88170.htm

相关阅读:

OpenStack 监控 - 整合Nagios 调研总结 http://www.linuxidc.com/Linux/2013-02/79931.htm

CentOS 6.4 安装OpenStack Nova http://www.linuxidc.com/Linux/2013-07/86981.htm

采用OpenStack HP推Cloud OS云操作系统 http://www.linuxidc.com/Linux/2013-06/86361.htm

1.物理环境说明:

  1. Linux系统版本:Ubuntu Server 12.04
  2. Proxy Server IP: 10.214.0.181
  3. Storage Server One: 10.214.0.179
  4. Storage Server Two: 10.214.0.180
  5. Storage Server three: 10.214.0.182

2.重要组件说明:

node:运行一个或多个object storage service

proxy node:运行 proxy services

auth node:运行Auth service

storage:运行account,container,and object services

Ring:是Openstack object storage 到物理设备的映射集合

 

 在所有节点上的准备工作:

安装服务

  1. apt-get install swift openssh-server rsync memcached python-netifaces python-xattr python-memcache


配置路径

  1. mkdir -p /etc/swift
  2. chown -R swift:swift /etc/swift/


新建文件 vim /etc/swift/swift.conf

  1. [swift-hash]
  2. # random unique string that can never change (DO NOT LOSE)
  3. swift_hash_path_suffix = fLIbertYgibbitZ

3.安装和配置storage nodes

安装:Storage node packages,所有storage都要进行操作。

  1. aptitude install swift-account swift-container swift-object xfsprogs


新建xfs系统分区,当然,(这需要一个空分区),如果硬盘的分区已经被使用而数据你又不想要了,那就删除分区后进行下列操作。否则添加一块新硬盘是最方便的选择。所有storage都要进行操作。

  1. fdisk /dev/sdb
  2. Command (m for help): n
  3. Partition type:
  4. p primary (0 primary, 0 extended, 4 free)
  5. e extended
  6. Select (default p): p
  7. Partition number (1-4, default 1): 1
  8. First sector (2048-488281249, default 2048):
  9. Using default value 2048
  10. Last sector, +sectors or +size{K,M,G} (2048-488281249, default 488281249):
  11. Using default value 488281249
  12. Command (m for help): p
  13. Disk /dev/sdb: 250.0 GB, 250000000000 bytes
  14. 255 heads, 63 sectors/track, 30394 cylinders, total 488281250 sectors
  15. Units = sectors of 1 * 512 = 512 bytes
  16. Sector size (logical/physical): 512 bytes / 512 bytes
  17. I/O size (minimum/optimal): 512 bytes / 512 bytes
  18. Disk identifier: 0x00000081
  19. Device Boot Start End Blocks Id System
  20. /dev/sdb1 2048 488281249 244139601 83 Linux
  21. Command (m for help): w
  22. The partition table has been altered!

识别并挂载新的分区:

  1. partprobe#如果不行,就重启一下吧。
 
  1. mkdir -p /srv/node/sdb1
 
  1. mkfs.xfs -i size=1024 /dev/sdb1 -f
  2. echo "/dev/sdb1 /srv/node/sdb1 xfs noatime,nodiratime,nobarrier,logbufs=8 0 0" >> /etc/fstab
  3. mount /srv/node/sdb1
 
  1. chown -R swift:swift /srv/node

 创建并配置 vim /etc/rsyncd.conf

  1. uid = swift
  2. gid = swift
  3. log file = /var/log/rsyncd.log
  4. pid file = /var/run/rsyncd.pid
  5. address = 10.214.0.179
  6. [account]
  7. max connections = 2
  8. path = /srv/node/
  9. read only = false
  10. lock file = /var/lock/account.lock
  11. [container]
  12. max connections = 2
  13. path =/srv/node/
  14. read only = false
  15. lock file = /var/lock/container.lock
  16. [object]
  17. max connections = 2
  18. path = /srv/node/
  19. read only = false
  20. lock file = /var/lock/object.lock

注意:path 写你实际的(刚才新建的)分区的位置。address修改为当前storage的地址。

编辑vim /etc/default/rsync(即设置为了开机启动)

  1. RSYNC_ENABLE = true

重新/启动服务

  1. service rsync restart


创建或检查 vim /etc/swift/account-server.conf

  1. [DEFAULT]
  2. devices = /sdb1
  3. mount_check = false
  4. bind_port = 6002
  5. user = swift
  6. bind_ip = 0.0.0.0
  7. workers = 2
  8. [pipeline:main]
  9. pipeline = account-server
  10. [app:account-server]
  11. use = egg:swift#account
  12. [account-replicator]
  13. [account-auditor]
  14. [account-reaper]


创建或检查 vim /etc/swift/container-server.conf

  1. [DEFAULT]
  2. devices = /sdb1
  3. mount_check = false
  4. bind_ip = 0.0.0.0
  5. bind_port = 6001
  6. workers = 2
  7. [pipeline:main]
  8. pipeline = container-server
  9. [app:container-server]
  10. use = egg:swift#container
  11. [container-replicator]
  12. [container-updater]
  13. [container-auditor]
 
  1. [container-sync]
 
    1. 注意:[container-sync]这个是添加上去的,不要忘记了
linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款