File tree Expand file tree Collapse file tree
DOCUMENTATION/content/documentation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -708,6 +708,44 @@ composer require predis/predis:^1.0
708708
709709
710710
711+ <br >
712+ <a name =" Use-Redis-Cluster " ></a >
713+ ## Use Redis Cluster
714+
715+ 1 - First make sure you run the Redis-Cluster Container (` redis-cluster ` ) with the ` docker-compose up ` command.
716+
717+ ``` bash
718+ docker-compose up -d redis-cluster
719+ ```
720+
721+ 2 - Open your Laravel's ` config/database.php ` and set the redis cluster configuration. Below is example configuration with phpredis.
722+
723+ Read the [ Laravel official documentation] ( https://laravel.com/docs/5.7/redis#configuration ) for more details.
724+
725+ ``` php
726+ 'redis' => [
727+ 'client' => 'phpredis',
728+ 'options' => [
729+ 'cluster' => 'redis',
730+ ],
731+ 'clusters' => [
732+ 'default' => [
733+ [
734+ 'host' => 'redis-cluster',
735+ 'password' => null,
736+ 'port' => 7000,
737+ 'database' => 0,
738+ ],
739+ ],
740+ ],
741+ ],
742+ ```
743+
744+
745+
746+
747+
748+
711749<br >
712750<a name =" Use-Mongo " ></a >
713751## Use Mongo
Original file line number Diff line number Diff line change @@ -456,6 +456,14 @@ services:
456456 networks :
457457 - backend
458458
459+ # ## Redis Cluster ##########################################
460+ redis-cluster :
461+ build : ./redis-cluster
462+ ports :
463+ - " ${REDIS_CLUSTER_PORT_RANGE}:7000-7005"
464+ networks :
465+ - backend
466+
459467# ## ZooKeeper #########################################
460468 zookeeper :
461469 build : ./zookeeper
Original file line number Diff line number Diff line change @@ -220,6 +220,10 @@ MYSQL_ENTRYPOINT_INITDB=./mysql/docker-entrypoint-initdb.d
220220
221221REDIS_PORT=6379
222222
223+ ### REDIS CLUSTER #########################################
224+
225+ REDIS_CLUSTER_PORT_RANGE=7000-7005
226+
223227### ZooKeeper #############################################
224228
225229ZOOKEEPER_PORT=2181
Original file line number Diff line number Diff line change 1+ FROM grokzen/redis-cluster:latest
2+
3+ LABEL maintainer="hareku <hareku908@gmail.com>"
You can’t perform that action at this time.
0 commit comments