Horizontal Scaling Broadcast Configuration

Luis Filipea month ago

Hi friends.

I have some doubts about traccar broadcast configuration.
Today, I have 1 VPS with Traccar and we are scalling to a second one.

  • Do I have to add "broadcast" configuration at traccar.xml only at Main VPS, linking to the second one?
  • Do I have to add "broadcast" configuration at booth VPS?
  • If someday we need to have 3 VPS, have to configure "broadcast" between them?
Anton Tananaeva month ago

You have to configure the broadcast on each server.

Luis Filipea month ago

Thank for replying Anton.

Can I add multiple IPs at "broadcast.address" configuration ?

Anton Tananaeva month ago

It sounds like you don't understand what a multicast address is. I recommend doing some research on that first.

Hi Felipe, Anton. Did you manage to solve your problem? I'm having the same problem with Traccar 6.5, although I have a connection to the database on both servers, I'm not getting the second server to update as I expect. I used the configuration that appears in the documentation on both servers (pointing to each other) as well as only on the primary and also only on the secondary, having the same behavior, at the moment all the computers are pointing to 1 server.

Anton Tananaev10 days ago

Have you checked if the synchronization is working?

Hi Anton.

Sorry for not answering before, I was at work. I'm trying to get a traccar that has all the devices. I installed a second server with the configuration for Horizontal Scaling in which I pointed to the IP and port of the main one in addition to the databases.

So far everything is fine, both computers show the same information, but if I make a change on one computer the other doesn't reflect it until I load the page again.

Maybe I'm wrong in what I expect from scaling, thinking that if a computer moves it should be seen on both servers.

Thank you very much.

Anton Tananaev8 days ago

You have to reload the page. It doesn't update automatically even on a single server.

On the original server everything is updated correctly. If a vehicle moves, this is reflected. When I enable the second server with the scaling configuration, it only displays but does not update the vehicle movement and remains with the last time it was loaded.

Thank you very much for your prompt response.

Note: should the configuration be done on both servers or only on the second server?

Anton Tananaev8 days ago

Location definitely should be updated if it's working correctly. Seems like either horizontal scaling is not configured correctly or it doesn't work for some reason. What does your configuration look like exactly?

Anton Tananaev8 days ago

Wait. I just re-read what you said earlier:

pointing to each other

It seems like you misconfigured it. You should be using multicast. If you don't know what it is, make sure you do some reading about that technology first.

database configuration and scaling. As far as I understand, there are only 3 lines on the secondary server.
On both servers, port 9000 is enabled.

Principal Server

<entry key='database.url'>jdbc:mysql://XXXX:3306/BD?allowPublicKeyRetrieval=true&amp;useSSL=false&amp;serverTimezone=UTC&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>
<entry key='database.user'>XXXX</entry>
<entry key='database.password'>XXXX</entry>
<entry key='notificator.types'>web,mail,telegram</entry>

Second Server

<entry key='database.url'>jdbc:mysql://XXXX:3306/BD?allowPublicKeyRetrieval=true&amp;useSSL=false&amp;serverTimezone=UTC&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>
<entry key='database.user'>XXXX</entry>
<entry key='database.password'>XXXX</entry>
<entry key='web.port'>8082</entry>

<entry key='broadcast.interface'>eth1</entry>
<entry key='broadcast.address'>LocalIP_PrincipalServer</entry>
<entry key='broadcast.port'>9000</entry>
Anton Tananaev8 days ago

This is definitely invalid configuration.

Could you please guide me? All the documentation I have read is based on those 3 broadcast variables.

Anton Tananaev8 days ago

I already explained what the problem is. Please carefully read my comments. If seems like you don't understand what a multicast is. In that case you should not attempt this configuration.