pinpoint-apm / pinpoint

APM, (Application Performance Management) tool for large-scale distributed systems.
https://pinpoint-apm.gitbook.io/
Apache License 2.0
13.36k stars 3.75k forks source link

Why PersistenceException #11238

Open Reconquista opened 1 month ago

Reconquista commented 1 month ago

jdbc-url: java.util.concurrent.ExecutionException: org.apache.ibatis.exceptions.PersistenceException: java.sql.SQLException: Failed to connect to url : jdbc:mysql://127.0.0.1:3306/point?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&characterEncoding=utf8

pinpoint-error

Reconquista commented 1 month ago

image The database can be connected from the outside.

Reconquista commented 1 month ago

web-starter-application.yml

pinpoint: zookeeper: address: localhost spring: pinot-datasource: pinot: jdbc-url: jdbc:mysql://127.0.0.1:3306/point?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&characterEncoding=utf8

jdbc-url: jdbc:pinot://localhost:3306

  username: root
  password: System.in23
  driver-class-name: com.mysql.cj.jdbc.Driver
minwoo-jung commented 1 month ago

@Reconquista The exception message indicates that we are unable to connect with the mysql server. Check why pinpoint-web can't connect to mysql.

Make sure that mysql and web are communicating properly, that mysql is working properly, etc.

Reconquista commented 1 month ago

@minwoo-jung They are on the same machine. I can also connect from the outside. I'm not sure if my jdbc-url is correct, because its format is different from that in the documentation.

minwoo-jung commented 1 month ago

How did you install pinpoint? The web-starter-application.yml file doesn't seem to be provided by pinpoint, did you create it yourself?

Looking at the comment below, it looks like you need to enter the pinot address, not mysql.

jdbc-url: jdbc:pinot://localhost:3306

Reconquista commented 1 month ago

@minwoo-jung https://pinpoint-apm.gitbook.io/pinpoint/v/v3.0.0/getting-started/installation Viewing through the log, what is displayed is exactly this exception. need redis, kafka, hbase, is all done, only MySQL, I don't understand.

minwoo-jung commented 1 month ago

@Reconquista I figured it out. If you set it up like this in your web-starter-application.yml file, make sure to put the pinot address in the jdbc-url value, not the mysql address.

pinpoint:
  zookeeper:
    address: localhost
spring:
  pinot-datasource:
    pinot:
      jdbc-url: jdbc:pinot://localhost:9000
      username: --username--
      password: --password--
Reconquista commented 1 month ago

@minwoo-jung Look at the log information, this link information is obtained by MyBatis, and I think this part should be the traditional jdbc-url configuration. I don't understand what the configuration of pinpoint should be. 

minwoo-jung commented 1 month ago

@Reconquista Read the architecture documentation below https://pinpoint-apm.gitbook.io/pinpoint/want-a-quick-tour/overview#architecture If you need more understanding, you can also read the other documentation.

For reference mysql is storing the metadata, and the metric data is stored in pinot.

Reconquista commented 1 month ago

@minwoo-jung Do you mean that I still need to install Point before I can do it? Thanks. I'll go and try.

Reconquista commented 1 month ago

@minwoo-jung Why is the installation of Pinpoint 3.0.0 so complicated?