telefonicaid / fiware-cygnus

A connector in charge of persisting context data sources into other third-party databases and storage systems, creating a historical view of the context
https://fiware-cygnus.rtfd.io/
GNU Affero General Public License v3.0
64 stars 104 forks source link

Failed to connect mysql #2118

Open jiuaige opened 3 years ago

jiuaige commented 3 years ago

*My database I can connect the mysql with tools navcat But when i run this process i got the error

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.). Stack trace: [com.telefonica.iot.cygnus.backends.sql.SQLBackendImpl$SQLDriver.getConnection(SQLBackendImpl.java:861), com.telefonica.iot.cygnus.backends.sql.SQLBackendImpl.createDestination(SQLBackendImpl.java:143), com.telefonica.iot.cygnus.sinks.NGSIMySQLSink.persistAggregation(NGSIMySQLSink.java:431), com.telefonica.iot.cygnus.sinks.NGSIMySQLSink.persistBatch(NGSIMySQLSink.java:350), com.telefonica.iot.cygnus.sinks.NGSISink.processRollbackedBatches(NGSISink.java:403), com.telefonica.iot.cygnus.sinks.NGSISink.process(NGSISink.java:375), org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:67), org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:145), java.lang.Thread.run(Thread.java:748)] time=2021-11-26T09:09:00.239Z | lvl=INFO | corr=N/A | trans=N/A | srv=N/A | subsrv=N/A | comp=cygnus-ngsi | op=doRollbackAgain | msg=com.telefonica.iot.cygnus.sinks.NGSISink[498] : Finishing internal transaction (dd89f352-e634-4ed9-b9e4-383c0c2da4d4), this was retry #10

My configration is

cygnus-ngsi.sources = http-source-mysql cygnus-ngsi.sinks = mysql-sink cygnus-ngsi.channels = mysql-channel

Mysql http-source

cygnus-ngsi.sources.http-source-mysql.type = org.apache.flume.source.http.HTTPSource cygnus-ngsi.sources.http-source-mysql.channels = mysql-channel cygnus-ngsi.sources.http-source-mysql.port = 5050 cygnus-ngsi.sources.http-source-mysql.handler = com.telefonica.iot.cygnus.handlers.NGSIRestHandler cygnus-ngsi.sources.http-source-mysql.handler.notification_target = /notify cygnus-ngsi.sources.http-source-mysql.handler.default_service = default cygnus-ngsi.sources.http-source-mysql.handler.default_service_path = / cygnus-ngsi.sources.http-source-mysql.interceptors = ts nmi cygnus-ngsi.sources.http-source-mysql.interceptors.ts.type = timestamp cygnus-ngsi.sources.http-source-mysql.interceptors.gi.type = com.telefonica.iot.cygnus.interceptors.NGSIGroupingInterceptor$Builder cygnus-ngsi.sources.http-source-mysql.interceptors.gi.grouping_rules_conf_file = /opt/apache-flume/conf/grouping_rules.conf cygnus-ngsi.sources.http-source-mysql.interceptors.nmi.type = com.telefonica.iot.cygnus.interceptors.NGSINameMappingsInterceptor$Builder cygnus-ngsi.sources.http-source-mysql.interceptors.nmi.name_mappings_conf_file = /opt/apache-flume/conf/name_mappings.conf

Mysql sink

cygnus-ngsi.sinks.mysql-sink.type = com.telefonica.iot.cygnus.sinks.NGSIMySQLSink cygnus-ngsi.sinks.mysql-sink.channel = mysql-channel

cygnus-ngsi.sinks.mysql-sink.enable_encoding = false

cygnus-ngsi.sinks.mysql-sink.enable_grouping = false

cygnus-ngsi.sinks.mysql-sink.enable_name_mappings = false

cygnus-ngsi.sinks.mysql-sink.enable_lowercase = false

cygnus-ngsi.sinks.mysql-sink.data_model = dm-by-entity

cygnus-ngsi.sinks.mysql-sink.mysql_host = 10.1.100.37 "agent.conf" 448L, 26625C

cygnus-ngsi.sinks.mysql-sink.data_model = dm-by-entity

cygnus-ngsi.sinks.mysql-sink.mysql_host = 10.1.100.37 cygnus-ngsi.sinks.mysql-sink.mysql_port = 3306 cygnus-ngsi.sinks.mysql-sink.mysql_username = root cygnus-ngsi.sinks.mysql-sink.mysql_password = 123456

cygnus-ngsi.sinks.mysql-sink.attr_persistence = row

cygnus-ngsi.sinks.mysql-sink.attr_native_types = false

cygnus-ngsi.sinks.mysql-sink.batch_size = 1

cygnus-ngsi.sinks.mysql-sink.batch_timeout = 30

cygnus-ngsi.sinks.mysql-sink.batch_ttl = 10

cygnus-ngsi.sinks.mysql-sink.mysql_options =

AlvaroVega commented 2 years ago

@jiuaige Which version did you use? Could you provide us more logs in DEBUG level ?