Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013
1. OSM
Megalomaniacs’
Cookbook:
Lessons
Learned
in
Se7ng
Up
Your
Own
Planet
Jeff Meyer, jeff@gwhat.org | Open Historical Map, GWHAT.org
2. Sources of Lessons Learned
• From installing OpenHistoricalMap
– www.openhistoricalmap.org
– Which is still very hacky
– Locally running everything except Nominatim
• From updating the OSM wiki Rails Port docs
– http://wiki.openstreetmap.org/wiki/Rails_port
• From piecing together:
– OSM tile server docs
– OSM production information
4. Tile Server
Lesson 1: Know the Stack!
“Rails Port”
Nominatim
Know it as it lives on the site.
5. Remote
Lesson 1: Know the Stack!
Local
Remote
Know it as it lives in your install…
… and don’t forget the db(s) behind it all.
6. Lesson 2: Know What You Want to Do!
That’ll drive what you want to install locally.
Skipping things might make your life easier!
Requirements
Goal Rails local? APIdb master Nominatim
local?
Tiles local?
Contribute
Code to core
site
Yes Remote /
local
replication
Maybe Maybe
Run your own
tile server
based on OSM
No Remote /
local
replication
No Yes
Make cool tile
styles (TileMill)
No n/a No No
Maintain a
separate planet
Yes Local Master Maybe Yes
7. Plan for your task….
• Think about how far you want to go before you start
– Postgres only vs. PostGIS
– Capacity planning
– Disks matter! (there is indeed a need for speed)
– Budget time for setting up your planet import
• Tricky connections:
– Osmosis is your friend – for generating local minutely diffs
– Tile db updater – osm2pgsql updates
– Pay attention to openstreetmap-tiles-update-expire
– Shoreline updater
– www-data (Apache user) runs lots of stuff (not you : ) )
• Skills help – brush up! Knowledge is good!
– SQL, Rails, Apache, git, general Linux-fu
8. Rails Server Basics
No big whoop : )
1. Prep – install your db, Rails, etc.
2. Clone – git clone https://
github.com/openstreetmap/
openstreetmap-website.git!
3. Config
4. Rake
5. Start
then… add stuff like cgimap – test it for sure
• Docs wfm <ducks>
h@p://wiki.openstreetmap.org/wiki/Rails_port
9. Tile Server Basics
• Ain’t no such thing
– i.e. there is no apt-get install osm-tile-server
– Stylesheets
– Mapnik / Renderd – rendering tiles
– Apache / Modtile – serving tiles
– Plumbing – dirty, shoreline, diffs
• Docs? Widely scattered
• Remember who owns it: www-data
10. Task at Hand….
• Set up: Entire Planet?
• Step 1: Set up Rails Port
• Step 2: Set up Tile Server
• Step 3: Set up Minutely Updates
• Step 4: Beer
11. Great references….
• Rails Wiki:
– http://wiki.openstreetmap.org/wiki/Ubuntu_tile_server
• Tiles Install docs:
– http://wiki.openstreetmap.org/wiki/Category:Tiles_and_tiling
– www.switch2osm.org
– http://wiki.openstreetmap.org/wiki/Ubuntu_tile_server (ignore the warnings)
• Production install docs:
– Apidb -> create minutely diffs from your local master:
http://wiki.openstreetmap.org/wiki/Osmosis/Replication#Server-
side_Replication
– Tile rendering:
• http://wiki.openstreetmap.org/wiki/Ubuntu_tile_server#Updating
• https://github.com/openstreetmap/mod_tile/blob/master/openstreetmap-tiles-update-expire