Skip to content

Running Multiple Database Instances for Different Time Zones

Ryan Brideau edited this page Aug 8, 2016 · 1 revision

With Pokelyzer, you can collect data from more than one area at the same time just by pointing multiple sources to the database. If this areas are in multiple time zones, however, you may want to run separate databases so that each has their own local time zone.

To accomplish this:

  • Each database should have a different name (the database restore process doesn't care what the name of it is, so call it whatever you like)
  • If the cities are in different time zones, you'll have to configure the time zones of each
  • Start up separate web hook listener for each database. When you do, pass the database name you want it to send to, and give it a unique WS_PORT value if it's running on the same machine.
  • When you run PokemonGo-Map, make sure the port number used for the webhook matches the listener you want to send it to.

For example, let's say you have 3 cities you want to monitor: City A, City B and City C. Your setup would be:

City A

Database: pokemon_go_city_a

Listener Starting Command:

DB_NAME='pokemon_go_city_a' DB_USER='pokemon_go_role' DB_PASS='YourPass' DB_PORT=5432 WS_PORT=9876 ERA=3 node app.js

PokemonGo-Map Starting Command:

python runserver.py -a ptc -u username -p pass -l "City A" -st 10 -H 0.0.0.0 -k GoogleMapKey -wh http://localhost:9876 -sd 10

City B

Database: pokemon_go_city_b

Listener Starting Command:

DB_NAME='pokemon_go_city_b' DB_USER='pokemon_go_role' DB_PASS='YourPass' DB_PORT=5432 WS_PORT=9877 ERA=3 node app.js

PokemonGo-Map Starting Command:

python runserver.py -a ptc -u username -p pass -l "City B" -st 10 -H 0.0.0.0 -k GoogleMapKey -wh http://localhost:9877 -sd 10

City C

Database: pokemon_go_city_c

Listener Starting Command:

DB_NAME='pokemon_go_city_c' DB_USER='pokemon_go_role' DB_PASS='YourPass' DB_PORT=5432 WS_PORT=9878 ERA=3 node app.js

PokemonGo-Map Starting Command:

python runserver.py -a ptc -u username -p pass -l "City C" -st 10 -H 0.0.0.0 -k GoogleMapKey -wh http://localhost:9878 -sd 10

That being said, if you want to keep things simple, you can use the same database for any location that's in the same time zone and it will work just fine. If that's that path you go down, just use the same webhook listener for each map server you run that's in the same zone.