From fd2874d00e381ab9cf115a7051c86bb08b1a6493 Mon Sep 17 00:00:00 2001 From: Tim Evens Date: Tue, 1 Feb 2022 12:49:17 -0800 Subject: [PATCH] Fix for collector kafka startup issue When first deploying the collector and kafka, it takes kafka a couple minutes to start. In some cases, the collector would proceed to startup without waiting for kafka. This resulted in the first few messages to be dropped, such as dropping the router init and peer up messages. --- collector/Dockerfile | 4 ++-- collector/scripts/run | 7 ++++++- docker-compose.yml | 6 +++--- postgres/Dockerfile | 2 +- psql-app/Dockerfile | 4 ++-- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/collector/Dockerfile b/collector/Dockerfile index dd958bd..1b3c4e9 100644 --- a/collector/Dockerfile +++ b/collector/Dockerfile @@ -15,8 +15,8 @@ # # Example docker build: # tar -cL -C ../../ ./obmp-collector ./obmp-docker/collector \ -# | docker build --build-arg VERSION=2.0.2 \ -# -f obmp-docker/collector/Dockerfile -t openbmp/collector:2.0.2 - +# | docker build --build-arg VERSION=2.0.3 \ +# -f obmp-docker/collector/Dockerfile -t openbmp/collector:2.0.3 - # # ----------------------------------------------- diff --git a/collector/scripts/run b/collector/scripts/run index 8e667d8..7525c04 100755 --- a/collector/scripts/run +++ b/collector/scripts/run @@ -60,6 +60,11 @@ if [[ -f /config/openbmpd.conf ]]; then OPENBMP_CFG_FILE=/config/openbmpd.conf fi +# Startup delay to allow for Kafka to start if not already running +ehco "Waiting 30 seconds to allow for Kafka and other containers to startup." +sleep 30 + # Start openbmpd and wait - openbmpd runs in foreground + echo "Running openbmpd collector, see /var/log/openbmpd.log " -/usr/bin/openbmpd -f -l /var/log/openbmpd.log -c ${OPENBMP_CFG_FILE} \ No newline at end of file +/usr/bin/openbmpd -f -l /var/log/openbmpd.log -c ${OPENBMP_CFG_FILE} diff --git a/docker-compose.yml b/docker-compose.yml index 4d7f77e..ed298b2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -63,7 +63,7 @@ services: psql: restart: unless-stopped container_name: obmp-psql - image: openbmp/postgres:2.0.2 + image: openbmp/postgres:2.0.3 ports: - 5432:5432 volumes: @@ -78,7 +78,7 @@ services: collector: restart: unless-stopped container_name: obmp-collector - image: openbmp/collector:2.0.2 + image: openbmp/collector:2.0.3 sysctls: - net.ipv4.tcp_keepalive_intvl=30 - net.ipv4.tcp_keepalive_probes=5 @@ -93,7 +93,7 @@ services: psql-app: restart: unless-stopped container_name: obmp-psql-app - image: openbmp/psql-app:2.0.2 + image: openbmp/psql-app:2.0.3 sysctls: - net.ipv4.tcp_keepalive_intvl=30 - net.ipv4.tcp_keepalive_probes=5 diff --git a/postgres/Dockerfile b/postgres/Dockerfile index a0d5a0f..e243b22 100644 --- a/postgres/Dockerfile +++ b/postgres/Dockerfile @@ -3,7 +3,7 @@ # Copyright (c) 2021-2022 Cisco Systems, Inc. and Tim Evens. All rights reserved. # # Build: -# docker build -t openbmp/postgres:2.0.2 . +# docker build -t openbmp/postgres:2.0.3 . # # Run: # docker run --rm -it -p 5432:5432 \ diff --git a/psql-app/Dockerfile b/psql-app/Dockerfile index fb555d9..d4b36a6 100644 --- a/psql-app/Dockerfile +++ b/psql-app/Dockerfile @@ -13,8 +13,8 @@ # # Example docker build: # tar -cL -C ../../ ./obmp-psql ./obmp-docker/psql-app ./obmp-java-api-message \ -# | docker build --build-arg VERSION=2.0.2 \ -# -f obmp-docker/psql-app/Dockerfile -t openbmp/psql-app:2.0.2 - +# | docker build --build-arg VERSION=2.0.3 \ +# -f obmp-docker/psql-app/Dockerfile -t openbmp/psql-app:2.0.3 - # ----------------------------------------------- # stage: Build