-
Notifications
You must be signed in to change notification settings - Fork 1
/
start-hazelcast.sh
executable file
·45 lines (36 loc) · 1.36 KB
/
start-hazelcast.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
#!/bin/bash
set -euo pipefail
eval JAVA_OPTS=\"${JAVA_OPTS}\"
eval CLASSPATH=\"${CLASSPATH}\"
eval MAIN_CLASS=${MAIN_CLASS}
if [ -n "${CLASSPATH}" ]; then
export CLASSPATH="${CLASSPATH_DEFAULT}:${CLASSPATH}"
else
export CLASSPATH="${CLASSPATH_DEFAULT}"
fi
if [ -n "${JAVA_OPTS}" ]; then
export JAVA_OPTS="${JAVA_OPTS_DEFAULT} ${JAVA_OPTS}"
else
export JAVA_OPTS="${JAVA_OPTS_DEFAULT}"
fi
if ! [ -n "${MAIN_CLASS}" ]; then
export MAIN_CLASS=com.hazelcast.core.server.HazelcastMemberStarter
fi
if [ -n "${PROMETHEUS_PORT}" ]; then
export JAVA_OPTS="-javaagent:${HZ_HOME}/lib/jmx_prometheus_javaagent.jar=${PROMETHEUS_PORT}:${PROMETHEUS_CONFIG} ${JAVA_OPTS}"
fi
if [ -z "${LOGGING_LEVEL}" ]; then
export LOGGING_LEVEL=INFO
fi
if [ "$(arch)" == "s390x" ]; then
export LOGGING_PATTERN="%d [%highlight{\${LOG_LEVEL_PATTERN:-%5p}}{FATAL=red, ERROR=red, WARN=yellow, INFO=green, DEBUG=magenta}][%style{%t{1.}}{cyan}] [%style{%-10c}{blue}]: %m%n"
else
export LOGGING_PATTERN="%d [%highlight{\${LOG_LEVEL_PATTERN:-%5p}}{FATAL=red, ERROR=red, WARN=yellow, INFO=green, DEBUG=magenta}] [%style{%t{1.}}{cyan}] [%style{%c{1.}}{blue}]: %m%n"
fi
echo "########################################"
echo "# JAVA_OPTS=${JAVA_OPTS}"
echo "# CLASSPATH=${CLASSPATH}"
echo "# starting now...."
echo "########################################"
set -x
exec java -server ${JAVA_OPTS} ${MAIN_CLASS}