[Tilecache] Tilecache + memcached + pyhton-memcache

Christopher Schmidt crschmidt at metacarta.com
Thu Aug 13 09:31:08 EDT 2009


On Thu, Aug 13, 2009 at 09:04:56AM -0400, Patrick Mayrand wrote:
> Hi,
>  
> I installed tilecache and Openlayers. 
> Everything works when I use the configuration cache on disk. 
> But when I try to configure the cache memory, i have the following error:

This is an error in the Memcached cache. it is fixed i nTileCache SVN. 
You can get around it, by simply removing the 'Raise Exception" line from
the Memcached.py file.

-- Chris

>  
> An error occurred: ['127.0.0.1:11211']
>   File "/var/www/tilecache-2.10/TileCache/Service.py", line 96, in _load
>     cache = cls.loadFromSection(config, "cache", Cache)
>   File "/var/www/tilecache-2.10/TileCache/Service.py", line 75, in _loadFromSection
>     return section_object(**objargs)
>   File "/var/www/tilecache-2.10/TileCache/Caches/Memcached.py", line 11, in __init__
>     raise Exception(servers)
>  
>  
> When I run this script, it works:
>  
> #!/usr/bin/env python
> import sys
> try:
>    import memcache
> except ImportError:
>    sys.exit(0)
> mc = memcache.Client( ['127.0.0.1:11211'] )
> mc.set("he_ben", "rocks")
> assert mc.get("he_ben") == "rocks"
>  
>  
> Is this a problem with tilecache or a problem with my config?
>  
>  
> Os : Debian Lenny
>  
>  
> tilecache.cfg
>  
>  
> [cache]
> type=Memcached
> servers=127.0.0.1:11211
>  
>  
> Apache
>  
> Alias tilecache/ /var/www/tilecache-2.10/
> <Location "/tilecache/">
>      SetHandler python-program
>      PythonHandler TileCache.Service
>      PythonOption TileCacheConfig /etc/tilecache.cfg
>      PythonPath "['/var/www/tilecache-2.10/'] + sys.path"
> </Location>
>  
>  
> memcached.conf
>  
> # Default connection port is 11211
> -p 11211
> 
> # Run the daemon as root. The start-memcached will default to running as root if no
> # -u command is present in this config file
> -u nobody
> 
> # Specify which IP address to listen on. The default is to listen on all IP addresses
> # This parameter is one of the only security measures that memcached has, so make sure
> # it's listening on a firewalled interface.
> -l 127.0.0.1
>  
>  
> regards,
>  
> Pat
>  

> _______________________________________________
> Tilecache mailing list
> Tilecache at openlayers.org
> http://openlayers.org/mailman/listinfo/tilecache


-- 
Christopher Schmidt
MetaCarta



More information about the Tilecache mailing list