Skip to content

Commit 65c0ee3

Browse files
committed
updatres
1 parent d1f3570 commit 65c0ee3

File tree

4 files changed

+88
-43
lines changed

4 files changed

+88
-43
lines changed

Gluster-Halo/SetUpHalo.sh

+26-16
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ then
102102
echo "Setting Up Remote Host... ${gfs[index]}"
103103

104104
# base remote commands
105-
if [ "$RERUN" == "N" ]
105+
if [ "$RERUN" == "N" ] || [ "$RERUN" == "add" ]
106106
then
107107
echo "Setting up subscription services from RHEL..."
108108
echo " ... Remotely Installing Base Software on ${gfs[index]}"
@@ -146,7 +146,7 @@ then
146146
fi
147147

148148
# Gluster and Heketi specific remote commands
149-
if [ "$RERUN_GLUSTER" == "Y" ] || [ "$RERUN" == "N" ]
149+
if [ "$RERUN_GLUSTER" == "Y" ] || [ "$RERUN" == "N" ] || [ "$RERUN" == "add" ]
150150
then
151151
echo " ... Remotely Installing GlusterFS and/or Heketi on ${gfs[index]}"
152152
source $CONFIG_HOME/../lib/install-gluster-remote.sh
@@ -155,7 +155,7 @@ then
155155
fi
156156

157157
# Swift specific remote commands
158-
if [ "$INSTALL_SWIFT_REMOTE" == "Y" ] && [ "$RERUN" == "N" ]
158+
if [ "$INSTALL_SWIFT_REMOTE" == "Y" ] && ([ "$RERUN" == "N" ] || [ "$RERUN" == "add" ])
159159
then
160160
echo " ... Remotely Installing Swift and Clients on ${gfs[index]}"
161161
source $CONFIG_HOME/../lib/install-swift-remote.sh
@@ -273,20 +273,25 @@ then
273273
if [ "$index" == 0 ]
274274
then
275275
# Install core software (go, etcd, docker, etc...)
276-
source $CONFIG_HOME/../lib/install-go.sh
277-
echo " ....."
278-
echo ""
279-
source $CONFIG_HOME/../lib/install-etcd.sh
280-
echo " ....."
281-
echo ""
282-
source $CONFIG_HOME/../lib/docker-base.sh
283-
echo " ....."
284-
echo ""
276+
if [ "$RERUN" == "add" ]
277+
then
278+
echo "..."
279+
else
280+
source $CONFIG_HOME/../lib/install-go.sh
281+
echo " ....."
282+
echo ""
283+
source $CONFIG_HOME/../lib/install-etcd.sh
284+
echo " ....."
285+
echo ""
286+
source $CONFIG_HOME/../lib/docker-base.sh
287+
echo " ....."
288+
echo ""
285289

286-
# restart docker
287-
source $CONFIG_HOME/../lib/docker-restart.sh
288-
echo " ....."
289-
echo ""
290+
# restart docker
291+
source $CONFIG_HOME/../lib/docker-restart.sh
292+
echo " ....."
293+
echo ""
294+
fi
290295
else
291296
echo " ... Remotely Installing PreReqs (Docker, Go, ETCD) on ${gfs[index]}"
292297
source $CONFIG_HOME/../lib/install-go-remote.sh
@@ -441,6 +446,11 @@ then
441446
wait
442447
result=`eval gluster volume start $GFS_VOLNAME`
443448
wait
449+
if [ "$INSTALL_SWIFT_LOCAL" == "Y" ]
450+
then
451+
cd /etc/swift; gluster-swift-gen-builders $GFS_VOLNAME
452+
swift-init main start
453+
fi
444454
fi
445455
done
446456
fi

Gluster-Halo/setupvm.config

+4-3
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,19 @@ POOLID="8a85f9833e1404a9013e3cddf99305e6"
2626
GFS_LIST="ip-172-18-4-140.ec2.internal:ip-172-18-4-188.ec2.internal:ip-172-18-14-160.ec2.internal"
2727

2828
# Volume Configuration
29-
PEER_PROBE=N
30-
CREATE_VOL=N
29+
PEER_PROBE=Y
30+
CREATE_VOL=Y
3131
GFS_DIR="/data/gluster/"
3232
GFS_VOLNAME="gv0"
3333
GFS_BRICK="brick"
34-
GFS_DEVICE="/dev/xvdb"
34+
GFS_DEVICE="/dev/xvdc"
3535
FUSE_BASE="/mnt/glusterfs-storage"
3636
REPLICA_COUNT=3
3737

3838
# OpenStack Swift
3939
INSTALL_SWIFT_LOCAL=Y
4040
INSTALL_SWIFT_REMOTE=Y
41+
ADD_SWIFT3=Y
4142

4243
# K8 Prereqs Docker, ETCD, Go
4344
INSTALL_PREREQ=N

lib/install-swift-local.sh

+19
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,24 @@ then
3232
# For security, add -U 0 to OPTIONS in /etc/sysconfig/memcached
3333
sed -i "s/OPTIONS=\"\"/OPTIONS=\"-U 0\"/" /etc/sysconfig/memcached
3434
systemctl restart memcached
35+
fi
36+
37+
if [ "$ADD_SWIFT3" == "Y" ]
38+
then
39+
wget https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.tar.gz --no-check-certificate
40+
tar xzf setuptools-7.0.tar.gz; cd setuptools-7.0
41+
python setup.py install
42+
wget https://bootstrap.pypa.io/get-pip.py
43+
python get-pip.py
44+
pip install --upgrade requests
3545

