2.1.1 Updates
* Update psql-app container to use MEM for heap setting This fixes issue where psql-app would run out of memory * Update psql-app container to restart psql consumer if if stops. This handles restart on out of memory exit.
This commit is contained in:
parent
0a0d2ceec1
commit
c5f3d6ef59
@ -100,7 +100,7 @@ services:
|
|||||||
psql-app:
|
psql-app:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
container_name: obmp-psql-app
|
container_name: obmp-psql-app
|
||||||
image: openbmp/psql-app:2.1.0
|
image: openbmp/psql-app:2.1.1
|
||||||
sysctls:
|
sysctls:
|
||||||
- net.ipv4.tcp_keepalive_intvl=30
|
- net.ipv4.tcp_keepalive_intvl=30
|
||||||
- net.ipv4.tcp_keepalive_probes=5
|
- net.ipv4.tcp_keepalive_probes=5
|
||||||
@ -111,7 +111,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ${OBMP_DATA_ROOT}/config:/config
|
- ${OBMP_DATA_ROOT}/config:/config
|
||||||
environment:
|
environment:
|
||||||
- MEM=4 # Set memory to at least 2GB but ideally 4GB
|
- MEM=3 # Set memory to at least 2GB but ideally 4GB
|
||||||
- KAFKA_FQDN=obmp-kafka:29092
|
- KAFKA_FQDN=obmp-kafka:29092
|
||||||
- RPKI_URL=https://rpki.cloudflare.com/rpki.json # define the URL to retrieve json endoed RPKI data
|
- RPKI_URL=https://rpki.cloudflare.com/rpki.json # define the URL to retrieve json endoed RPKI data
|
||||||
- RPKI_PASS=None
|
- RPKI_PASS=None
|
||||||
|
|||||||
@ -17,8 +17,8 @@
|
|||||||
# Example docker build:
|
# Example docker build:
|
||||||
# tar -c -C ../../ ./obmp-psql ./obmp-docker/psql-app ./obmp-java-api-message \
|
# tar -c -C ../../ ./obmp-psql ./obmp-docker/psql-app ./obmp-java-api-message \
|
||||||
# | docker buildx build --platform linux/amd64 --progress=plain \
|
# | docker buildx build --platform linux/amd64 --progress=plain \
|
||||||
# --build-arg VERSION=2.1.0 \
|
# --build-arg VERSION=2.1.1 \
|
||||||
# -f obmp-docker/psql-app/Dockerfile -t openbmp/psql-app:2.1.0 -
|
# -f obmp-docker/psql-app/Dockerfile -t openbmp/psql-app:2.1.1 -
|
||||||
|
|
||||||
# -----------------------------------------------
|
# -----------------------------------------------
|
||||||
# stage: Build
|
# stage: Build
|
||||||
|
|||||||
@ -209,11 +209,7 @@ run_consumer() {
|
|||||||
sed -i -e "s/\([ ]*ssl_mode[ ]*:\)\(.*\)/\1 \"${POSTGRES_SSL_MODE}\"/" /config/obmp-psql.yml
|
sed -i -e "s/\([ ]*ssl_mode[ ]*:\)\(.*\)/\1 \"${POSTGRES_SSL_MODE}\"/" /config/obmp-psql.yml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $MEM -gt 20 ]]; then
|
heap_mem=${MEM}G
|
||||||
heap_mem="3g"
|
|
||||||
else
|
|
||||||
heap_mem="1536m"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Run
|
# Run
|
||||||
cd /var/log
|
cd /var/log
|
||||||
@ -275,7 +271,13 @@ run_consumer
|
|||||||
echo "===> Now running!!!"
|
echo "===> Now running!!!"
|
||||||
|
|
||||||
while [ 1 ]; do
|
while [ 1 ]; do
|
||||||
sleep 1800
|
sleep 300
|
||||||
|
pgrep -f obmp-psql-consumer.jar >/dev/null 2>&1
|
||||||
|
if [[ $? != 0 ]]; then
|
||||||
|
echo "PSQL consumer is not running, restarting in 30 seconds"
|
||||||
|
cat /var/log/psql-console.log
|
||||||
|
sleep 30
|
||||||
|
run_consumer
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user