eventuate-foundation / eventuate-cdc

Other
71 stars 31 forks source link

If CDC service cannot connect to database, it hangs on startup #45

Open cer opened 4 years ago

cer commented 4 years ago

For example: SPRING_DATASOURCE_URL: jdbc:mysql://localhost:3306/eventuate

This is the tail of the log:

2020-04-15 02:46:33.057  INFO 7 --- [           main] i.e.l.u.c.p.CdcPipelineConfigurator      : Starting unified cdc pipelines
2020-04-15 02:46:33.107  INFO 7 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2020-04-15 02:46:33.341  INFO 7 --- [ad | producer-1] org.apache.kafka.clients.Metadata        : [Producer clientId=producer-1] Cluster ID: Or4s_vuBT5KqNMumhvq9Eg

Note: HikariPool-1 - Starting...

From this point on, there are no further log entries and the health check endpoint fails:

$ curl -v http://localhost:8099/actuator/health
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8099 (#0)
> GET /actuator/health HTTP/1.1
> Host: localhost:8099
> User-Agent: curl/7.64.1
> Accept: */*
>
* Empty reply from server
* Connection #0 to host localhost left intact
curl: (52) Empty reply from server
* Closing connection 0

The container is unhealthy but can't tell you why.

Not sure what to do? Initialize everything in the background?

muradhajiyev commented 3 years ago

what might be the reason to not connect to the database? I've faced this problem. Can't figure it out.

dartartem commented 3 years ago

Is there any configuration (e.g. docker-compose file) that could help investigate the issue?

muradhajiyev commented 3 years ago

@dartartem Thanks for the quick response. Since I have copied and pasted cdc-service from example projects, I just found out that the cdc-service was not on the same network with my MySQL. I just added

    networks:
      - my-network

to CDC service. It worked.