openzipkin-attic / docker-zipkin

Docker images for OpenZipkin
Apache License 2.0
688 stars 329 forks source link

Can't connect to mariadb #181

Closed vicmosin closed 6 years ago

vicmosin commented 6 years ago

Getting Caused by: java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=localhost)(port=3306)(type=master) : Connection refused (Connection refused) all the time while starting from docker-compose. Other services can access mariadb without any issues but there I set connection string explicitely via spring.datasource.url=jdbc:mariadb://127.0.0.1

Can it be an issue or something else?

codefromthecrypt commented 6 years ago

recently the driver has been updated.. which version image are you using for mariadb/mysql?

vicmosin commented 6 years ago

@adriancole Thanks for reply. Right now we use the latest one which 10.3

vicmosin commented 6 years ago

it's 10.2, I am sorry

codefromthecrypt commented 6 years ago

just looked.. our test image isn't mariadb it is mysql. We use mariadb as the client for license reasons. Latest java client is 2.2.3 which is only a couple patches below latest.

http://search.maven.org/remotecontent?filepath=io/zipkin/java/parent/2.9.4/parent-2.9.4.pom http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22mariadb-java-client%22

you could probably look to see if something between 2.2.3 and 2.2.5 is an issue that relates to this. We haven't heard others complaining. Meanwhile we can bump to latest maria client for the next zipkin release.

codefromthecrypt commented 6 years ago

https://mariadb.com/kb/en/library/about-mariadb-connector-j/#choosing-a-version talks about compatibility...

codefromthecrypt commented 6 years ago

this will attempt to help https://github.com/openzipkin/zipkin/pull/2120

vicmosin commented 6 years ago

Apparently it was a network mode issue.. By default it's bridge so it was in isolated network. With host mode it works :) Thanks

codefromthecrypt commented 6 years ago

ok great: thanks for the tip. by the way 2.10.0 is out momentarily anyway

jcchavezs commented 6 years ago

@vicmosin what in documentation would prehent this issue to happen to you? Would you add something in docs related to this?

vicmosin commented 6 years ago

@jcchavezs I would just put some small notice that in case of using dockerized zipkin and host-based datasource it won't work because of docker's default network mode set to bridge. I.e. zipkin won't be able to connect to datasource since it's in the isolated network. Possible solutions are either use --link feature of docker or change network mode to host.

jcchavezs commented 6 years ago

Nice would you open a PR with that tweak?

Den lør. 7. jul. 2018, 13:47 skrev Victor Mosin notifications@github.com:

@jcchavezs https://github.com/jcchavezs I would just put some small notice that in case of using dockerized zipkin and host-based datasource it won't work because of docker's default network mode set to bridge. I.e. zipkin won't be able to connect to datasource since it's in the isolated network. Possible solutions are either use --link feature of docker or change network mode to host.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/openzipkin/docker-zipkin/issues/181#issuecomment-403210149, or mute the thread https://github.com/notifications/unsubscribe-auth/AC7sAjYSVjww_LA0j2J1Uiy3MXPoORRCks5uEJ_RgaJpZM4U_L_q .

--

José Carlos

hessam-shm commented 5 years ago

I have the same problem with mariadb-java-client:2.3.0

codefromthecrypt commented 5 years ago

make sure you uncommented this

https://github.com/openzipkin/docker-zipkin/blob/master/docker-compose.yml#L17

please don't reply to old issues as it spams people with unrelated problems. if you need further support use gitter https://gitter.im/openzipkin/zipkin