46+
git clone https://github.com/openstack/swift3; cd swift3/
47+
sed -i '1s/.*/ /' requirements.txt
48+
sed -i '3s/.*/ /' requirements.txt
49+
python setup.py install
3650
fi
51+
52+
# copy config files
53+
cd /opt/gluster-swift/conf
54+
cp account-server.conf container-server.conf proxy-server.conf object-server.conf /etc/swift/.
55+
cp webhook.py /usr/lib/python2.7/site-packages/swift/common/middleware/.

lib/install-swift-remote.sh

+39-24
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,50 @@
1-
#! /bin/bash
1+
echo "#! /bin/bash" > rmt-swift.sh
22

3-
if [ "$HOSTENV" == "rhel" ] && [ "$INSTALL_SWIFT" == "Y" ]
4-
then
5-
echo "...Remotely Installing OpenStack Swift and Clients"
63

7-
# enable full OSE repos for Swift
8-
echo "subscription-manager repos --enable=\"rhel-7-server-ose-$OCPVERSION-rpms\"> /dev/null" > rmt-swift.sh
4+
# enable full OSE repos for Swift
5+
echo "subscription-manager repos --enable=\"rhel-7-server-ose-$OCPVERSION-rpms\"> /dev/null" >> rmt-swift.sh
96

10-
echo "yum install openstack-swift-* -y> /dev/null" >> rmt-swift.sh
11-
echo "yum install python-scandir python-prettytable git -y> /dev/null" >> rmt-swift.sh
7+
echo "yum install openstack-swift-* -y> /dev/null" >> rmt-swift.sh
8+
echo "yum install python-scandir python-prettytable git -y> /dev/null" >> rmt-swift.sh
129

13-
echo "cd /opt" >> rmt-swift.sh
14-
echo "git clone https://github.com/gluster/gluster-swift" >> rmt-swift.sh
15-
echo "cd gluster-swift" >> rmt-swift.sh
16-
echo "python setup.py install" >> rmt-swift.sh
10+
echo "cd /opt" >> rmt-swift.sh
11+
echo "git clone https://github.com/gluster/gluster-swift" >> rmt-swift.sh
12+
echo "cd gluster-swift" >> rmt-swift.sh
13+
echo "python setup.py install" >> rmt-swift.sh
14+
15+
echo "mkdir -p /etc/swift/" >> rmt-swift.sh
16+
echo "cp etc/* /etc/swift/" >> rmt-swift.sh
17+
echo "cd /etc/swift" >> rmt-swift.sh
1718

18-
echo "mkdir -p /etc/swift/" >> rmt-swift.sh
19-
echo "cp etc/* /etc/swift/" >> rmt-swift.sh
20-
echo "cd /etc/swift" >> rmt-swift.sh
19+
echo "for tmpl in *.conf-gluster ; do cp \${tmpl} \${tmpl%.*}.conf; done" >> rmt-swift.sh
20+
echo "gluster-swift-gen-builders $GFS_VOLNAME" >> rmt-swift.sh
2121

22-
echo "for tmpl in *.conf-gluster ; do cp \${tmpl} \${tmpl%.*}.conf; done" >> rmt-swift.sh
23-
echo "gluster-swift-gen-builders $GFS_VOLNAME" >> rmt-swift.sh
22+
# Install swiftclient and memcached
23+
echo "yum install python-swiftclient memcached -y> /dev/null" >> rmt-swift.sh
2424

25-
# Install swiftclient and memcached
26-
echo "yum install python-swiftclient memcached -y> /dev/null" >> rmt-swift.sh
25+
echo "systemctl start memcached" >> rmt-swift.sh
26+
echo "systemctl enable memcached" >> rmt-swift.sh
2727

28-
echo "systemctl start memcached" >> rmt-swift.sh
29-
echo "systemctl enable memcached" >> rmt-swift.sh
28+
# For security, add -U 0 to OPTIONS in /etc/sysconfig/memcached
29+
echo "sed -i \"s/OPTIONS=\"\"/OPTIONS=\"-U 0\"/\" /etc/sysconfig/memcached" >> rmt-swift.sh
30+
echo "systemctl restart memcached" >> rmt-swift.sh
3031

31-
# For security, add -U 0 to OPTIONS in /etc/sysconfig/memcached
32-
echo "sed -i \"s/OPTIONS=\"\"/OPTIONS=\"-U 0\"/\" /etc/sysconfig/memcached" >> rmt-swift.sh
33-
echo "systemctl restart memcached" >> rmt-swift.sh
32+
if [ "$ADD_SWIFT3" == "Y" ]
33+
then
34+
echo "wget https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.tar.gz --no-check-certificate" >> rmt-swift.sh
35+
echo "tar xzf setuptools-7.0.tar.gz; cd setuptools-7.0" >> rmt-swift.sh
36+
echo "python setup.py install" >> rmt-swift.sh
37+
echo "wget https://bootstrap.pypa.io/get-pip.py" >> rmt-swift.sh
38+
echo "python get-pip.py" >> rmt-swift.sh
39+
echo "pip install --upgrade requests" >> rmt-swift.sh
3440

41+
echo "git clone https://github.com/openstack/swift3; cd swift3/" >> rmt-swift.sh
42+
echo "sed -i '1s/.*/ /' requirements.txt" >> rmt-swift.sh
43+
echo "sed -i '3s/.*/ /' requirements.txt" >> rmt-swift.sh
44+
echo "python setup.py install" >> rmt-swift.sh
3545
fi
46+
47+
# copy config files
48+
echo "cd /opt/gluster-swift/conf" >> rmt-swift.sh
49+
echo "cp account-server.conf container-server.conf proxy-server.conf object-server.conf /etc/swift/." >> rmt-swift.sh
50+
echo "cp webhook.py /usr/lib/python2.7/site-packages/swift/common/middleware/." >> rmt-swift.sh

0 commit comments

Comments
 (0)