# OpenStackSwift 下安裝
從專業版服務器的 2.0.5 版本開始,Seafile 可以使用兼容 S3 的云存儲(比如 OpenStack/Swift)作為后端。這篇文檔將以使用 Swift 為例。
### 準備工作
首先您需要為 Swift 啟用 S3 的模擬中間件。有關說明可以參考以下鏈接:
- [http://www.buildcloudstorage.com/2011/11/s3-apis-on-openstack-swift.html](http://www.buildcloudstorage.com/2011/11/s3-apis-on-openstack-swift.html)
- [http://docs.openstack.org/grizzly/openstack-compute/admin/content/configuring-swift-with-s3-emulation-to-use-keystone.html](http://docs.openstack.org/grizzly/openstack-compute/admin/content/configuring-swift-with-s3-emulation-to-use-keystone.html)
成功安裝設置 S3 中間件后,您就可以用任何 S3 的客戶端訪問它了。在 Swift 中,訪問的 key id 作為用戶名 secret key 作為用戶的密碼。下一步您要做的就是為 Seafile 創建 buckets。使用 Python 的 boto 庫您可以這樣做:
~~~
import boto
import boto.s3.connection
connection = boto.connect_s3(
aws_access_key_id='swifttest:testuser',
aws_secret_access_key='testing',
port=8080,
host='swift-proxy-server-address',
is_secure=False,
calling_format=boto.s3.connection.OrdinaryCallingFormat())
connection.create_bucket('seafile-commits')
connection.create_bucket('seafile-fs')
connection.create_bucket('seafile-blocks')
~~~
### 修改 seafile.conf 文件
將下面幾行追加到 `seafile-data/seafile.conf` 文件中
~~~
[block_backend]
name = s3
bucket = seafile-blocks
key_id = swifttest:testuser
key = testing
host = <swift-proxy-server-address>:8080
path_style_request = true
memcached_options = --SERVER=localhost --POOL-MIN=10 --POOL-MAX=100
[commit_object_backend]
name = s3
bucket = seafile-commits
key_id = swifttest:testuser
key = testing
host = <swift-proxy-server-address>:8080
path_style_request = true
memcached_options = --SERVER=localhost --POOL-MIN=10 --POOL-MAX=100
[fs_object_backend]
name = s3
bucket = seafile-fs
key_id = swifttest:testuser
key = testing
host = <swift-proxy-server-address>:8080
path_style_request = true
memcached_options = --SERVER=localhost --POOL-MIN=10 --POOL-MAX=100
~~~
為了提高性能,Seafile 會在 memcached 中緩存小的 objects。所以強烈建議您安裝并且運行 memcached。最好是為 Seafile 提供一個專門的 memcached 實例并為其分配 128MB 的內存空間。
- 介紹
- 概覽
- Seafile 組件
- 研發路線圖
- 常見問題解答
- 修改日志
- 我要參與
- Linux 下部署 Seafile 服務器
- 部署 Seafile 服務器(使用 SQLite)
- 部署 Seafile 服務器(使用 MySQL)
- Nginx 下配置 Seahub
- Nginx 下啟用 Https
- Apache 下配置 Seahub
- Apache 下啟用 Https
- Seafile LDAP 配置
- 開機啟動 Seafile
- 防火墻設置
- Logrotate 管理系統日志
- 使用 Memcached
- 使用 NAT
- 非根域名下部署 Seahub
- 從 SQLite 遷移至 MySQL
- 安裝常見問題
- 升級
- Windows 下部署 Seafile 服務器
- 下載安裝 Windows 版 Seafile 服務器
- 安裝 Seafile 為 Windows 服務
- 所用端口說明
- 升級
- 從 Windows 遷移到 Linux
- 垃圾回收
- 部署 Seafile 專業版服務器
- 下載安裝 Seafile 專業版服務器
- 從社區版遷移至專業版
- 升級
- Amazon S3 下安裝
- OpenStackSwift 下安裝
- Ceph 下安裝
- 配置選項
- 文件搜索說明
- 集群部署
- 集群中啟用搜索和后臺服務
- NFS 下集群安裝
- 常見問題解答
- 軟件許可協議
- 服務器個性化配置
- ccnet.conf
- seafile.conf
- seahub_settings.py
- 發送郵件提醒
- 個性化郵件提醒
- 用戶管理
- 存儲容量與文件上傳/下載大小限制
- 自定義 Web
- 管理員手冊
- 賬戶管理
- 日志
- 備份與恢復
- Seafile FSCK
- Seafile GC
- WebDAV 和 FUSE 擴展
- WebDAV 擴展
- FUSE 擴展
- 安全選項
- 安全特性
- 日志和審計
- 開發文檔
- 編譯 Seafile
- Linux
- Windows
- Max OS X
- Server
- 開發環境
- 編程規范
- Web API
- Python API
- 數據模型
- 服務器組件
- 同步算法