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

OpenStack Swift All In One安装部署流程与简单使用

[日期:2013-08-01] 来源:Linux社区  作者:fczjuever [字体:大 中 小]

4. 设置独立日志(可选)

1. 创建文件/etc/rsyslog.d/10-swift.conf,内容如下:

# Uncomment the following to have a log containing all logs together

#local1,local2,local3,local4,local5.* /var/log/swift/all.log

 

# Uncomment the following to have hourly proxy logs for stats processing

#$template HourlyProxyLog,"/var/log/swift/hourly/%$YEAR%%$MONTH%%$DAY%%$HOUR%"

#local1.*;local1.!notice ?HourlyProxyLog

 

local1.*;local1.!notice /var/log/swift/proxy.log

local1.notice /var/log/swift/proxy.error

local1.* ~

 

local2.*;local2.!notice /var/log/swift/storage1.log

local2.notice /var/log/swift/storage1.error

local2.* ~

 

local3.*;local3.!notice /var/log/swift/storage2.log

local3.notice /var/log/swift/storage2.error

local3.* ~

 

local4.*;local4.!notice /var/log/swift/storage3.log

local4.notice /var/log/swift/storage3.error

local4.* ~

 

local5.*;local5.!notice /var/log/swift/storage4.log

local5.notice /var/log/swift/storage4.error

local5.* ~

 

2. 编辑文件/etc/rsyslog.conf,更改参数$PrivDropToGroup为adm。

$PrivDropToGroup adm

 

3. 创建swift每小时的文件夹。

# mkdir -p /var/log/swift/hourly

 

4. 更改swift的log文件夹权限。

# chown -R syslog.adm /var/log/swift

# chmod -R g+w /var/log/swift

 

5. 重启rsyslog服务。

# service rsyslog restart

 


 

5. 获取代码并设置测试环境

  若不打算在全root权限下安装Swift,则需要切换回guest权限。此处,我们全部使用root安装。

1. 创建文件夹。

# mkdir ~/bin

 

2. 从git上获取swift代码,下载到本地。

# git clone https://github.com/openstack/swift.git

 

3. 安装Swift的开发版本。

# cd ~/swift

# python setup.py develop

# cd ..

 

4. 从git上获取python-swiftclient代码,下载到本地。

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

 

5. 安装python-swiftclient的开发版本。

# cd ~/python-swiftclient

# python setup.py develop

# cd ..

 

6. 编辑文件~/.bashrc,并在文件尾添加如下内容:

export SWIFT_TEST_CONFIG_FILE=/etc/swift/test.conf

export PATH=${PATH}:~/bin

 

7. 执行。

# . ~/.bashrc

 


 

6. 配置结点

1. 创建文件/etc/swift/proxy-server.conf,文件内容如下:

[DEFAULT]

bind_port = 8080

user = root

log_facility = LOG_LOCAL1

eventlet_debug = true

 

[pipeline:main]

pipeline = healthcheck cache tempauth proxy-logging proxy-server

 

[app:proxy-server]

use = egg:swift#proxy

allow_account_management = true

account_autocreate = true

 

[filter:tempauth]

use = egg:swift#tempauth

user_admin_admin = admin .admin .reseller_admin

user_test_tester = testing .admin

user_test2_tester2 = testing2 .admin

user_test_tester3 = testing3

 

[filter:healthcheck]

use = egg:swift#healthcheck

 

[filter:cache]

use = egg:swift#memcache

 

[filter:proxy-logging]

use = egg:swift#proxy_logging

 

2. 创建文件/etc/swift/swift.conf,文件内容如下:

[swift-hash]

# random unique string that can never change (DO NOT LOSE)

swift_hash_path_suffix = jtangfs

 

3. 创建文件/etc/swift/account-server/1.conf,文件内容如下:

[DEFAULT]

devices = /srv/1/node

mount_check = false

disable_fallocate = true

bind_port = 6012

user = root

log_facility = LOG_LOCAL2

recon_cache_path = /var/cache/swift

eventlet_debug = true

 

[pipeline:main]

pipeline = recon account-server

 

[app:account-server]

use = egg:swift#account

 

[filter:recon]

use = egg:swift#recon

 

[account-replicator]

vm_test_mode = yes

 

[account-auditor]

 

[account-reaper]

 

4. 创建文件/etc/swift/account-server/2.conf,文件内容如下:

[DEFAULT]

devices = /srv/2/node

mount_check = false

disable_fallocate = true

bind_port = 6022

user = root

log_facility = LOG_LOCAL3

recon_cache_path = /var/cache/swift2

eventlet_debug = true

 

[pipeline:main]

pipeline = recon account-server

 

[app:account-server]

use = egg:swift#account

 

[filter:recon]

use = egg:swift#recon

 

[account-replicator]

vm_test_mode = yes

 

[account-auditor]

 

[account-reaper]

 

5. 创建文件/etc/swift/account-server/3.conf,文件内容如下:

[DEFAULT]

devices = /srv/3/node

mount_check = false

disable_fallocate = true

bind_port = 6032

user = root

log_facility = LOG_LOCAL4

recon_cache_path = /var/cache/swift3

eventlet_debug = true

 

[pipeline:main]

pipeline = recon account-server

 

[app:account-server]

use = egg:swift#account

 

[filter:recon]

use = egg:swift#recon

 

[account-replicator]

vm_test_mode = yes

 

[account-auditor]

 

[account-reaper]

 

6. 创建文件/etc/swift/account-server/4.conf,文件内容如下:

[DEFAULT]

devices = /srv/4/node

mount_check = false

disable_fallocate = true

bind_port = 6042

user = root

log_facility = LOG_LOCAL5

recon_cache_path = /var/cache/swift4

eventlet_debug = true

 

[pipeline:main]

pipeline = recon account-server

 

[app:account-server]

use = egg:swift#account

 

[filter:recon]

use = egg:swift#recon

 

[account-replicator]

vm_test_mode = yes

 

[account-auditor]

 

[account-reaper]

 

7. 创建文件/etc/swift/container-server/1.conf,文件内容如下:

[DEFAULT]

devices = /srv/1/node

mount_check = false

disable_fallocate = true

bind_port = 6011

user = root

log_facility = LOG_LOCAL2

recon_cache_path = /var/cache/swift

eventlet_debug = true

 

[pipeline:main]

pipeline = recon container-server

 

[app:container-server]

use = egg:swift#container

 

[filter:recon]

use = egg:swift#recon

 

[container-replicator]

vm_test_mode = yes

 

[container-updater]

 

[container-auditor]

 

[container-sync]

 

8. 创建文件/etc/swift/container-server/2.conf,文件内容如下:

[DEFAULT]

devices = /srv/2/node

mount_check = false

disable_fallocate = true

bind_port = 6021

user = root

log_facility = LOG_LOCAL3

recon_cache_path = /var/cache/swift2

eventlet_debug = true

 

[pipeline:main]

pipeline = recon container-server

 

[app:container-server]

use = egg:swift#container

 

[filter:recon]

use = egg:swift#recon

 

[container-replicator]

vm_test_mode = yes

 

[container-updater]

 

[container-auditor]

 

[container-sync]

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

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