Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update broker settings #611

Merged
merged 7 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions build_data/broker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,22 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<broker useJmx="true" xmlns="http://activemq.apache.org/schema/core">

<broker id="broker" persistent="${activemq.broker.persistent}"
useJmx="true" xmlns="http://activemq.apache.org/schema/core"
dataDirectory="${activemq.base}" tmpDataDirectory="${activemq.base}/tmp"
startAsync="false" start="false" brokerName="${INSTANCE_STRING}">

<amq:persistenceAdapter>
<jdbcPersistenceAdapter dataDirectory="activemq-data"
dataSource="#postgres-ds" lockKeepAlivePeriod="0"/>
dataSource="#postgres-ds" lockKeepAlivePeriod="0" createTablesOnStartup="true"
brokerName="${INSTANCE_STRING}"/>
<statements useLockCreateWhereClause="true"
tablePrefix="ACTIVEMQ_"
dualCommitEnabled="false"
updateClob="true"
updateBlob="true"
lockKeepAlivePeriod="30000"/>
</amq:persistenceAdapter>

<bean id="postgres-ds" class="org.postgresql.ds.PGPoolingDataSource">
Expand Down
3 changes: 2 additions & 1 deletion build_data/embedded-broker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ activemq.jmx.createConnector=false
activemq.transportConnectors.server.uri=${BROKER_URL}?maximumConnections=1000&wireFormat.maxFrameSize=104857600&jms.useAsyncSend=true&transport.daemon=true&trace=true
activemq.transportConnectors.server.discoveryURI=multicast://default
activemq.broker.persistent=true
activemq.base=./
activemq.broker.systemUsage.memoryUsage=128 mb
activemq.broker.systemUsage.storeUsage=1 gb
activemq.broker.systemUsage.tempUsage=128 mb
activemq.broker.systemUsage.tempUsage=128 mb
4 changes: 4 additions & 0 deletions clustering/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ services:
- SSL_MODE=allow
- GEOSERVER_ADMIN_PASSWORD=myawesomegeoserver
- GEOSERVER_ADMIN_USER=admin
# prevent some errors the option below
#- ADDITIONAL_JAVA_STARTUP_OPTIONS="--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED"
restart: on-failure
depends_on:
db:
Expand Down Expand Up @@ -76,6 +78,8 @@ services:
- SSL_MODE=allow
- GEOSERVER_ADMIN_PASSWORD=myawesomegeoserver
- GEOSERVER_ADMIN_USER=admin
# prevent some errors the option below
#- ADDITIONAL_JAVA_STARTUP_OPTIONS="--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED"
restart: on-failure
depends_on:
master:
Expand Down
1 change: 1 addition & 0 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export GEOSERVER_OPTS="-Djava.awt.headless=true -server -Xms${INITIAL_MEMORY} -X
-DUPDATE_BUILT_IN_LOGGING_PROFILES=${UPDATE_LOGGING_PROFILES} \
-DRELINQUISH_LOG4J_CONTROL=${RELINQUISH_LOG4J_CONTROL} \
-DGEOSERVER_CONSOLE_DISABLED=${DISABLE_WEB_INTERFACE} \
-DGWC_DISKQUOTA_DISABLED=${DISKQUOTA_DISABLED} \
-DGEOSERVER_CSRF_WHITELIST=${CSRF_WHITELIST} \
-Dgeoserver.xframe.shouldSetPolicy=${XFRAME_OPTIONS} \
${ADDITIONAL_JAVA_STARTUP_OPTIONS} "
Expand Down
5 changes: 5 additions & 0 deletions scripts/env-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ if [ -z "${WMSC_ENABLED}" ]; then
WMSC_ENABLED=true
fi

if [ -z "${DISKQUOTA_DISABLED}" ]; then
DISKQUOTA_DISABLED=false
fi



if [ -z "${TMS_ENABLED}" ]; then
TMS_ENABLED=true
Expand Down
30 changes: 20 additions & 10 deletions scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ function cluster_config() {
# Helper function to setup broker config. Used with clustering configs
# https://docs.geoserver.org/stable/en/user/community/jms-cluster/index.html


function broker_config() {
# Delete default config
if [ -f "${CLUSTER_CONFIG_DIR}"/embedded-broker.properties ];then
Expand All @@ -254,12 +255,16 @@ function broker_config() {

if [[ ! -f ${CLUSTER_CONFIG_DIR}/embedded-broker.properties ]]; then
# If it doesn't exists, copy from /settings directory if exists
if [[ -f ${EXTRA_CONFIG_DIR}/embedded-broker.properties ]]; then
envsubst < "${EXTRA_CONFIG_DIR}"/embedded-broker.properties > "${CLUSTER_CONFIG_DIR}"/embedded-broker.properties
else
# default values
envsubst < /build_data/embedded-broker.properties > "${CLUSTER_CONFIG_DIR}"/embedded-broker.properties
fi

if [[ -f ${EXTRA_CONFIG_DIR}/embedded-broker.properties ]]; then
envsubst < "${EXTRA_CONFIG_DIR}"/embedded-broker.properties > "${CLUSTER_CONFIG_DIR}"/embedded-broker.properties
else
# default values
envsubst < /build_data/embedded-broker.properties > "${CLUSTER_CONFIG_DIR}"/embedded-broker.properties
fi



fi
}

Expand All @@ -276,10 +281,10 @@ function broker_xml_config() {
# default values
if [[ ${DB_BACKEND} =~ [Pp][Oo][Ss][Tt][Gg][Rr][Ee][Ss] ]]; then
envsubst < /build_data/broker.xml > "${CLUSTER_CONFIG_DIR}"/broker.xml
sed -i -e '11,13d' "${CLUSTER_CONFIG_DIR}"/broker.xml
sed -i -e '15,17d' "${CLUSTER_CONFIG_DIR}"/broker.xml
else
envsubst < /build_data/broker.xml > "${CLUSTER_CONFIG_DIR}"/broker.xml
sed -i -e '15,26d' "${CLUSTER_CONFIG_DIR}"/broker.xml
sed -i -e '19,37d' "${CLUSTER_CONFIG_DIR}"/broker.xml
fi
fi
fi
Expand Down Expand Up @@ -444,7 +449,12 @@ function set_vars() {
fi

INSTANCE_STRING="${RANDOM_STRING}"
CLUSTER_CONFIG_DIR="${GEOSERVER_DATA_DIR}/cluster/instance_${RANDOM_STRING}"
if [[ ${EMBEDDED_BROKER} == 'disabled' ]];then
CLUSTER_NAME=node
else
CLUSTER_NAME=master
fi
CLUSTER_CONFIG_DIR="${GEOSERVER_DATA_DIR}/cluster/${CLUSTER_NAME}/instance_${RANDOM_STRING}"
MONITOR_AUDIT_PATH="${GEOSERVER_DATA_DIR}/monitoring/monitor_${RANDOM_STRING}"
}

Expand Down Expand Up @@ -560,4 +570,4 @@ bboxLogLevel=no_wfs
EOF
fi

}
}
Loading