mkdir /mnt/sdb1
mount /dev/vgstorage/lvswift /mnt/sdb1
vi /etc/fstab
加入 /dev/vgstorage/lvswift /mnt/sdb1 xfs defaults 0 0
mkdir /mnt/sdb1/1 /mnt/sdb1/2 /mnt/sdb1/3 /mnt/sdb1/4
for x in {1..4}; do ln -s /mnt/sdb1/$x /srv/$x; done
mkdir -p /etc/swift/object-server /etc/swift/container-server /etc/swift/account-server /srv/1/node/sdb1 /srv/2/node/sdb2 /srv/3/node/sdb3 /srv/4/node/sdb4 /var/run/swift
chown -R swift:swift /etc/swift/ /srv/ /var/run/swift/ /mnt/sdb1
keystone service-create --name swift --type object-store --description "Swift Storage Service hao"
WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | Swift Storage Service hao |
| id | dac813a9993c4743977a057c2f4b199e |
| name | swift |
| type | object-store |
+-------------+----------------------------------+
[iyunv@controller srv(keystone_admin)]#
# keystone endpoint-create --service swift --publicurl "http://172.16.21.233:8080/v1/AUTH_%(tenant_id)s" --adminurl "http://172.16.21.233:8080/v1/AUTH_%(tenant_id)s" --internalurl "http://172.16.21.233:8080/v1/AUTH_%(tenant_id)s" --region beijing
WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
+-------------+-------------------------------------------------+
| Property | Value |
+-------------+-------------------------------------------------+
| adminurl | http://172.16.21.233:8080/v1/AUTH_%(tenant_id)s |
| id | 50cd09254c324fcc9ce04a4c16836007 |
| internalurl | http://172.16.21.233:8080/v1/AUTH_%(tenant_id)s |
| publicurl | http://172.16.21.233:8080/v1/AUTH_%(tenant_id)s |
| region | beijing |
| service_id | dac813a9993c4743977a057c2f4b199e |
+-------------+-------------------------------------------------+
[iyunv@controller srv(keystone_admin)]#
在keystone库的service表中加了一条数据
在endpoint表加了3条数据
---------------
设置rsync:
修改/etc/xinetd.d/rsync文件
disable = no
新建文件/etc/rsyncd.conf
uid = swift
gid = swift
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
address = 127.0.0.1
[account6012]
max connections = 25
path = /srv/1/node/
read only = false
lock file = /var/lock/account6012.lock
[account6022]
max connections = 25
path = /srv/2/node/
read only = false
lock file = /var/lock/account6022.lock
[account6032]
max connections = 25
path = /srv/3/node/
read only = false
lock file = /var/lock/account6032.lock
[account6042]
max connections = 25
path = /srv/4/node/
read only = false
lock file = /var/lock/account6042.lock
[container6011]
max connections = 25
path = /srv/1/node/
read only = false
lock file = /var/lock/container6011.lock
[container6021]
max connections = 25
path = /srv/2/node/
read only = false
lock file = /var/lock/container6021.lock
[container6031]
max connections = 25
path = /srv/3/node/
read only = false
lock file = /var/lock/container6031.lock
[container6041]
max connections = 25
path = /srv/4/node/
read only = false
lock file = /var/lock/container6041.lock
[object6010]
max connections = 25
path = /srv/1/node/
read only = false
lock file = /var/lock/object6010.lock
[object6020]
max connections = 25
path = /srv/2/node/
read only = false
lock file = /var/lock/object6020.lock
[object6030]
max connections = 25
path = /srv/3/node/
read only = false
lock file = /var/lock/object6030.lock
[object6040]
max connections = 25
path = /srv/4/node/
read only = false
lock file = /var/lock/object6040.lock
新建文件/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.* ~
[iyunv@controller ~(keystone_admin)]# ./remakering.sh
Device d0r1z1-172.16.21.233:6010R172.16.21.233:6010/sdb1_"" with 1.0 weight got id 0
Device d1r1z2-172.16.21.233:6020R172.16.21.233:6020/sdb2_"" with 1.0 weight got id 1
Device d2r1z3-172.16.21.233:6030R172.16.21.233:6030/sdb3_"" with 1.0 weight got id 2
Device d3r1z4-172.16.21.233:6040R172.16.21.233:6040/sdb4_"" with 1.0 weight got id 3
Reassigned 1024 (100.00%) partitions. Balance is now 0.00.
Device d0r1z1-172.16.21.233:6011R172.16.21.233:6011/sdb1_"" with 1.0 weight got id 0
Device d1r1z2-172.16.21.233:6021R172.16.21.233:6021/sdb2_"" with 1.0 weight got id 1
Device d2r1z3-172.16.21.233:6031R172.16.21.233:6031/sdb3_"" with 1.0 weight got id 2
Device d3r1z4-172.16.21.233:6041R172.16.21.233:6041/sdb4_"" with 1.0 weight got id 3
Reassigned 1024 (100.00%) partitions. Balance is now 0.00.
Device d0r1z1-172.16.21.233:6012R172.16.21.233:6012/sdb1_"" with 1.0 weight got id 0
Device d1r1z2-172.16.21.233:6022R172.16.21.233:6022/sdb2_"" with 1.0 weight got id 1
Device d2r1z3-172.16.21.233:6032R172.16.21.233:6032/sdb3_"" with 1.0 weight got id 2
Device d3r1z4-172.16.21.233:6042R172.16.21.233:6042/sdb4_"" with 1.0 weight got id 3
Reassigned 1024 (100.00%) partitions. Balance is now 0.00.
[iyunv@controller ~(keystone_admin)]#