Can I forward positions, events etc to another traccar server?

AlfSolli4 years ago

Say I have 2 servers, one is production, the other is a development server and I want the same data from the production server to reach dev.
Can I use forwarding parameters in traccar.xml to achieve this? details, like do I need json format enabled? Can I forward to more than one server from one traccar instance? (Using comma delimited list of urls perhaps or multiple forward.url tags? )

Ps; LOVE traccar! All appreciation to your hard work! :)

Anton Tananaev4 years ago

You can forward to another server using OsmAnd format, but not all attributes would be supported.

Hristo4 years ago

In the dev traccar server, If you point the config to the database of the production server? Would that be a solution?

Anton Tananaev4 years ago

Yes, but doesn't it defeat the purpose of dev server? What if you mess up something?

Hristo4 years ago

The user which the dev server uses to log into the remote(production) database will have read-only privileges...
This is how I imagine it, never done it...

AlfSolli4 years ago

For this particular purpose, No. (the idea is to mess up on the dev server, but have access to recent reports like trips and so on.

But the suggestion could potentially solve a problem with heavy loads? Anton, could you chip in on this; Is it possible to run two (or more) instances of the traccar server process on different machines with identical config files, all pointing to the same mysql database? And to network load balancing in front of them?
My experience with other software solutions, this sounds like a bad idea. But I have no idea how the internals of traccar works, so..

But thanks for the OsmAnd protocol tip, I will look into it as well.

Hristo4 years ago

For super high loads and increased degree of redundancy, I would try something like this:

  • Rent database server from Amazon Services
    -Point all my servers to the AWS Database
  • Either configure NginX as a load balancer or use CloudFlare as a load ballancer. My most likely choice would be Cloudflare aprox £20/month
  • Cross my fingers and hope to work ;)

Back on the dev server... is it an option to copy the production database and then make incremental backups to the dev?

AlfSolli4 years ago

I don't like the "cross my fingers and hope" part. ;)

But good suggestion on the database sync. Dev server doesn't (right now anyway) to have realtime updates. And that could have been solved with replication, I guess. Dunno why I didn't think of that. Been away from devops too long probably. :) That solves my original problem.

Sorry about going off-topic with the loadbalancing/failover part, I'll make a separate thread about it.