Since memcache stores everything in ram, it will lose its store after a node recovers from failure. Does memcache offer a hook to invoke a script after it starts up? We want that script to do "something", either hit an external service, etc., to reload the cache. We're using Ubuntu 11.
Memcache is non-persistent cache (the whole idea is to supplement data-providers such as MySQL and cache the most-used data, not replace them altogether), so what you're asking cannot be achieved.
The argument over 'persistent memcache' is a can of worms in itself, as some people maintain that if you build a 'persistent memcache', then it is no longer a 'cache'.
For more details (many more than I can provide here), check out this StackOverflow post.
Since, you're running Ubuntu, you can wrap memcache tasks into an Upstart configuration.
The "hook" to invoke a script after
Your config will then look something like:
Please check the Upstart documentation, etc. You'll of course need to remove the memcached startup script from /etc/init.d.