-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathlaunch
executable file
·37 lines (32 loc) · 1.75 KB
/
launch
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
#!/usr/bin/env bash
#
# Copyright 2016 Confluent Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# JMX settings
if [ -z "$SCHEMA_REGISTRY_JMX_OPTS" ]; then
SCHEMA_REGISTRY_JMX_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false "
fi
# The JMX client needs to be able to connect to java.rmi.server.hostname.
# The default for bridged n/w is the bridged IP so you will only be able to connect from another docker container.
# For host n/w, this is the IP that the hostname on the host resolves to.
# If you have more that one n/w configured, hostname -i gives you all the IPs,
# the default is to pick the first IP (or network).
export SCHEMA_REGISTRY_JMX_HOSTNAME=${SCHEMA_REGISTRY_JMX_HOSTNAME:-$(hostname -i | cut -d" " -f1)}
# JMX port to use
if [ $SCHEMA_REGISTRY_JMX_PORT ]; then
export JMX_PORT=$SCHEMA_REGISTRY_JMX_PORT
export SCHEMA_REGISTRY_JMX_OPTS="$SCHEMA_REGISTRY_JMX_OPTS -Djava.rmi.server.hostname=$SCHEMA_REGISTRY_JMX_HOSTNAME -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.rmi.port=$JMX_PORT -Dcom.sun.management.jmxremote.port=$JMX_PORT"
fi
echo "===> Launching ${COMPONENT} ... "
exec "${COMPONENT}"-start /etc/"${COMPONENT}"/"${COMPONENT}".properties