Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laradock
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kerwin
laradock
Commits
14ee775e
Commit
14ee775e
authored
Feb 16, 2019
by
hareku
Committed by
Shao Yu-Lung (Allen)
Feb 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: redis-cluster (#1981)
parent
1282c413
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
0 deletions
+53
-0
index.md
DOCUMENTATION/content/documentation/index.md
+38
-0
docker-compose.yml
docker-compose.yml
+8
-0
env-example
env-example
+4
-0
Dockerfile
redis-cluster/Dockerfile
+3
-0
No files found.
DOCUMENTATION/content/documentation/index.md
View file @
14ee775e
...
...
@@ -708,6 +708,44 @@ composer require predis/predis:^1.0
<br>
<a
name=
"Use-Redis-Cluster"
></a>
## Use Redis Cluster
1 - First make sure you run the Redis-Cluster Container (
`redis-cluster`
) with the
`docker-compose up`
command.
```
bash
docker-compose up
-d
redis-cluster
```
2 - Open your Laravel's
`config/database.php`
and set the redis cluster configuration. Below is example configuration with phpredis.
Read the
[
Laravel official documentation
](
https://laravel.com/docs/5.7/redis#configuration
)
for more details.
```
php
'redis'
=>
[
'client'
=>
'phpredis'
,
'options'
=>
[
'cluster'
=>
'redis'
,
],
'clusters'
=>
[
'default'
=>
[
[
'host'
=>
'redis-cluster'
,
'password'
=>
null
,
'port'
=>
7000
,
'database'
=>
0
,
],
],
],
],
```
<br>
<a
name=
"Use-Mongo"
></a>
## Use Mongo
...
...
docker-compose.yml
View file @
14ee775e
...
...
@@ -456,6 +456,14 @@ services:
networks
:
-
backend
### Redis Cluster ##########################################
redis-cluster
:
build
:
./redis-cluster
ports
:
-
"
${REDIS_CLUSTER_PORT_RANGE}:7000-7005"
networks
:
-
backend
### ZooKeeper #########################################
zookeeper
:
build
:
./zookeeper
...
...
env-example
View file @
14ee775e
...
...
@@ -220,6 +220,10 @@ MYSQL_ENTRYPOINT_INITDB=./mysql/docker-entrypoint-initdb.d
REDIS_PORT=6379
### REDIS CLUSTER #########################################
REDIS_CLUSTER_PORT_RANGE=7000-7005
### ZooKeeper #############################################
ZOOKEEPER_PORT=2181
...
...
redis-cluster/Dockerfile
0 → 100644
View file @
14ee775e
FROM
grokzen/redis-cluster:latest
LABEL
maintainer="hareku <hareku908@gmail.com>"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment