Commit 62dc2adb authored by Peter Rafaj's avatar Peter Rafaj

IOT-3244 configurable JMX_HOSTNAME

Change-Id: I707c2db52492f7585aed307f3a47c6e14824c0b3
Signed-off-by: default avatarPeter Rafaj <peter.rafaj@kistler.com>
parent a2b078f2
......@@ -2,11 +2,16 @@ FROM openjdk:8-jre-alpine
RUN apk add --update \
curl \
shadow \
&& rm -rf /var/cache/apk/*
ADD ./target/CloudAccount-0.0.1-SNAPSHOT.jar iotivity/AccountServer.jar
ADD ./target/lib/* iotivity/lib/
ADD ./properties/* iotivity/properties/
RUN groupadd -r iotivity && useradd --no-log-init --system -g iotivity iotivity
COPY --chown=iotivity:iotivity ./target/CloudAccount-0.0.1-SNAPSHOT.jar iotivity/AccountServer.jar
COPY --chown=iotivity:iotivity ./target/lib/* iotivity/lib/
COPY --chown=iotivity:iotivity ./properties/* iotivity/properties/
COPY --chown=iotivity:iotivity ./start.sh iotivity/
RUN chmod +x iotivity/start.sh
WORKDIR iotivity/
......@@ -18,17 +23,11 @@ ENV MONGODB_PORT 27017
ENV JMX_PORT 9002
ENV JAVA_JMX_OPTS "-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=${JMX_PORT} \
-Dcom.sun.management.jmxremote.rmi.port=${JMX_PORT} \
-Dcom.sun.management.jmxremote.local.only=false \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
-Djava.rmi.server.hostname= \
-XX:MetaspaceSize=30m -XX:MaxMetaspaceSize=40m \
-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -server "
ENV JMX_HOSTNAME ""
ENV JAVA_MEMORY_OPTS ""
EXPOSE 9002
ENTRYPOINT exec java $JAVA_JMX_OPTS $JAVA_MEMORY_OPTS -jar AccountServer.jar
HEALTHCHECK --interval=30s --timeout=2s --retries=3 CMD curl -f http://localhost/api/healthcheck || exit 1
USER iotivity
ENTRYPOINT [ "./start.sh" ]
HEALTHCHECK --interval=30s --timeout=2s --retries=3 CMD curl -f http://localhost:8000/api/healthcheck || exit 1
......@@ -94,7 +94,7 @@ public class AccountServer {
new CoapServer(new InetSocketAddress(coapServerPort)));
if(healthCheckEnabled){
serverSystem.addServer(new SimpleHttpServer(new InetSocketAddress(80),healthHolder));
serverSystem.addServer(new SimpleHttpServer(new InetSocketAddress(8000),healthHolder));
}
serverSystem.startSystem(tlsMode);
......
#!/bin/sh
JAVA_OPTS="$JAVA_OPTS "
if [ ! -z "$JAVA_MEMORY_OPTS" ]; then
JAVA_OPTS="$JAVA_OPTS $JAVA_MEMORY_OPTS"
fi
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=${JMX_PORT} "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.rmi.port=${JMX_PORT} "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.local.only=false "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false "
if [ ! -z "$JMX_HOSTNAME" ]; then
JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=${JMX_HOSTNAME} "
fi
JAVA_OPTS="$JAVA_OPTS -XX:MetaspaceSize=30m "
JAVA_OPTS="$JAVA_OPTS -XX:MaxMetaspaceSize=40m "
JAVA_OPTS="$JAVA_OPTS -XX:+UseG1GC "
JAVA_OPTS="$JAVA_OPTS -XX:MaxGCPauseMillis=100 "
JAVA_OPTS="$JAVA_OPTS -server "
export JAVA_OPTS
echo "Start Account server service with option: ${JAVA_OPTS}"
exec java $JAVA_OPTS -jar AccountServer.jar
FROM openjdk:8-jre-alpine
ADD ./target/CloudInterface-0.0.1-SNAPSHOT.jar iotivity/CloudInterface.jar
ADD ./target/lib/* iotivity/lib/
RUN apk add --update \
shadow \
&& rm -rf /var/cache/apk/*
RUN groupadd -r iotivity && useradd --no-log-init --system -g iotivity iotivity
COPY --chown=iotivity:iotivity ./target/CloudInterface-0.0.1-SNAPSHOT.jar iotivity/CloudInterface.jar
COPY --chown=iotivity:iotivity ./target/lib/* iotivity/lib/
COPY --chown=iotivity:iotivity ./start.sh iotivity/
WORKDIR iotivity/
......@@ -17,16 +24,10 @@ ENV ACCOUNT_SERVER_ADDRESS iotivity-accountserver
ENV ACCOUNT_SERVER_PORT 5685
ENV JMX_PORT 9001
ENV JAVA_JMX_OPTS "-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=${JMX_PORT} \
-Dcom.sun.management.jmxremote.rmi.port=${JMX_PORT} \
-Dcom.sun.management.jmxremote.local.only=false \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
-Djava.rmi.server.hostname= \
-XX:MetaspaceSize=20m -XX:MaxMetaspaceSize=25m \
-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -server "
ENV JMX_HOSTNAME ""
ENV JAVA_MEMORY_OPTS ""
EXPOSE 9001
ENTRYPOINT exec java $JAVA_JMX_OPTS $JAVA_MEMORY_OPTS -jar CloudInterface.jar
USER iotivity
ENTRYPOINT [ "./start.sh" ]
#!/bin/sh
JAVA_OPTS="$JAVA_OPTS "
if [ ! -z "$JAVA_MEMORY_OPTS" ]; then
JAVA_OPTS="$JAVA_OPTS $JAVA_MEMORY_OPTS"
fi
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=${JMX_PORT} "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.rmi.port=${JMX_PORT} "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.local.only=false "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false "
if [ ! -z "$JMX_HOSTNAME" ]; then
JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=${JMX_HOSTNAME} "
fi
JAVA_OPTS="$JAVA_OPTS -XX:MetaspaceSize=20m "
JAVA_OPTS="$JAVA_OPTS -XX:MaxMetaspaceSize=30m "
JAVA_OPTS="$JAVA_OPTS -XX:+UseG1GC "
JAVA_OPTS="$JAVA_OPTS -XX:MaxGCPauseMillis=100 "
JAVA_OPTS="$JAVA_OPTS -server "
export JAVA_OPTS
echo "Start Interface service with option: ${JAVA_OPTS}"
exec java $JAVA_OPTS -jar CloudInterface.jar
FROM openjdk:8-jre-alpine
ADD ./target/CloudMessageQueue-0.0.1-SNAPSHOT.jar iotivity/MessageQueue.jar
ADD ./target/lib/* iotivity/lib/
RUN apk add --update \
shadow \
&& rm -rf /var/cache/apk/*
RUN groupadd -r iotivity && useradd --no-log-init --system -g iotivity iotivity
COPY --chown=iotivity:iotivity ./target/CloudMessageQueue-0.0.1-SNAPSHOT.jar iotivity/MessageQueue.jar
COPY --chown=iotivity:iotivity ./target/lib/* iotivity/lib/
COPY --chown=iotivity:iotivity ./start.sh iotivity/
WORKDIR iotivity/
......@@ -13,16 +20,11 @@ ENV KAFKA_ADDRESS kafka-zookeeper
ENV KAFKA_PORT 9092
ENV JMX_PORT 9003
ENV JAVA_JMX_OPTS "-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=${JMX_PORT} \
-Dcom.sun.management.jmxremote.rmi.port=${JMX_PORT} \
-Dcom.sun.management.jmxremote.local.only=false \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
-Djava.rmi.server.hostname= \
-XX:MetaspaceSize=20m -XX:MaxMetaspaceSize=25m \
-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -server "
ENV JMX_HOSTNAME ""
ENV JAVA_MEMORY_OPTS ""
EXPOSE 9003
ENTRYPOINT exec java $JAVA_JMX_OPTS $JAVA_MEMORY_OPTS -jar MessageQueue.jar
USER iotivity
ENTRYPOINT [ "./start.sh" ]
#!/bin/sh
JAVA_OPTS="$JAVA_OPTS "
if [ ! -z "$JAVA_MEMORY_OPTS" ]; then
JAVA_OPTS="$JAVA_OPTS $JAVA_MEMORY_OPTS"
fi
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=${JMX_PORT} "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.rmi.port=${JMX_PORT} "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.local.only=false "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false "
if [ ! -z "$JMX_HOSTNAME" ]; then
JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=${JMX_HOSTNAME} "
fi
JAVA_OPTS="$JAVA_OPTS -XX:MetaspaceSize=20m "
JAVA_OPTS="$JAVA_OPTS -XX:MaxMetaspaceSize=30m "
JAVA_OPTS="$JAVA_OPTS -XX:+UseG1GC "
JAVA_OPTS="$JAVA_OPTS -XX:MaxGCPauseMillis=100 "
JAVA_OPTS="$JAVA_OPTS -server "
export JAVA_OPTS
echo "Start Message queue service with option: ${JAVA_OPTS}"
exec java $JAVA_OPTS -jar MessageQueue.jar
......@@ -2,10 +2,14 @@ FROM openjdk:8-jre-alpine
RUN apk add --update \
curl \
shadow \
&& rm -rf /var/cache/apk/*
ADD ./target/CloudResourceDirectory-0.0.1-SNAPSHOT.jar iotivity/ResourceDirectory.jar
ADD ./target/lib/* iotivity/lib/
RUN groupadd -r iotivity && useradd --no-log-init --system -g iotivity iotivity
COPY --chown=iotivity:iotivity ./target/CloudResourceDirectory-0.0.1-SNAPSHOT.jar iotivity/ResourceDirectory.jar
COPY --chown=iotivity:iotivity ./target/lib/* iotivity/lib/
COPY --chown=iotivity:iotivity ./start.sh iotivity/
WORKDIR iotivity/
......@@ -16,17 +20,11 @@ ENV MONGODB_ADDRESS mongodb
ENV MONGODB_PORT 27017
ENV JMX_PORT 9004
ENV JAVA_JMX_OPTS "-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=${JMX_PORT} \
-Dcom.sun.management.jmxremote.rmi.port=${JMX_PORT} \
-Dcom.sun.management.jmxremote.local.only=false \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
-Djava.rmi.server.hostname= \
-XX:MetaspaceSize=20m -XX:MaxMetaspaceSize=25m \
-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -server "
ENV JMX_HOSTNAME ""
ENV JAVA_MEMORY_OPTS ""
EXPOSE 9004
ENTRYPOINT exec java $JAVA_JMX_OPTS $JAVA_MEMORY_OPTS -jar ResourceDirectory.jar
HEALTHCHECK --interval=30s --timeout=2s --retries=3 CMD curl -f http://localhost/api/healthcheck || exit 1
USER iotivity
ENTRYPOINT [ "./start.sh" ]
HEALTHCHECK --interval=30s --timeout=2s --retries=3 CMD curl -f http://localhost:8000/api/healthcheck || exit 1
\ No newline at end of file
......@@ -74,7 +74,7 @@ public class ResourceDirectoryServer {
new CoapServer(new InetSocketAddress(coapServerPort)));
if(healthCheckEnabled){
serverSystem.addServer(new SimpleHttpServer(new InetSocketAddress(80),healthHolder));
serverSystem.addServer(new SimpleHttpServer(new InetSocketAddress(8000),healthHolder));
}
serverSystem.startSystem(tlsMode);
......
#!/bin/sh
JAVA_OPTS="$JAVA_OPTS "
if [ ! -z "$JAVA_MEMORY_OPTS" ]; then
JAVA_OPTS="$JAVA_OPTS $JAVA_MEMORY_OPTS"
fi
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=${JMX_PORT} "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.rmi.port=${JMX_PORT} "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.local.only=false "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false "
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false "
if [ ! -z "$JMX_HOSTNAME" ]; then
JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=${JMX_HOSTNAME} "
fi
JAVA_OPTS="$JAVA_OPTS -XX:MetaspaceSize=20m "
JAVA_OPTS="$JAVA_OPTS -XX:MaxMetaspaceSize=30m "
JAVA_OPTS="$JAVA_OPTS -XX:+UseG1GC "
JAVA_OPTS="$JAVA_OPTS -XX:MaxGCPauseMillis=100 "
JAVA_OPTS="$JAVA_OPTS -server "
export JAVA_OPTS
echo "Start resource directory service with option: ${JAVA_OPTS}"
exec java $JAVA_OPTS -jar ResourceDirectory.jar
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment