您的位置:首页 > 移动开发 > Swift

【OpenStack】OpenStack系列3之Swift详解

2016-03-09 10:50 567 查看
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

源码下载

git clone -b stable/icehouse https://github.com/openstack/swift.git
安装

pip install -r requirements.txt

python setup.py install

准备工作

安装xfs:yum install xfsprogs xinetd –y

新磁盘数据存储:
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

配置文件修改
cp account-server.conf-sample account-server.conf

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

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

设置rsync
参考(注意账号):

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

安装proxy服务

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

安装memcached:yum install memcached –y

Swift的日志配置
参考:https://lists.launchpad.net/openstack/msg20224.html

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

启动proxy:./bin/swift-proxy-server /etc/swift/proxy-server.conf(需要权限)
swift-init proxy-server start,开启8080端口。

启动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端口。

安装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/

简单测试
Stat、container、文件上传、下载、删除等

与Glance对接

参考
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

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

Swift源码分析

参考:http://my.oschina.net/zhouxingxing/blog?catalog=270170
http://my.oschina.net/zhouxingxing/blog/83295

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

Swift存储节点扩减容

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

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

http://www.th7.cn/Program/IOS/201408/256657.shtml
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: