Browse code

Change SWIFT_LOCATION to SWIFT_DATA_LOCATION

Chmouel Boudjnah authored on 2011/11/03 17:17:06
Showing 2 changed files
... ...
@@ -6,74 +6,74 @@ address = 127.0.0.1
6 6
 
7 7
 [account6012]
8 8
 max connections = 25
9
-path = %SWIFT_LOCATION%/1/node/
9
+path = %SWIFT_DATA_LOCATION%/1/node/
10 10
 read only = false
11 11
 lock file = /var/lock/account6012.lock
12 12
 
13 13
 [account6022]
14 14
 max connections = 25
15
-path = %SWIFT_LOCATION%/2/node/
15
+path = %SWIFT_DATA_LOCATION%/2/node/
16 16
 read only = false
17 17
 lock file = /var/lock/account6022.lock
18 18
 
19 19
 [account6032]
20 20
 max connections = 25
21
-path = %SWIFT_LOCATION%/3/node/
21
+path = %SWIFT_DATA_LOCATION%/3/node/
22 22
 read only = false
23 23
 lock file = /var/lock/account6032.lock
24 24
 
25 25
 [account6042]
26 26
 max connections = 25
27
-path = %SWIFT_LOCATION%/4/node/
27
+path = %SWIFT_DATA_LOCATION%/4/node/
28 28
 read only = false
29 29
 lock file = /var/lock/account6042.lock
30 30
 
31 31
 
32 32
 [container6011]
33 33
 max connections = 25
34
-path = %SWIFT_LOCATION%/1/node/
34
+path = %SWIFT_DATA_LOCATION%/1/node/
35 35
 read only = false
36 36
 lock file = /var/lock/container6011.lock
37 37
 
38 38
 [container6021]
39 39
 max connections = 25
40
-path = %SWIFT_LOCATION%/2/node/
40
+path = %SWIFT_DATA_LOCATION%/2/node/
41 41
 read only = false
42 42
 lock file = /var/lock/container6021.lock
43 43
 
44 44
 [container6031]
45 45
 max connections = 25
46
-path = %SWIFT_LOCATION%/3/node/
46
+path = %SWIFT_DATA_LOCATION%/3/node/
47 47
 read only = false
48 48
 lock file = /var/lock/container6031.lock
49 49
 
50 50
 [container6041]
51 51
 max connections = 25
52
-path = %SWIFT_LOCATION%/4/node/
52
+path = %SWIFT_DATA_LOCATION%/4/node/
53 53
 read only = false
54 54
 lock file = /var/lock/container6041.lock
55 55
 
56 56
 
57 57
 [object6010]
58 58
 max connections = 25
59
-path = %SWIFT_LOCATION%/1/node/
59
+path = %SWIFT_DATA_LOCATION%/1/node/
60 60
 read only = false
61 61
 lock file = /var/lock/object6010.lock
62 62
 
63 63
 [object6020]
64 64
 max connections = 25
65
-path = %SWIFT_LOCATION%/2/node/
65
+path = %SWIFT_DATA_LOCATION%/2/node/
66 66
 read only = false
67 67
 lock file = /var/lock/object6020.lock
68 68
 
69 69
 [object6030]
70 70
 max connections = 25
71
-path = %SWIFT_LOCATION%/3/node/
71
+path = %SWIFT_DATA_LOCATION%/3/node/
72 72
 read only = false
73 73
 lock file = /var/lock/object6030.lock
74 74
 
75 75
 [object6040]
76 76
 max connections = 25
77
-path = %SWIFT_LOCATION%/4/node/
77
+path = %SWIFT_DATA_LOCATION%/4/node/
78 78
 read only = false
79 79
 lock file = /var/lock/object6040.lock
... ...
@@ -293,9 +293,9 @@ GLANCE_HOSTPORT=${GLANCE_HOSTPORT:-$HOST_IP:9292}
293 293
 # TODO: add logging to different location.
294 294
 
295 295
 # By default the location of swift drives and objects is located inside
296
-# the swift source directory. SWIFT_LOCATION variable allow you to redefine
296
+# the swift source directory. SWIFT_DATA_LOCATION variable allow you to redefine
297 297
 # this.
298
-SWIFT_LOCATION=${SWIFT_LOCATION:-${SWIFT_DIR}/data}
298
+SWIFT_DATA_LOCATION=${SWIFT_DATA_LOCATION:-${SWIFT_DIR}/data}
299 299
 
300 300
 # devstack will create a loop-back disk formatted as XFS to store the
301 301
 # swift data. By default the disk size is 1 gigabyte. The variable
... ...
@@ -640,47 +640,47 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
640 640
     # changing the permissions so we can run it as our user.
641 641
 
642 642
     USER_GROUP=$(id -g)
643
-    sudo mkdir -p ${SWIFT_LOCATION}/drives
644
-    sudo chown -R $USER:${USER_GROUP} ${SWIFT_LOCATION}/drives
643
+    sudo mkdir -p ${SWIFT_DATA_LOCATION}/drives
644
+    sudo chown -R $USER:${USER_GROUP} ${SWIFT_DATA_LOCATION}/drives
645 645
     
646 646
     # We then create a loopback disk and format it to XFS.
647
-    if [[ ! -e ${SWIFT_LOCATION}/drives/images/swift.img ]];then
648
-        mkdir -p  ${SWIFT_LOCATION}/drives/images
649
-        sudo touch  ${SWIFT_LOCATION}/drives/images/swift.img
650
-        sudo chown $USER: ${SWIFT_LOCATION}/drives/images/swift.img
647
+    if [[ ! -e ${SWIFT_DATA_LOCATION}/drives/images/swift.img ]];then
648
+        mkdir -p  ${SWIFT_DATA_LOCATION}/drives/images
649
+        sudo touch  ${SWIFT_DATA_LOCATION}/drives/images/swift.img
650
+        sudo chown $USER: ${SWIFT_DATA_LOCATION}/drives/images/swift.img
651 651
         
652
-        dd if=/dev/zero of=${SWIFT_LOCATION}/drives/images/swift.img \
652
+        dd if=/dev/zero of=${SWIFT_DATA_LOCATION}/drives/images/swift.img \
653 653
             bs=1024 count=0 seek=${SWIFT_LOOPBACK_DISK_SIZE}
654
-        mkfs.xfs -f -i size=1024  ${SWIFT_LOCATION}/drives/images/swift.img
654
+        mkfs.xfs -f -i size=1024  ${SWIFT_DATA_LOCATION}/drives/images/swift.img
655 655
     fi
656 656
 
657 657
     # After the drive being created we mount the disk with a few mount
658 658
     # options to make it most efficient as possible for swift.
659
-    mkdir -p ${SWIFT_LOCATION}/drives/sdb1
660
-    if ! egrep -q ${SWIFT_LOCATION}/drives/sdb1 /proc/mounts;then
659
+    mkdir -p ${SWIFT_DATA_LOCATION}/drives/sdb1
660
+    if ! egrep -q ${SWIFT_DATA_LOCATION}/drives/sdb1 /proc/mounts;then
661 661
         sudo mount -t xfs -o loop,noatime,nodiratime,nobarrier,logbufs=8  \
662
-            ${SWIFT_LOCATION}/drives/images/swift.img ${SWIFT_LOCATION}/drives/sdb1
662
+            ${SWIFT_DATA_LOCATION}/drives/images/swift.img ${SWIFT_DATA_LOCATION}/drives/sdb1
663 663
     fi
664 664
 
665 665
     # We then create link to that mounted location so swift would know
666 666
     # where to go.
667
-    for x in {1..4}; do sudo ln -sf ${SWIFT_LOCATION}/drives/sdb1/$x ${SWIFT_LOCATION}/$x; done
667
+    for x in {1..4}; do sudo ln -sf ${SWIFT_DATA_LOCATION}/drives/sdb1/$x ${SWIFT_DATA_LOCATION}/$x; done
668 668
     
669 669
     # We now have to emulate a few different servers into one we
670 670
     # create all the directories needed for swift 
671 671
     tmpd=""
672
-    for d in ${SWIFT_LOCATION}/drives/sdb1/{1..4} /etc/swift /etc/swift/{object,container,account}-server \
673
-        ${SWIFT_LOCATION}/{1..4}/node/sdb1 /var/run/swift ;do
672
+    for d in ${SWIFT_DATA_LOCATION}/drives/sdb1/{1..4} /etc/swift /etc/swift/{object,container,account}-server \
673
+        ${SWIFT_DATA_LOCATION}/{1..4}/node/sdb1 /var/run/swift ;do
674 674
         [[ -d $d ]] && continue
675 675
         sudo install -o ${USER} -g $USER_GROUP -d $d
676 676
     done
677 677
 
678
-    sudo chown -R $USER: ${SWIFT_LOCATION}/{1..4}/node
678
+    sudo chown -R $USER: ${SWIFT_DATA_LOCATION}/{1..4}/node
679 679
 
680 680
    # Swift use rsync to syncronize between all the different
681 681
    # partitions (which make more sense when you have a multi-node
682 682
    # setup) we configure it with our version of rsync.
683
-   sed -e "s/%GROUP%/${USER_GROUP}/;s/%USER%/$USER/;s,%SWIFT_LOCATION%,$SWIFT_LOCATION," $FILES/swift/rsyncd.conf | sudo tee /etc/rsyncd.conf
683
+   sed -e "s/%GROUP%/${USER_GROUP}/;s/%USER%/$USER/;s,%SWIFT_DATA_LOCATION%,$SWIFT_DATA_LOCATION," $FILES/swift/rsyncd.conf | sudo tee /etc/rsyncd.conf
684 684
    sudo sed -i '/^RSYNC_ENABLE=false/ { s/false/true/ }' /etc/default/rsync
685 685
 
686 686
    # By default Swift will be installed with the tempauth middleware
... ...
@@ -714,7 +714,7 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
714 714
        local node_number
715 715
        
716 716
        for node_number in {1..4};do
717
-           node_path=${SWIFT_LOCATION}/${node_number}
717
+           node_path=${SWIFT_DATA_LOCATION}/${node_number}
718 718
            sed -e "s,%USER%,$USER,;s,%NODE_PATH%,${node_path},;s,%BIND_PORT%,${bind_port},;s,%LOG_FACILITY%,${log_facility}," \
719 719
                $FILES/swift/${server_type}-server.conf > /etc/swift/${server_type}-server/${node_number}.conf
720 720
            bind_port=$(( ${bind_port} + 10 ))