-
Notifications
You must be signed in to change notification settings - Fork 79
/
run.sh
executable file
·73 lines (61 loc) · 1.67 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env bash
if [ ! -z $BUILD ]; then
./build.sh
fi
if [ -z $WORK_DIR ];then
WORK_DIR="app"
if [ ! -d $WORK_DIR ]; then
./build.sh
fi
fi
if [ -z $NODE ]; then
NODE="node_$HOSTNAME"
fi
if [ -z $PORT ]; then
PORT=8080
fi
if [ -z $DISTRIBUTED ]; then
DISTRIBUTED=false
fi
if [ -z $MAX_MEMORY ]; then
if [ $DISTRIBUTED ];
then
MAX_MEMORY="4096m"
else
MAX_MEMORY="2048m"
fi
fi
if [ -z $MAX_DIRECT_MEMORY ]; then
MAX_DIRECT_MEMORY="512g"
fi
if [ -z $LOADER_LOCAL_REPOSITORY ]; then
LOADER_LOCAL_REPOSITORY="~/.m2/repository"
fi
if [ "$DOCKER_SWARM" = true ];
then
if [ -z $HAZELCAST_PUBLIC_ADRESS ]; then
HAZELCAST_PUBLIC_ADRESS="$HOSTNAME:5701"
fi
JAVA_OPTS="$JAVA_OPTS -Dorientdb.ip.address=$HOSTNAME -Dhazelcast.local.publicAddress=$HAZELCAST_PUBLIC_ADRESS"
else
if [ ! -z $HAZELCAST_PUBLIC_ADRESS ]; then
JAVA_OPTS="$JAVA_OPTS -Dhazelcast.local.publicAddress=$HAZELCAST_PUBLIC_ADRESS"
fi
if [ ! -z $ORIENTDB_PUBLIC_ADDRESS ]; then
JAVA_OPTS="$JAVA_OPTS -Dorientdb.ip.address=$ORIENTDB_PUBLIC_ADDRESS"
fi
fi
mkdir -p $WORK_DIR/runtime/$NODE
cd $WORK_DIR
java -server \
-DORIENTDB_HOME=runtime/$NODE \
-Dorientdb.url="plocal:runtime/$NODE/databases/Orienteer" \
-Dorientdb.remote.url=remote:localhost/Orienteer \
-Dorientdb.distributed=$DISTRIBUTED \
-Dorientdb.node.name=$NODE \
-Dorienteer.loader.repository.local=$LOADER_LOCAL_REPOSITORY \
-Dorienteer.loader.libs.folder=runtime/$NODE/libs \
$JAVA_OPTS \
-Xmx$MAX_MEMORY \
-XX:MaxDirectMemorySize=$MAX_DIRECT_MEMORY \
-jar jetty-runner.jar --port $PORT orienteer.war