1 | #!/bin/bash
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | ydbver="r128"
|
8 | ydbversion="r1.28"
|
9 | platform="_x86_64"
|
10 |
|
11 | echo "Installing YottaDB $ydbversion"
|
12 |
|
13 |
|
14 | mkdir -p /tmp/tmp
|
15 | cd /tmp/tmp
|
16 | wget https://gitlab.com/YottaDB/DB/YDB/raw/master/sr_unix/ydbinstall.sh
|
17 | chmod +x ydbinstall.sh
|
18 |
|
19 | gtmroot=/usr/lib/yottadb
|
20 | gtmcurrent=$gtmroot/current
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 | mkdir -p $gtmcurrent
|
29 | ./ydbinstall.sh --utf8 default --verbose --debug --linkenv $gtmcurrent --linkexec $gtmcurrent --force-install $ydbversion
|
30 | echo "Configuring YottaDB $ydbversion"
|
31 |
|
32 | ls -l /usr/lib/yottadb/current
|
33 |
|
34 | gtmprof=$gtmcurrent/gtmprofile
|
35 | gtmprofcmd="source $gtmprof"
|
36 | $gtmprofcmd
|
37 | tmpfile=`mktemp`
|
38 |
|
39 | echo 'copying ' $gtmprofcmd ' to profile...'
|
40 | echo $gtmprofcmd >> ~/.profile
|
41 |
|
42 | rm $tmpfile
|
43 | unset tmpfile gtmprofcmd gtmprof gtmcurrent gtmroot
|
44 |
|
45 | cd /opt/qewd
|
46 | mkdir sessiondb
|
47 |
|
48 | echo 'Setting up local internal, unjournalled region for QEWD Session global'
|
49 | /usr/local/lib/yottadb/$ydbver/mumps -run ^GDE < /opt/qewd/gde.txt
|
50 | /usr/local/lib/yottadb/$ydbver/mupip create -region=qewdreg
|
51 | /usr/local/lib/yottadb/$ydbver/mupip set -file -nojournal /opt/qewd/sessiondb/qewd.dat
|
52 |
|
53 |
|
54 |
|
55 | svn export https://github.com/chrisemunt/mgsql/trunk/yottadb /opt/qewd/mgsql
|
56 | cp /opt/qewd/mgsql/* /root/.yottadb/$ydbversion$platform/r
|
57 | /usr/local/lib/yottadb/$ydbver/mumps -run ylink^%mgsql
|
58 | rm -r /opt/qewd/mgsql
|
59 |
|
60 | cp /opt/qewd/node_modules/qewd-mg-dbx/ci/qewd.ci /usr/local/lib/yottadb/$ydbver
|
61 | cp /opt/qewd/node_modules/qewd-mg-dbx/ci/qewdInterface.m /root/.yottadb/$ydbversion$platform/r
|
62 |
|
63 | echo 'mgsql has been installed'
|
64 | echo ' '
|
65 | echo 'YottaDB has been installed and configured, ready for use'
|
66 |
|
67 | cd /opt/qewd
|
68 |
|
69 |
|
70 |
|
71 | echo 'Installing NodeM'
|
72 |
|
73 | npm install nodem
|
74 |
|
75 | ln -sf $gtm_dist/libgtmshr.so /usr/local/lib/
|
76 | ldconfig
|
77 |
|
78 | base=/opt/qewd
|
79 | [ -f "$GTMCI" ] || export GTMCI="$(find $base -iname nodem.ci)"
|
80 | export ydb_ci="$(find $base -iname nodem.ci)"
|
81 | nodemgtmr="$(find $base -iname v4wnode.m | tail -n1 | xargs dirname)"
|
82 | echo "$gtmroutines" | fgrep "$nodemgtmr" || export gtmroutines="$nodemgtmr $gtmroutines"
|
83 |
|
84 |
|
85 | echo 'base=/opt/qewd' >> ~/.profile
|
86 | echo '[ -f "$GTMCI" ] || export GTMCI="$(find $base -iname nodem.ci)"' >> ~/.profile
|
87 | echo 'export ydb_ci="$(find $base -iname nodem.ci)"' >> ~/.profile
|
88 | echo 'nodemgtmr="$(find $base -iname v4wnode.m | tail -n1 | xargs dirname)"' >> ~/.profile
|
89 | echo 'echo "$gtmroutines" | fgrep "$nodemgtmr" || export gtmroutines="$nodemgtmr $gtmroutines"' >> ~/.profile
|