Unable To connect with the mysql innodb cluster

Ayusha year ago

I have passed the conf as follows in traccar.xml:

<entry key='database.driver'>com.mysql.jdbc.Driver</entry>
<entry key='database.url'>jdbc:mysql://my_remote_ip:6446/traccar?zeroDateTimeBehavior=round&amp;serverTimezone=UTC&amp;allowPublicKeyRetrieval=true&amp;useSSL=false&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>
<entry key='database.user'>root</entry>
<entry key='database.password'>pass</entry>

It also connects successfully but it is unable to create the table, I have also created the database named traccar on my mysql server

the error comes out to be as follows:

2023-11-21 19:06:33  INFO: Starting server...
2023-11-21 19:06:34  INFO: HikariPool-1 - Starting...
2023-11-21 19:06:34  WARN: Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.
2023-11-21 19:06:34  INFO: HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@7dc51783
2023-11-21 19:06:34  INFO: HikariPool-1 - Start completed.
2023-11-21 19:06:34  INFO: Clearing database change log checksums
2023-11-21 19:06:35  INFO: Successfully acquired change log lock
2023-11-21 19:06:35  INFO: Successfully released change log lock

2023-11-21 19:06:35 ERROR: Main method error - The table does not comply with the requirements by an external plugin. - SQLException (... < DatabaseModule:95 < <gener:-1 < *:-1 < ... < MainModule:126 < ...)

Can you suggest any changes or something that I have done wrong?

Anton Tananaeva year ago

The error is coming directly from your database:

The table does not comply with the requirements by an external plugin

Ayusha year ago

How can i fix it any possible things that I can follow ?

Anton Tananaeva year ago

No idea. You have to check the plugin I guess. Let us know if you figure it out.

LadyProgrammera year ago

check this for driver

<entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
Ayusha year ago

@LadyProgrammer, just checked it gives the same error.

Ayusha year ago

@Anton Tananaev, which plugin? I guess I am not using one, can you elaborate?

Anton Tananaeva year ago

Well, your database is saying that you are.

Anton Tananaeva year ago

I cannot elaborate because I have no idea what the plugin is and what the error means. All I know is that it originated from your database. That's what you need to investigate, not Traccar.

Ayusha year ago

Can you suggest, some guide or something to use MySQL cluster with traccar.

LadyProgrammera year ago

this work for me @Ayush

<entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
    <entry key='database.url'>jdbc:mysql://127.0.0.1/dbName?zeroDateTimeBehavior=round&amp;serverTimezone=UTC&amp;allowPublicKeyRetrieval=true&amp;useSSL=false&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>
    <entry key='database.user'>dbUser</entry>
    <entry key='database.password'>dbPassword</entry>
Ayusha year ago

Thanks, @LadyProgrammer, are you using MySQL cluster or just mysql simple server database on localhost?

LadyProgrammera year ago

@Ayush mysql simple database, if you will fix please share with us

Ayusha year ago

It works with the single mysql server, but whenever we try to create a InnoDB cluster, or use traccar with innodb cluster it throws following error

Checking whether existing tables comply with Group Replication requirements...
ERROR: The following tables do not have a Primary Key or equivalent column: 
traccar.DATABASECHANGELOG, traccar.tc_device_attribute, traccar.tc_device_command, traccar.tc_device_driver, traccar.tc_device_geofence, traccar.tc_device_maintenance, traccar.tc_device_notification, traccar.tc_device_order, traccar.tc_device_report, traccar.tc_group_attribute, traccar.tc_group_command, traccar.tc_group_driver, traccar.tc_group_geofence, traccar.tc_group_maintenance, traccar.tc_group_notification, traccar.tc_group_order, traccar.tc_group_report, traccar.tc_user_attribute, traccar.tc_user_calendar, traccar.tc_user_command, traccar.tc_user_device, traccar.tc_user_driver, traccar.tc_user_geofence, traccar.tc_user_group, traccar.tc_user_maintenance, traccar.tc_user_notification, traccar.tc_user_order, traccar.tc_user_report, traccar.tc_user_user

Group Replication requires tables to use InnoDB and have a PRIMARY KEY or PRIMARY KEY Equivalent (non-null unique key). Tables that do not follow these requirements will be readable but not updateable when used with Group Replication. If your applications make updates (INSERT, UPDATE or DELETE) to these tables, ensure they use the InnoDB storage engine and have a PRIMARY KEY or PRIMARY KEY Equivalent.
If you can't change the tables structure to include an extra visible key to be used as PRIMARY KEY, you can make use of the INVISIBLE COLUMN feature available since 8.0.23: https://dev.mysql.com/doc/refman/8.0/en/invisible-columns.html
Checking instance configuration...

{
    "status": "error"
}
Anton Tananaeva year ago

Looks like it's not compatible with Traccar schema.