我在GlusterFS集群中运行Laravel,我也想设置一个redis集群。我无法了解如何配置Laravel。
这是示例配置文件:
'redis' => [
'cluster' => false,
'default' => [
'host' => env('REDIS_HOST', 'localhost'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],
如何添加多台服务器?
答案 0 :(得分:1)
我假设您只是在那里添加另一台服务器并更新cluster
布尔值:
'redis' => [
'cluster' => true,
'default' => [
'host' => env('REDIS_HOST', 'localhost'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
'secondary' => [
'host' => '127.0.0.1',
'password' => 'p@ssw0rd',
'port' => 6379,
'database' => 0,
],
],