Change SWIFT_DRIVE_LOCATION to SWIFT_LOCATION

Fix some retarness along the way.
main
Chmouel Boudjnah 13 years ago
parent 28fa4e8d94
commit a2cd841265

@ -16,7 +16,7 @@ user_admin_admin = admin .admin .reseller_admin
user_test_tester = testing .admin user_test_tester = testing .admin
user_test2_tester2 = testing2 .admin user_test2_tester2 = testing2 .admin
user_test_tester3 = testing3 user_test_tester3 = testing3
bind_ip = ${MY_IP} bind_ip = 0.0.0.0
[filter:healthcheck] [filter:healthcheck]
use = egg:swift#healthcheck use = egg:swift#healthcheck

@ -6,74 +6,74 @@ address = 127.0.0.1
[account6012] [account6012]
max connections = 25 max connections = 25
path = %SWIFT_LOOPBACK_DISK_SIZE%/1/node/ path = %SWIFT_LOCATION%/1/node/
read only = false read only = false
lock file = /var/lock/account6012.lock lock file = /var/lock/account6012.lock
[account6022] [account6022]
max connections = 25 max connections = 25
path = %SWIFT_LOOPBACK_DISK_SIZE%/2/node/ path = %SWIFT_LOCATION%/2/node/
read only = false read only = false
lock file = /var/lock/account6022.lock lock file = /var/lock/account6022.lock
[account6032] [account6032]
max connections = 25 max connections = 25
path = %SWIFT_LOOPBACK_DISK_SIZE%/3/node/ path = %SWIFT_LOCATION%/3/node/
read only = false read only = false
lock file = /var/lock/account6032.lock lock file = /var/lock/account6032.lock
[account6042] [account6042]
max connections = 25 max connections = 25
path = %SWIFT_LOOPBACK_DISK_SIZE%/4/node/ path = %SWIFT_LOCATION%/4/node/
read only = false read only = false
lock file = /var/lock/account6042.lock lock file = /var/lock/account6042.lock
[container6011] [container6011]
max connections = 25 max connections = 25
path = %SWIFT_LOOPBACK_DISK_SIZE%/1/node/ path = %SWIFT_LOCATION%/1/node/
read only = false read only = false
lock file = /var/lock/container6011.lock lock file = /var/lock/container6011.lock
[container6021] [container6021]
max connections = 25 max connections = 25
path = %SWIFT_LOOPBACK_DISK_SIZE%/2/node/ path = %SWIFT_LOCATION%/2/node/
read only = false read only = false
lock file = /var/lock/container6021.lock lock file = /var/lock/container6021.lock
[container6031] [container6031]
max connections = 25 max connections = 25
path = %SWIFT_LOOPBACK_DISK_SIZE%/3/node/ path = %SWIFT_LOCATION%/3/node/
read only = false read only = false
lock file = /var/lock/container6031.lock lock file = /var/lock/container6031.lock
[container6041] [container6041]
max connections = 25 max connections = 25
path = %SWIFT_LOOPBACK_DISK_SIZE%/4/node/ path = %SWIFT_LOCATION%/4/node/
read only = false read only = false
lock file = /var/lock/container6041.lock lock file = /var/lock/container6041.lock
[object6010] [object6010]
max connections = 25 max connections = 25
path = %SWIFT_LOOPBACK_DISK_SIZE%/1/node/ path = %SWIFT_LOCATION%/1/node/
read only = false read only = false
lock file = /var/lock/object6010.lock lock file = /var/lock/object6010.lock
[object6020] [object6020]
max connections = 25 max connections = 25
path = %SWIFT_LOOPBACK_DISK_SIZE%/2/node/ path = %SWIFT_LOCATION%/2/node/
read only = false read only = false
lock file = /var/lock/object6020.lock lock file = /var/lock/object6020.lock
[object6030] [object6030]
max connections = 25 max connections = 25
path = %SWIFT_LOOPBACK_DISK_SIZE%/3/node/ path = %SWIFT_LOCATION%/3/node/
read only = false read only = false
lock file = /var/lock/object6030.lock lock file = /var/lock/object6030.lock
[object6040] [object6040]
max connections = 25 max connections = 25
path = %SWIFT_LOOPBACK_DISK_SIZE%/4/node/ path = %SWIFT_LOCATION%/4/node/
read only = false read only = false
lock file = /var/lock/object6040.lock lock file = /var/lock/object6040.lock

