traccar.xml does not work the external ip

traccargps1a year ago

Hi,
I started to implement Group Replication MySQL in mysql database of traccar. when i do the setup:

https://www.digitalocean.com/community/tutorials/how-to-configure-mysql-group-replication-on-ubuntu-20-04
Host specific replication configuration

server_id = 
bind-address = ""
report_host = ""
loose-group_replication_local_address = ""

Localhost does not work and for that it would have to point to the IP. In the traccar.xml file put the IP but it does not work I saw that years ago someone went through this in the link below:
https://www.traccar.org/forums/topic/mysql4/

    <entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
    <entry key='database.url'>jdbc:mysql://my_ip_server_here:3306/traccar?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'>user</entry>
    <entry key='database.password'>password</entry>

when I put the IP it doesn't work but I can access it through MySQLWorkbench

Anton Tananaeva year ago

Have you tried connecting using MySQL command line client using the same parameters from the same server?

traccargps1a year ago

Do you have an example of what you're talking about?

obs: When I put localhost it works but I want the IP due to Group Replication

Anton Tananaeva year ago

Something like this:

mysql -h your.ip.here -u root -p traccar
traccargps1a year ago

Hi,

I connected to the server by cmd!

mysql: [Warning] Using a password on the command line interface can be insecure.
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 549
Server version: 8.0.31-0ubuntu0.22.04.1 (Ubuntu)

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show tables
    -> ^C
mysql> show tables;
+------------------------+
| Tables_in_traccar      |
+------------------------+
| DATABASECHANGELOG      |
| DATABASECHANGELOGLOCK  |
| tc_attributes          |
...
| tc_user_user           |
| tc_users               |
+------------------------+
43 rows in set (0.15 sec)
Anton Tananaeva year ago

Did you use the command as I presented it or you changed it? Specifically did you use the IP address?

traccargps1a year ago

hi,

I put it that way and it worked!

Serv A
mysql --host=my.ip.here_serv.b --user=my.user.here --password=my.pass.here traccar

Serv B

Anton Tananaeva year ago

What's the difference between my_ip_server_here and my.ip.here_serv.b?

traccargps1a year ago

my_ip_server_here = my.ip.here_serv.b.
they are the same

Anton Tananaeva year ago

Then I believe it should work. And you sure you're running the command from the same server where you have Traccar?

traccargps1a year ago

Serv A - API and Mysql
traccar.xml
here i need input IP Serv A, localhost not working when i activate Group Replication, but when I put the IP it doesn't work

Serv B - API and Mysql
traccar.xml
here i need input IP Serv B, localhost not working when i activate Group Replication, but when I put the IP it doesn't work

Serv C - API and Mysql
traccar.xml
here i need input IP Serv C, localhost not working when i activate Group Replication, but when I put the IP it doesn't work