recently, I created an app using the Edge Siemens ecosystem's App Publish tool, where the Docker Compose file includes several associated services. However, after deploying it on the Industrial Edge Device (IED), the service name connections don't seem to work as expected. The connection string for the database service (db_app) works fine on my local machine, but when the IED attempts to start the Docker Compose containers, all containers that rely on the database appear to be unable to locate the db_app host. This same Compose file works perfectly on my local machine, so it's not an issue with its configuration. That is some of log errors {"log":"Unhandled exception. MySqlConnector.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.\n","stream":"stderr","time":"2024-09-04T18:19:43.828146444Z"}{"log":" at MySqlConnector.Core.ServerSession.OpenTcpSocketAsync(ConnectionSettings cs, ILoadBalancer loadBalancer, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/ServerSession.cs:line 1146\n","stream":"stderr","time":"2024-09-04T18:19:43.828306356Z"} The . yml ... version: '2.4' networks: gate_network: driver: bridge services: nodelink: restart: always container_name: nodelink image: 'suportetse/nodelink:1.4.5-net6' environment: DATA_MODE: MySQL ConnectionStrings__default: Server=db_app;Port=3306;User=root;Password=admin;Database=serviceProd SignalClientSettings__Hub: hub SignalClientSettings__SignalURL: 'http://signalrhub:8080' depends_on: - signalrhub - db_app mem_limit: 500mb volumes: - './publish/:/publish/' - './cfg-data/:/cfg-data/' networks: - gate_network fabrica: restart: always container_name: fabrica image: 'suportetse/fabrica:1.5.7-net6' environment: DATA_MODE: MySQL ConnectionStrings__default: Server=db_app;Port=3306;User=root;Password=admin;Database=serviceProd SignalClientSettings__Hub: hub SignalClientSettings__SignalURL: 'http://signalrhub:8080' depends_on: - signalrhub - db_app mem_limit: 500mb volumes: - './publish/:/publish/' - './cfg-data/:/cfg-data/' networks: - gate_network signalrhub: restart: always container_name: signalrhub image: 'suportetse/signalrhub:1.0.3-net6' mem_limit: 500mb volumes: - './publish/:/publish/' - './cfg-data/:/cfg-data/' networks: - gate_network gateway: restart: always container_name: gateway ports: - '5000:8080' image: 'suportetse/gateway_hello_world-net6:latest' depends_on: - fabrica - nodelink - receitas - auth - signalrhub - db_app mem_limit: 500mb volumes: - './publish/:/publish/' - './cfg-data/:/cfg-data/' networks: - gate_network db_app: restart: always image: 'mariadb:latest' container_name: db_app environment: MARIADB_ROOT_PASSWORD: admin ports: - '7780:3306' volumes: - './mariadb_data:/var/lib/mysql' - './publish/:/publish/' - './cfg-data/:/cfg-data/' mem_limit: 700mb networks: - gate_network receitas: restart: always container_name: receitas image: 'suportetse/receitas:1.0.2-net6' environment: DATA_MODE: MySQL ConnectionStrings__default: Server=db_app;Port=3306;User=root;Password=admin;Database=serviceProd SignalClientSettings__Hub: hub SignalClientSettings__SignalURL: 'http://signalrhub:8080' ServicoExternoConfigurate__fabrica: 'http://fabrica:8080' depends_on: - signalrhub - db_app mem_limit: 500mb volumes: - './publish/:/publish/' - './cfg-data/:/cfg-data/' networks: - gate_network auth: restart: always container_name: auth image: 'suportetse/auth:1.5.3-net6' environment: DATA_MODE: MySQL ConnectionStrings__default: Server=db_app;Port=3306;User=root;Password=admin;Database=serviceProd SignalClientSettings__Hub: hub SignalClientSettings__SignalURL: 'http://signalrhub:8080' depends_on: - signalrhub - db_app mem_limit: 500mb volumes: - './publish/:/publish/' - './cfg-data/:/cfg-data/' networks: - gate_network
asked
Leonardo Machado
3 answers
0
Is there any configuration I might have missed to ensure that the services can see each other?
answered
Leonardo Machado
0
IE publisher 1.13.5
IEM Version 1.18.10
IED Version ied-os-1.8.0-6-amd64
answered
Leonardo Machado
0
Hi Leonardo,
please use "-" instead of "_" in the service name. So use "db-app" or simply just use "mariadbservice".
And I would recommend also to remove the container_name field. It is not necesarry and could cause some issues.
The problem is that the DNS resolution does not work properly with java when you use underscore.