Skip to content

Vector Tile Runbook

Paul Norman edited this page May 9, 2025 · 6 revisions

Reloading the database for spirit updates

  1. Remove a server from the active backends in the Fastly management console
  2. Update chef for the server role to set the [:vectortile][:replication][:enabled] and [:vectortile][:replication][:tileupdate] attributes to false, as well as updating the version of spirit and/or themepark.
  3. SSH into the server and
    1. Start a screen session to protect against disconnections
    2. Stop tilekiln with sudo service tilekiln stop
    3. Remove any monitoring connections and drop the database with sudo -u postgres psql -d postgres -c "select pg_terminate_backend(pid) from pg_stat_activity where datname = 'spirit'" && sudo -u postgres dropdb spirit
    4. Update columns or drop tiles DB if schema columns have changed, e.g. psql -d tiles -c 'DROP SCHEMA tilekiln CASCADE';
    5. Download the latest planet to your home directory
    6. Check that chef has recreated the spirit database with psql -l
    7. Import the planet file with sudo -u tileupdate import-planet --cache 60000 <planet file pbf>. Adjust the --cache parameter if needed.
    8. Restart the osm2pgsql prometheus exporter with sudo service prometheus-osm2pgsql-exporter restart
    9. Set [:vectortile][:replication][:enabled] to true for the node and wait for chef to update
    10. OPTIONAL Delete existing tiles with sudo -u tileupdate /opt/tilekiln/bin/tilekiln storage delete --config /srv/vector.openstreetmap.org/spirit/shortbread.yaml --storage-dbname tiles

Clone this wiki locally