Details
-
Type: Monitor
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: 2021
-
Component/s: FIWARE-TECH-HELP
-
Labels:
Description
Created question in FIWARE Q/A platform on 20-01-2021 at 18:01
Please, ANSWER this question AT https://stackoverflow.com/questions/65814811/scorpio-broker-environment-variables-set-in-docker-compose-aaio-yml-not-gettin
Question:
Scorpio broker - environment variables set in docker-compose-aaio.yml not getting picked up at runtime
Description:
I am running Scorpio using the docker-compose file: docker-compose-aaio.yml but I want to use an RDS postgres instance rather than a container instance. I have updated the docker-compose-aaio.yml file as follows:
version: '3'
services:
zookeeper:
image: zookeeper
ports:
- "2181"
kafka:
image: wurstmeister/kafka
hostname: kafka
ports: - "9092"
environment:
KAFKA_ADVERTISED_HOST_NAME: kafka
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_PORT: 9092
volumes: - /var/run/docker.sock:/var/run/docker.sock
depends_on: - zookeeper
logging:
driver: none
scorpio:
image: scorpiobroker/scorpio:scorpio-aaio_1.0.2
ports: - "9090:9090"
depends_on: - kafka
environment:
spring_args: --maxLimit=1000 --reader.datasource.hikari.url=jdbc:postgresql//myrdshost.eu-west-2.rds.amazonaws.com:5432/ngb?ApplicationName=ngb_storagemanager_reader --writer.datasource.hikari.url=jdbc:postgresql//myrdshost.eu-west-2.rds.amazonaws.com:5432/ngb?ApplicationName=ngb_storagemanager_writer
However when I run this with: docker-compose -f docker-compose-aaio.yml up I get this error:
java.net.UnknownHostException: postgres
as though the Scorpio broker is still trying to use the default postgres database urls (i.e trying to use a containerised postgres instance). It's seems like the environment variables I set under spring_args are not getting applied.
I have followed the documentation in Chapters 4 and 5 here: https://scorpio.readthedocs.io/_/downloads/en/latest/pdf/.
Can you see anything I am doing wrong?
Thanks!
Activity
- All
- Comments
- History
- Activity
- Transitions