traccar.xml does not work the external ip

traccargps12 years 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 Tananaev2 years ago

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

traccargps12 years 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 Tananaev2 years ago

Something like this:

mysql -h your.ip.here -u root -p traccar
traccargps12 years 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 Tananaev2 years ago

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

traccargps12 years 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 Tananaev2 years ago

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

traccargps12 years ago

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

Anton Tananaev2 years ago

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

traccargps12 years 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