Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
5bb453a7
Commit
5bb453a7
authored
Jan 29, 2021
by
Dominik Hebeler
Browse files
database config working with redis cluster
parent
5383080f
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
config/database.php
View file @
5bb453a7
...
...
@@ -111,8 +111,16 @@ return [
'redis'
=>
[
'client'
=>
env
(
'REDIS_CLIENT'
,
'phpredis'
),
'cluster'
=>
false
,
'cluster'
=>
true
,
'options'
=>
[
'cluster'
=>
'redis'
,
'password'
=>
env
(
'REDIS_CACHE_PASSWORD'
,
null
),
'timeout'
=>
5
,
'read_timeout'
=>
2
,
],
'default'
=>
[
'read_write_timeout'
=>
-
1
,
'host'
=>
env
(
'REDIS_HOST'
,
'localhost'
),
...
...
@@ -121,13 +129,24 @@ return [
'database'
=>
0
,
],
'cache'
=>
[
'driver'
=>
env
(
'REDIS_CACHE_DRIVER'
,
'redis'
),
'host'
=>
env
(
'REDIS_CACHE_HOST'
,
'localhost'
),
'password'
=>
env
(
'REDIS_CACHE_PASSWORD'
,
null
),
'port'
=>
env
(
'REDIS_CACHE_PORT'
,
6379
),
'database'
=>
0
,
],
'clusters'
=>
[
'cache'
=>
[
[
'host'
=>
env
(
'REDIS_CACHE_HOST'
,
'localhost'
),
'password'
=>
env
(
'REDIS_CACHE_PASSWORD'
,
null
),
'port'
=>
env
(
'REDIS_CACHE_PORT'
,
6379
),
'database'
=>
0
,
'timeout'
=>
5
,
'read_timeout'
=>
2
,
]
],
'options'
=>
[
'cluster'
=>
'redis'
,
'password'
=>
env
(
'REDIS_CACHE_PASSWORD'
,
null
),
'timeout'
=>
5
,
'read_timeout'
=>
2
,
],
]
],
];
config/redis_local_cluster.conf
0 → 100644
View file @
5bb453a7
client
-
output
-
buffer
-
limit
replica
0
0
0
maxmemory
500
mb
maxmemory
-
policy
allkeys
-
lru
repl
-
backlog
-
size
100
mb
repl
-
backlog
-
ttl
3600
cluster
-
enabled
yes
cluster
-
config
-
file
nodes
.
conf
cluster
-
node
-
timeout
5000
appendonly
yes
\ No newline at end of file
docker-compose.yml
View file @
5bb453a7
...
...
@@ -30,7 +30,74 @@ services:
-
MYSQL_DATABASE=metager
redis
:
restart
:
on-failure
image
:
redis:6.0-rc1-alpine
image
:
redis:6-alpine
redis_cache_1
:
restart
:
on-failure
image
:
redis:6-alpine
networks
:
default
:
{}
cache_network
:
ipv4_address
:
"
10.5.0.10"
volumes
:
-
./config/redis_local_cluster.conf:/usr/local/etc/redis/redis.conf
command
:
redis-server /usr/local/etc/redis/redis.conf
redis_cache_2
:
restart
:
on-failure
image
:
redis:6-alpine
networks
:
default
:
{}
cache_network
:
ipv4_address
:
"
10.5.0.11"
volumes
:
-
./config/redis_local_cluster.conf:/usr/local/etc/redis/redis.conf
command
:
redis-server /usr/local/etc/redis/redis.conf
redis_cache_3
:
restart
:
on-failure
image
:
redis:6-alpine
networks
:
default
:
{}
cache_network
:
ipv4_address
:
"
10.5.0.12"
volumes
:
-
./config/redis_local_cluster.conf:/usr/local/etc/redis/redis.conf
command
:
redis-server /usr/local/etc/redis/redis.conf
redis_cache_4
:
restart
:
on-failure
image
:
redis:6-alpine
networks
:
default
:
{}
cache_network
:
ipv4_address
:
"
10.5.0.13"
volumes
:
-
./config/redis_local_cluster.conf:/usr/local/etc/redis/redis.conf
command
:
redis-server /usr/local/etc/redis/redis.conf
redis_cache_5
:
restart
:
on-failure
image
:
redis:6-alpine
networks
:
default
:
{}
cache_network
:
ipv4_address
:
"
10.5.0.14"
volumes
:
-
./config/redis_local_cluster.conf:/usr/local/etc/redis/redis.conf
command
:
redis-server /usr/local/etc/redis/redis.conf
redis_cache_6
:
restart
:
on-failure
image
:
redis:6-alpine
networks
:
default
:
{}
cache_network
:
ipv4_address
:
"
10.5.0.15"
volumes
:
-
./config/redis_local_cluster.conf:/usr/local/etc/redis/redis.conf
command
:
redis-server /usr/local/etc/redis/redis.conf
redis_cluster_init
:
restart
:
on-failure
image
:
redis:6-alpine
networks
:
-
default
-
cache_network
command
:
redis-cli --cluster create 10.5.0.10:6379 10.5.0.11:6379 10.5.0.12:6379 10.5.0.13:6379 10.5.0.14:6379 10.5.0.15:6379 --cluster-replicas 1 --cluster-yes
phpfpm
:
depends_on
:
-
"
mgdb"
...
...
@@ -39,6 +106,9 @@ services:
-
"
assets"
-
"
redis"
restart
:
on-failure
networks
:
-
default
-
cache_network
build
:
context
:
.
dockerfile
:
DockerfileDev
...
...
@@ -65,17 +135,12 @@ services:
restart
:
on-failure
image
:
metager:latest
working_dir
:
/html
networks
:
-
default
-
cache_network
volumes
:
-
.:/html
command
:
"
su
-s
/bin/sh
-c
'php
artisan
requests:fetcher'
nginx"
test
:
depends_on
:
-
"
phpfpm"
image
:
php:7.3-cli
working_dir
:
/html
volumes
:
-
.:/html
command
:
"
php
artisan
dusk"
dummy-phpfpm
:
restart
:
on-failure
image
:
registry.metager.de/open-source/dummy-engine/master
...
...
@@ -86,4 +151,11 @@ services:
restart
:
on-failure
image
:
registry.metager.de/open-source/dummy-engine/master
working_dir
:
/html
command
:
sh -c "sed -i 's/fastcgi_pass localhost:9000;/fastcgi_pass dummy-phpfpm:9000;/g' /etc/nginx/conf.d/default.conf && nginx"
\ No newline at end of file
command
:
sh -c "sed -i 's/fastcgi_pass localhost:9000;/fastcgi_pass dummy-phpfpm:9000;/g' /etc/nginx/conf.d/default.conf && nginx"
networks
:
cache_network
:
driver
:
bridge
ipam
:
config
:
-
subnet
:
10.5.0.0/16
gateway
:
10.5.0.1
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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