【OpenStack】OpenStack系列3之Swift详解

  1. Swift安装部署(与keystone依赖包有冲突,需要安装不同版本eventlet)

    参考:http://www.server110.com/openstack/201402/6662.html

    https://github.com/yongluo2013/osf-openstack-training/blob/master/installation/openstack-icehouse-for-centos65.md

    http://www.server110.com/openstack/201402/6662.html

    1. 源码下载
      1. git clone -b stable/icehouse https://github.com/openstack/swift.git
    2. 安装
      1. pip install -r requirements.txt
      2. python setup.py install
    3. 准备工作
      1. 安装xfs:yum install xfsprogs xinetd –y
      2. 新磁盘数据存储:

        mkfs.xfs /dev/sdb1

        echo "/dev/sdb1 /srv/node/sdb1 xfs noatime,nodiratime,nobarrier,logbufs=8 0 0" >> /etc/fstab

        mkdir -p /srv/node/sdb1

        mount /srv/node/sdb1

        chown -R root:root /srv/node

      3. 配置文件修改

        cp account-server.conf-sample account-server.conf

        cp container-server.conf-sample container-server.conf

        cp object-server.conf-sample object-server.conf

      4. 设置rsync

        参考(注意账号):

        https://github.com/yongluo2013/osf-openstack-training/blob/master/installation/openstack-icehouse-for-centos65.md

      5. 安装proxy服务
        1. 参考:

          https://github.com/yongluo2013/osf-openstack-training/blob/master/installation/openstack-icehouse-for-centos65.md

        2. 安装memcached:yum install memcached –y
      6. Swift的日志配置

        参考:https://lists.launchpad.net/openstack/msg20224.html

        http://blog.csdn.net/robberboyboy/article/details/8639021

      7. 启动proxy:./bin/swift-proxy-server /etc/swift/proxy-server.conf(需要权限)

        swift-init proxy-server start,开启8080端口。

      8. 启动object、container、account服务。参考:

        https://github.com/yongluo2013/osf-openstack-training/blob/master/installation/openstack-icehouse-for-centos65.md

        swift-init all start,依次占用6000、6001、6002端口。

      9. 安装python-swiftclient

        git clone https://github.com/openstack/python-swiftclient.git

        问题可以在openstack官网论坛搜索:

        https://ask.openstack.org/en/question/42545/use-swift-stat-to-vertify-but-get-http-return-401-unauthorized/

        https://ask.openstack.org/en/question/57608/proxy-server-error-insufficient-storage-10001556002sdb1/

      10. 简单测试

        Stat、container、文件上传、下载、删除等

  2. 与Glance对接
    1. 参考

      http://ericzhong.github.io/2013/09/04/install-openstack-from-source/

      http://longgeek.com/2012/07/18/use-swift-as-a-glance-back-end-storage/

      http://mobile.51cto.com/hot-448613.htm

      http://www.ylzx8.cn/zonghe/operating-system/251849.html

      http://www.ylzx8.cn/zonghe/operating-system/251877.html

    2. Glance对接swift

      glance image-create --progress --name="CirrOS 0.3.0" --disk-format=qcow2 --container-format=ovf --is-public=true < image-dir/cirros-0.3.0-x86_64-disk.img

      glance image-create --name "cirros-0.3.3-x86_64" --file image-dir/cirros-0.3.3-x86_64-disk.img --disk-format qcow2 --container-format ovf --is-public=true --progress

      glance image-list

      swift list

  3. Swift源码分析
    1. http://my.oschina.net/zhouxingxing/blog/83295

      http://longgeek.com/2012/07/18/use-swift-as-a-glance-back-end-storage/

  4. Swift存储节点扩减容
    1. 参考:

      https://github.com/yongluo2013/osf-openstack-training/blob/master/installation/openstack-icehouse-for-centos65.md

    2. 架构

      架构与高性能部署:http://os.51cto.com/art/201207/347656.htm

      http://www.th7.cn/Program/IOS/201408/256657.shtml

原文地址:https://www.cnblogs.com/junneyang/p/5257221.html