1

I have my mod_tile.config set up like this

# This is the Apache server configuration file for providing OSM tile support
# through mod_tile

LoadModule tile_module modules/mod_tile.so

<VirtualHost *:80>
    ServerName tile.openstreetmap.org
    ServerAlias a.tile.openstreetmap.org b.tile.openstreetmap.org c.tile.openstreetmap.org d.tile.openstreetmap.org
    DocumentRoot /var/www/html

# Specify the default base storage path for where tiles live. A number of different storage backends
# are available, that can be used for storing tiles.  Currently these are a file based storage, a memcached
# based storage and a RADOS based storage.
# The file based storage uses a simple file path as its storage path ( /path/to/tiledir )
# The RADOS based storage takes a location to the rados config file and a pool name ( rados://poolname/path/to/ceph.conf )
# The memcached based storage currently has no configuration options and always connects to memcached on localhost ( memcached:// )
#
# The storage path can be overwritten on a style by style basis from the style TileConfigFile
    ModTileTileDir memcached://
...

and my renderd.config set up like this

[renderd]
num_threads=4
tile_dir=memcached://localhost:11211
stats_file=/var/run/renderd/renderd.stats

[mapnik]
plugins_dir=/usr/lib/mapnik/3.0/input
font_dir=/usr/share/fonts/truetype
font_dir_recurse=1

[ajt]
URI=/hot/
TILEDIR=memcached://localhost:11211
XML=/home/renderaccount/src/openstreetmap-carto/mapnik.xml
HOST=localhost
TILESIZE=256
MAXZOOM=20

yet I am receiving this error:

renderd[10095]: Loading parameterization function for debug: init_storage_backend: initialising memcached storage backend at: memcached://
ERROR: init_storage_memcached: Support for memcached has not been compiled into this program

How do I compile support for memcached into mod_tile and renderd?

1

I fixed this error by getting libmemcached and then restarting apache and my rendering system.

sudo apt-get update
sudo apt-get install -y libmemcached-tools libmemcached-dev libmemcached11
sudo service apache2 restart
sudo service renderd restart

Also I added the below option to /etc/memcached.conf

# Increase limit 
-I 128M

ran

sudo service memcached restart

set up mod_tile.config like this

# This is the Apache server configuration file for providing OSM tile support
# through mod_tile

LoadModule tile_module modules/mod_tile.so

<VirtualHost *:80>
    ServerName tile.openstreetmap.org
    ServerAlias a.tile.openstreetmap.org b.tile.openstreetmap.org c.tile.openstreetmap.org d.tile.openstreetmap.org
    DocumentRoot /var/www/html

# Specify the default base storage path for where tiles live. A number of different storage backends
# are available, that can be used for storing tiles.  Currently these are a file based storage, a memcached
# based storage and a RADOS based storage.
# The file based storage uses a simple file path as its storage path ( /path/to/tiledir )
# The RADOS based storage takes a location to the rados config file and a pool name ( rados://poolname/path/to/ceph.conf )
# The memcached based storage currently has no configuration options and always connects to memcached on localhost ( memcached:// )
#
# The storage path can be overwritten on a style by style basis from the style TileConfigFile
    ModTileTileDir memcached://
...

set up renderd.config like this

[renderd]
num_threads=4
tile_dir=/var/lib/mod_tile
stats_file=/var/run/renderd/renderd.stats

[mapnik]
plugins_dir=/usr/lib/mapnik/3.0/input
font_dir=/usr/share/fonts/truetype
font_dir_recurse=1

[ajt]
URI=/hot/
TILEDIR=memcached://
XML=/home/ubuntu/src/openstreetmap-carto-AJT/mapnik.xml
HOST=localhost
TILESIZE=256
MAXZOOM=20

However, I ran into OOM process killer when it ran out of memory. It appears you need quite a bit of memory to use memcache here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.