why do you want more than one?
Aug 21, 2015
4
Level 1
configure multiple memcached servers?
Hey all, i just started exploring lumen for some microservices in our company.
i'm trying to configure multiple memcached hosts. but in the .env file seems like there is a place just for one (MEMCACHED_HOST)
how can i set a list of memcache servers?
Level 7
@raslin You can copy the cache config file from /vendor/larave/lumen-framework/config/cache.php to /config/cache.php
In that file add the servers you need, like this:
'memcached' => [
'driver' => 'memcached',
'servers' => [
[
'host' => env('MEMCACHED_HOST', '127.0.0.1'), 'port' => env('MEMCACHED_PORT', 11211), 'weight' => 50
],
[
'host' => env('MEMCACHED_HOST1', '127.0.0.1'), 'port' => env('MEMCACHED_PORT', 11211), 'weight' => 50
]
],
],
And add, on the /bootstrap/app.php the following:
$app->configure('cache');
1 like
Please or to participate in this conversation.