2
2
set -e
3
3
set -x
4
4
5
- VERSION_URL=" http://versions.memsql.com/memsql-ops/5.1.0"
5
+ # Expects this file to export $OPS_VERSION and $MEMSQL_VERSION
6
+ source /tmp/VERSIONS
7
+
8
+ VERSION_URL=" http://versions.memsql.com/memsql-ops/$OPS_VERSION "
6
9
MEMSQL_VOLUME_PATH=" /memsql"
7
10
OPS_URL=$( curl -s " $VERSION_URL " | jq -r .tar)
8
11
@@ -20,16 +23,29 @@ mkdir /tmp/memsql-ops
20
23
tar -xzf /tmp/memsql_ops.tar.gz -C /tmp/memsql-ops --strip-components 1
21
24
/tmp/memsql-ops/install.sh \
22
25
--host 127.0.0.1 \
23
- --simple -cluster \
26
+ --no -cluster \
24
27
--ops-datadir /memsql-ops \
25
28
--memsql-installs-dir /memsql-ops/installs
26
29
30
+ DEPLOY_EXTRA_FLAGS=
31
+ if [[ $MEMSQL_VERSION != " community" ]]; then
32
+ DEPLOY_EXTRA_FLAGS=" --version-hash $MEMSQL_VERSION "
33
+ fi
34
+
35
+ memsql-ops memsql-deploy --role master --community-edition $DEPLOY_EXTRA_FLAGS
36
+ memsql-ops memsql-deploy --role leaf --community-edition --port 3307 $DEPLOY_EXTRA_FLAGS
37
+
27
38
MASTER_ID=$( memsql-ops memsql-list --memsql-role=master -q)
28
39
MASTER_PATH=$( memsql-ops memsql-path $MASTER_ID )
29
40
30
41
LEAF_ID=$( memsql-ops memsql-list --memsql-role=leaf -q)
31
42
LEAF_PATH=$( memsql-ops memsql-path $LEAF_ID )
32
43
44
+ # We need to clear the maximum-memory setting in the leaf's memsql.cnf otherwise
45
+ # when we move to another machine with a different amount of memory the memory
46
+ # imbalance nag will show up
47
+ memsql-ops memsql-update-config --key maximum_memory --delete $LEAF_ID
48
+
33
49
# symlink leaf's static directories to master
34
50
for tgt in objdir lib; do
35
51
rm -rf $LEAF_PATH /$tgt
0 commit comments