@ -275,7 +275,7 @@ GLANCE_HOSTPORT=${GLANCE_HOSTPORT:-$HOST_IP:9292}
# ----- # -----
# #
# Location of SWIFT drives # Location of SWIFT drives
SWIFT_DRIVE_LOCATION=${SWIFT_DRIVE_LOCATION:-/srv} SWIFT_LOCATION=${SWIFT_LOCATION:-/srv}
# Size of the loopback disks # Size of the loopback disks
SWIFT_LOOPBACK_DISK_SIZE=${SWIFT_LOOPBACK_DISK_SIZE:-1000000} SWIFT_LOOPBACK_DISK_SIZE=${SWIFT_LOOPBACK_DISK_SIZE:-1000000}
@ -594,19 +594,19 @@ fi
# Storage Service # Storage Service
if [[ "$ENABLED_SERVICES" =~ "swift" ]];then if [[ "$ENABLED_SERVICES" =~ "swift" ]];then
mkdir -p ${SWIFT_DRIVE_LOCATION}/drives mkdir -p ${SWIFT_LOCATION}/drives
local s=${SWIFT_DRIVE_LOCATION}/drives/sdb1 # Shortcut variable local s=${SWIFT_LOCATION}/drives/sdb1 # Shortcut variable
# Create a loopback disk and format it with XFS. # Create a loopback disk and format it with XFS.
if [[ ! -e ${SWIFT_DRIVE_LOCATION}/swift-disk ]];then if [[ ! -e ${SWIFT_LOCATION}/swift-disk ]];then
dd if=/dev/zero of=${SWIFT_DRIVE_LOCATION}/swift-disk bs=1024 count=0 seek=${SWIFT_LOOPBACK_DISK_SIZE} dd if=/dev/zero of=${SWIFT_LOCATION}/swift-disk bs=1024 count=0 seek=${SWIFT_LOOPBACK_DISK_SIZE}
mkfs.xfs -f -i size=1024 ${SWIFT_DRIVE_LOCATION}/swift-disk mkfs.xfs -f -i size=1024 ${SWIFT_LOCATION}/swift-disk
fi fi
# Add the mountpoint to fstab # Add the mountpoint to fstab
if ! egrep -q "^${SWIFT_DRIVE_LOCATION}/swift-disk" /etc/fstab;then if ! egrep -q "^${SWIFT_LOCATION}/swift-disk" /etc/fstab;then
echo "# Added by devstack" | tee -a /etc/fstab echo "# Added by devstack" | tee -a /etc/fstab
echo "${SWIFT_DRIVE_LOCATION}/swift-disk ${s} xfs loop,noatime,nodiratime,nobarrier,logbufs=8 0 0" | \ echo "${SWIFT_LOCATION}/swift-disk ${s} xfs loop,noatime,nodiratime,nobarrier,logbufs=8 0 0" | \
tee -a /etc/fstab tee -a /etc/fstab
fi fi
@ -617,7 +617,7 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]];then
# Create directories # Create directories
install -g stack -o stack -d /etc/swift/{object,container,account}-server \ install -g stack -o stack -d /etc/swift/{object,container,account}-server \
${SWIFT_DRIVE_LOCATION}/{1..4}/node/sdb1 /var/run/swift ${SWIFT_LOCATION}/{1..4}/node/sdb1 /var/run/swift
# Adjust rc.local to always have a /var/run/swift on reboot # Adjust rc.local to always have a /var/run/swift on reboot
# created and chown to our user. # created and chown to our user.
@ -630,7 +630,7 @@ exit 0
EOF EOF
# Add rsync file # Add rsync file
sed -e "s/%SWIFT_LOOPBACK_DISK_SIZE%/$SWIFT_DRIVE_LOCATION/" $FILES/swift-rsyncd.conf > /etc/rsyncd.conf sed -e "s/%SWIFT_LOCATION%/$SWIFT_LOCATION/" $FILES/swift-rsyncd.conf > /etc/rsyncd.conf
# Copy proxy-server configuration # Copy proxy-server configuration
cp $FILES/swift-proxy-server.conf /etc/swift/ cp $FILES/swift-proxy-server.conf /etc/swift/
@ -648,7 +648,7 @@ EOF
local bind_port=$2 local bind_port=$2
local log_facility=$3 local log_facility=$3
for node_number in {1..4};do for node_number in {1..4};do
node_path=${SWIFT_DRIVE_LOCATION}/${node_number}/node node_path=${SWIFT_LOCATION}/${node_number}/node
sed -e "s/%NODE_PATH%/${node_path}/;s/%BIND_PORT%/${bind_port}/;s/%LOG_FACILITY%/${log_facility}/" \ sed -e "s/%NODE_PATH%/${node_path}/;s/%BIND_PORT%/${bind_port}/;s/%LOG_FACILITY%/${log_facility}/" \
$FILES/swift-${server_type}-server.conf > /etc/swift/${server_type}-server/${node_number}.conf $FILES/swift-${server_type}-server.conf > /etc/swift/${server_type}-server/${node_number}.conf
bind_port=$(( ${bind_port} + 10 )) bind_port=$(( ${bind_port} + 10 ))

Loading…
Cancel
Save