mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 15:32:26 +08:00
1.MongoDB、Redis兼容集群模式
2.离线数据接口化访问
This commit is contained in:
47
docker/3rd/mongo/mongo_cluster/create_cluster.sh
Executable file
47
docker/3rd/mongo/mongo_cluster/create_cluster.sh
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/bin/sh
|
||||
|
||||
# shard1
|
||||
mongo --host 192.168.199.233 --port 27118 <<EOF
|
||||
rs.initiate({_id: "shard1", members: [{_id: 0, host: "mongo_shard1:27018"}]})
|
||||
EOF
|
||||
|
||||
# shard2
|
||||
mongo --host 192.168.199.233 --port 27218 <<EOF
|
||||
rs.initiate({_id: "shard2", members: [{_id: 0, host: "mongo_shard2:27018"}]})
|
||||
EOF
|
||||
|
||||
# shard3
|
||||
mongo --host 192.168.199.233 --port 27318 <<EOF
|
||||
rs.initiate({_id: "shard3", members: [{_id: 0, host: "mongo_shard3:27018"}]})
|
||||
EOF
|
||||
|
||||
# config1
|
||||
mongo --host 192.168.199.233 --port 27119 <<EOF
|
||||
rs.initiate({_id: "config", configsvr: true, members: [{_id: 0, host: "mongo_config1:27019"}, {_id: 1, host: "mongo_config2:27019"}, {_id: 2, host: "mongo_config3:27019"}]})
|
||||
EOF
|
||||
|
||||
sleep 30
|
||||
|
||||
# mongos1
|
||||
mongo --host 192.168.199.233 --port 27117 <<EOF
|
||||
sh.addShard("shard1/mongo_shard1:27018")
|
||||
sh.addShard("shard2/mongo_shard2:27018")
|
||||
sh.addShard("shard3/mongo_shard3:27018")
|
||||
EOF
|
||||
|
||||
sleep 5
|
||||
|
||||
mongo --host 192.168.199.233 --port 27117 <<EOF
|
||||
sh.enableSharding("dispatch_hk4e")
|
||||
sh.shardCollection("dispatch_hk4e.account", {"AccountID": "hashed"})
|
||||
sh.enableBalancing("dispatch_hk4e.account")
|
||||
sh.shardCollection("dispatch_hk4e.client_log", {"_id": "hashed"})
|
||||
sh.enableBalancing("dispatch_hk4e.client_log")
|
||||
sh.enableSharding("gs_hk4e")
|
||||
sh.shardCollection("gs_hk4e.player", {"PlayerID": "hashed"})
|
||||
sh.enableBalancing("gs_hk4e.player")
|
||||
sh.shardCollection("gs_hk4e.chat_msg", {"Uid": "hashed"})
|
||||
sh.enableBalancing("gs_hk4e.chat_msg")
|
||||
sh.startBalancer()
|
||||
db.adminCommand("flushRouterConfig")
|
||||
EOF
|
||||
196
docker/3rd/mongo/mongo_cluster/docker-compose.yaml
Normal file
196
docker/3rd/mongo/mongo_cluster/docker-compose.yaml
Normal file
@@ -0,0 +1,196 @@
|
||||
version: '3'
|
||||
services:
|
||||
mongo_shard1:
|
||||
restart: always
|
||||
image: mongo:5.0.5
|
||||
container_name: mongo_shard1
|
||||
ports:
|
||||
- "27118:27018/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
- ./data/shard1:/data/db
|
||||
command: mongod --shardsvr --replSet shard1
|
||||
privileged: true
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '4.00'
|
||||
memory: 512M
|
||||
|
||||
mongo_shard2:
|
||||
restart: always
|
||||
image: mongo:5.0.5
|
||||
container_name: mongo_shard2
|
||||
ports:
|
||||
- "27218:27018/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
- ./data/shard2:/data/db
|
||||
command: mongod --shardsvr --replSet shard2
|
||||
privileged: true
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '4.00'
|
||||
memory: 512M
|
||||
|
||||
mongo_shard3:
|
||||
restart: always
|
||||
image: mongo:5.0.5
|
||||
container_name: mongo_shard3
|
||||
ports:
|
||||
- "27318:27018/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
- ./data/shard3:/data/db
|
||||
command: mongod --shardsvr --replSet shard3
|
||||
privileged: true
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '4.00'
|
||||
memory: 512M
|
||||
|
||||
mongo_config1:
|
||||
restart: always
|
||||
image: mongo:5.0.5
|
||||
container_name: mongo_config1
|
||||
ports:
|
||||
- "27119:27019/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
- ./data/config1:/data/configdb
|
||||
command: mongod --configsvr --replSet config
|
||||
depends_on:
|
||||
- mongo_shard1
|
||||
- mongo_shard2
|
||||
- mongo_shard3
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.00'
|
||||
memory: 256M
|
||||
|
||||
mongo_config2:
|
||||
restart: always
|
||||
image: mongo:5.0.5
|
||||
container_name: mongo_config2
|
||||
ports:
|
||||
- "27219:27019/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
- ./data/config2:/data/configdb
|
||||
command: mongod --configsvr --replSet config
|
||||
depends_on:
|
||||
- mongo_shard1
|
||||
- mongo_shard2
|
||||
- mongo_shard3
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.00'
|
||||
memory: 256M
|
||||
|
||||
mongo_config3:
|
||||
restart: always
|
||||
image: mongo:5.0.5
|
||||
container_name: mongo_config3
|
||||
ports:
|
||||
- "27319:27019/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
- ./data/config3:/data/configdb
|
||||
command: mongod --configsvr --replSet config
|
||||
depends_on:
|
||||
- mongo_shard1
|
||||
- mongo_shard2
|
||||
- mongo_shard3
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.00'
|
||||
memory: 256M
|
||||
|
||||
mongo_mongos1:
|
||||
restart: always
|
||||
image: mongo:5.0.5
|
||||
container_name: mongo_mongos1
|
||||
ports:
|
||||
- "27117:27017/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
command: mongos --bind_ip_all --configdb config/mongo_config1:27019,mongo_config2:27019,mongo_config3:27019
|
||||
depends_on:
|
||||
- mongo_config1
|
||||
- mongo_config2
|
||||
- mongo_config3
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '2.00'
|
||||
memory: 128M
|
||||
|
||||
mongo_mongos2:
|
||||
restart: always
|
||||
image: mongo:5.0.5
|
||||
container_name: mongo_mongos2
|
||||
ports:
|
||||
- "27217:27017/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
command: mongos --bind_ip_all --configdb config/mongo_config1:27019,mongo_config2:27019,mongo_config3:27019
|
||||
depends_on:
|
||||
- mongo_config1
|
||||
- mongo_config2
|
||||
- mongo_config3
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '2.00'
|
||||
memory: 128M
|
||||
|
||||
mongo_mongos3:
|
||||
restart: always
|
||||
image: mongo:5.0.5
|
||||
container_name: mongo_mongos3
|
||||
ports:
|
||||
- "27317:27017/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
command: mongos --bind_ip_all --configdb config/mongo_config1:27019,mongo_config2:27019,mongo_config3:27019
|
||||
depends_on:
|
||||
- mongo_config1
|
||||
- mongo_config2
|
||||
- mongo_config3
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '2.00'
|
||||
memory: 128M
|
||||
19
docker/3rd/mongo/mongo_strndalone/docker-compose.yaml
Normal file
19
docker/3rd/mongo/mongo_strndalone/docker-compose.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
version: '3'
|
||||
services:
|
||||
mongo:
|
||||
restart: always
|
||||
image: mongo:5.0.5
|
||||
container_name: mongo
|
||||
ports:
|
||||
- "27017:27017/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
- ./data:/data/db
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '4.00'
|
||||
memory: 512M
|
||||
23
docker/3rd/nats/nats_cluster/conf/nats1/nats-server.conf
Normal file
23
docker/3rd/nats/nats_cluster/conf/nats1/nats-server.conf
Normal file
@@ -0,0 +1,23 @@
|
||||
http: 8222
|
||||
|
||||
server_name: nats1
|
||||
listen: 4222
|
||||
|
||||
max_payload: 5120KB
|
||||
|
||||
cluster {
|
||||
name: nats-cluster
|
||||
listen: 6222
|
||||
routes: [
|
||||
nats-route://nats2:6222
|
||||
nats-route://nats3:6222
|
||||
]
|
||||
}
|
||||
|
||||
jetstream: enable
|
||||
|
||||
jetstream {
|
||||
store_dir: /nats/storage
|
||||
max_mem: 1G
|
||||
max_file: 10G
|
||||
}
|
||||
23
docker/3rd/nats/nats_cluster/conf/nats2/nats-server.conf
Normal file
23
docker/3rd/nats/nats_cluster/conf/nats2/nats-server.conf
Normal file
@@ -0,0 +1,23 @@
|
||||
http: 8222
|
||||
|
||||
server_name: nats2
|
||||
listen: 4222
|
||||
|
||||
max_payload: 5120KB
|
||||
|
||||
cluster {
|
||||
name: nats-cluster
|
||||
listen: 6222
|
||||
routes: [
|
||||
nats-route://nats1:6222
|
||||
nats-route://nats3:6222
|
||||
]
|
||||
}
|
||||
|
||||
jetstream: enable
|
||||
|
||||
jetstream {
|
||||
store_dir: /nats/storage
|
||||
max_mem: 1G
|
||||
max_file: 10G
|
||||
}
|
||||
23
docker/3rd/nats/nats_cluster/conf/nats3/nats-server.conf
Normal file
23
docker/3rd/nats/nats_cluster/conf/nats3/nats-server.conf
Normal file
@@ -0,0 +1,23 @@
|
||||
http: 8222
|
||||
|
||||
server_name: nats3
|
||||
listen: 4222
|
||||
|
||||
max_payload: 5120KB
|
||||
|
||||
cluster {
|
||||
name: nats-cluster
|
||||
listen: 6222
|
||||
routes: [
|
||||
nats-route://nats1:6222
|
||||
nats-route://nats2:6222
|
||||
]
|
||||
}
|
||||
|
||||
jetstream: enable
|
||||
|
||||
jetstream {
|
||||
store_dir: /nats/storage
|
||||
max_mem: 1G
|
||||
max_file: 10G
|
||||
}
|
||||
61
docker/3rd/nats/nats_cluster/docker-compose.yaml
Normal file
61
docker/3rd/nats/nats_cluster/docker-compose.yaml
Normal file
@@ -0,0 +1,61 @@
|
||||
version: '3'
|
||||
services:
|
||||
nats1:
|
||||
restart: always
|
||||
image: nats:2.7.3
|
||||
container_name: nats1
|
||||
ports:
|
||||
- "4222:4222/tcp"
|
||||
- "8222:8222/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
- ./conf/nats1/nats-server.conf:/nats-server.conf
|
||||
- ./data/nats1:/nats/storage
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.00'
|
||||
memory: 512M
|
||||
|
||||
nats2:
|
||||
restart: always
|
||||
image: nats:2.7.3
|
||||
container_name: nats2
|
||||
ports:
|
||||
- "4223:4222/tcp"
|
||||
- "8223:8222/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
- ./conf/nats2/nats-server.conf:/nats-server.conf
|
||||
- ./data/nats2:/nats/storage
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.00'
|
||||
memory: 512M
|
||||
|
||||
nats3:
|
||||
restart: always
|
||||
image: nats:2.7.3
|
||||
container_name: nats3
|
||||
ports:
|
||||
- "4224:4222/tcp"
|
||||
- "8224:8222/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
- ./conf/nats3/nats-server.conf:/nats-server.conf
|
||||
- ./data/nats3:/nats/storage
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.00'
|
||||
memory: 512M
|
||||
13
docker/3rd/nats/nats_strndalone/conf/nats-server.conf
Normal file
13
docker/3rd/nats/nats_strndalone/conf/nats-server.conf
Normal file
@@ -0,0 +1,13 @@
|
||||
http: 8222
|
||||
|
||||
server_name: nats
|
||||
listen: 4222
|
||||
|
||||
max_payload: 5120KB
|
||||
|
||||
cluster {
|
||||
name: nats-cluster
|
||||
listen: 6222
|
||||
routes: [
|
||||
]
|
||||
}
|
||||
21
docker/3rd/nats/nats_strndalone/docker-compose.yaml
Normal file
21
docker/3rd/nats/nats_strndalone/docker-compose.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
version: '3'
|
||||
services:
|
||||
nats:
|
||||
restart: always
|
||||
image: nats:2.7.3
|
||||
container_name: nats
|
||||
ports:
|
||||
- "4224:4222/tcp"
|
||||
- "8224:8222/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
- ./conf/nats-server.conf:/nats-server.conf
|
||||
- ./data:/nats/storage
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.00'
|
||||
memory: 512M
|
||||
12
docker/3rd/redis/redis_cluster/conf/redis1/redis.conf
Normal file
12
docker/3rd/redis/redis_cluster/conf/redis1/redis.conf
Normal file
@@ -0,0 +1,12 @@
|
||||
port 6371
|
||||
requirepass 123456
|
||||
masterauth 123456
|
||||
protected-mode no
|
||||
daemonize no
|
||||
appendonly yes
|
||||
cluster-enabled yes
|
||||
cluster-config-file nodes.conf
|
||||
cluster-node-timeout 15000
|
||||
cluster-announce-ip 192.168.199.233
|
||||
cluster-announce-port 6371
|
||||
cluster-announce-bus-port 16371
|
||||
12
docker/3rd/redis/redis_cluster/conf/redis2/redis.conf
Normal file
12
docker/3rd/redis/redis_cluster/conf/redis2/redis.conf
Normal file
@@ -0,0 +1,12 @@
|
||||
port 6372
|
||||
requirepass 123456
|
||||
masterauth 123456
|
||||
protected-mode no
|
||||
daemonize no
|
||||
appendonly yes
|
||||
cluster-enabled yes
|
||||
cluster-config-file nodes.conf
|
||||
cluster-node-timeout 15000
|
||||
cluster-announce-ip 192.168.199.233
|
||||
cluster-announce-port 6372
|
||||
cluster-announce-bus-port 16372
|
||||
12
docker/3rd/redis/redis_cluster/conf/redis3/redis.conf
Normal file
12
docker/3rd/redis/redis_cluster/conf/redis3/redis.conf
Normal file
@@ -0,0 +1,12 @@
|
||||
port 6373
|
||||
requirepass 123456
|
||||
masterauth 123456
|
||||
protected-mode no
|
||||
daemonize no
|
||||
appendonly yes
|
||||
cluster-enabled yes
|
||||
cluster-config-file nodes.conf
|
||||
cluster-node-timeout 15000
|
||||
cluster-announce-ip 192.168.199.233
|
||||
cluster-announce-port 6373
|
||||
cluster-announce-bus-port 16373
|
||||
12
docker/3rd/redis/redis_cluster/conf/redis4/redis.conf
Normal file
12
docker/3rd/redis/redis_cluster/conf/redis4/redis.conf
Normal file
@@ -0,0 +1,12 @@
|
||||
port 6374
|
||||
requirepass 123456
|
||||
masterauth 123456
|
||||
protected-mode no
|
||||
daemonize no
|
||||
appendonly yes
|
||||
cluster-enabled yes
|
||||
cluster-config-file nodes.conf
|
||||
cluster-node-timeout 15000
|
||||
cluster-announce-ip 192.168.199.233
|
||||
cluster-announce-port 6374
|
||||
cluster-announce-bus-port 16374
|
||||
12
docker/3rd/redis/redis_cluster/conf/redis5/redis.conf
Normal file
12
docker/3rd/redis/redis_cluster/conf/redis5/redis.conf
Normal file
@@ -0,0 +1,12 @@
|
||||
port 6375
|
||||
requirepass 123456
|
||||
masterauth 123456
|
||||
protected-mode no
|
||||
daemonize no
|
||||
appendonly yes
|
||||
cluster-enabled yes
|
||||
cluster-config-file nodes.conf
|
||||
cluster-node-timeout 15000
|
||||
cluster-announce-ip 192.168.199.233
|
||||
cluster-announce-port 6375
|
||||
cluster-announce-bus-port 16375
|
||||
12
docker/3rd/redis/redis_cluster/conf/redis6/redis.conf
Normal file
12
docker/3rd/redis/redis_cluster/conf/redis6/redis.conf
Normal file
@@ -0,0 +1,12 @@
|
||||
port 6376
|
||||
requirepass 123456
|
||||
masterauth 123456
|
||||
protected-mode no
|
||||
daemonize no
|
||||
appendonly yes
|
||||
cluster-enabled yes
|
||||
cluster-config-file nodes.conf
|
||||
cluster-node-timeout 15000
|
||||
cluster-announce-ip 192.168.199.233
|
||||
cluster-announce-port 6376
|
||||
cluster-announce-bus-port 16376
|
||||
10
docker/3rd/redis/redis_cluster/create_cluster.sh
Executable file
10
docker/3rd/redis/redis_cluster/create_cluster.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
redis-cli -a 123456 --cluster create \
|
||||
192.168.199.233:6371 \
|
||||
192.168.199.233:6372 \
|
||||
192.168.199.233:6373 \
|
||||
192.168.199.233:6374 \
|
||||
192.168.199.233:6375 \
|
||||
192.168.199.233:6376 \
|
||||
--cluster-replicas 1
|
||||
127
docker/3rd/redis/redis_cluster/docker-compose.yaml
Normal file
127
docker/3rd/redis/redis_cluster/docker-compose.yaml
Normal file
@@ -0,0 +1,127 @@
|
||||
version: '3'
|
||||
services:
|
||||
redis1:
|
||||
restart: always
|
||||
image: redis:4
|
||||
container_name: redis1
|
||||
ports:
|
||||
- "6371:6371/tcp"
|
||||
- "16371:16371/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
- ./conf/redis1/redis.conf:/redis/redis.conf
|
||||
- ./data/redis1:/data
|
||||
command: redis-server /redis/redis.conf
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.00'
|
||||
memory: 512M
|
||||
|
||||
redis2:
|
||||
restart: always
|
||||
image: redis:4
|
||||
container_name: redis2
|
||||
ports:
|
||||
- "6372:6372/tcp"
|
||||
- "16372:16372/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
- ./conf/redis2/redis.conf:/redis/redis.conf
|
||||
- ./data/redis2:/data
|
||||
command: redis-server /redis/redis.conf
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.00'
|
||||
memory: 512M
|
||||
|
||||
redis3:
|
||||
restart: always
|
||||
image: redis:4
|
||||
container_name: redis3
|
||||
ports:
|
||||
- "6373:6373/tcp"
|
||||
- "16373:16373/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
- ./conf/redis3/redis.conf:/redis/redis.conf
|
||||
- ./data/redis3:/data
|
||||
command: redis-server /redis/redis.conf
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.00'
|
||||
memory: 512M
|
||||
|
||||
redis4:
|
||||
restart: always
|
||||
image: redis:4
|
||||
container_name: redis4
|
||||
ports:
|
||||
- "6374:6374/tcp"
|
||||
- "16374:16374/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
- ./conf/redis4/redis.conf:/redis/redis.conf
|
||||
- ./data/redis4:/data
|
||||
command: redis-server /redis/redis.conf
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.00'
|
||||
memory: 512M
|
||||
|
||||
redis5:
|
||||
restart: always
|
||||
image: redis:4
|
||||
container_name: redis5
|
||||
ports:
|
||||
- "6375:6375/tcp"
|
||||
- "16375:16375/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
- ./conf/redis5/redis.conf:/redis/redis.conf
|
||||
- ./data/redis5:/data
|
||||
command: redis-server /redis/redis.conf
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.00'
|
||||
memory: 512M
|
||||
|
||||
redis6:
|
||||
restart: always
|
||||
image: redis:4
|
||||
container_name: redis6
|
||||
ports:
|
||||
- "6376:6376/tcp"
|
||||
- "16376:16376/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
- ./conf/redis6/redis.conf:/redis/redis.conf
|
||||
- ./data/redis6:/data
|
||||
command: redis-server /redis/redis.conf
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.00'
|
||||
memory: 512M
|
||||
20
docker/3rd/redis/redis_strndalone/docker-compose.yaml
Normal file
20
docker/3rd/redis/redis_strndalone/docker-compose.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
version: '3'
|
||||
services:
|
||||
redis:
|
||||
restart: always
|
||||
image: redis:4
|
||||
container_name: redis
|
||||
ports:
|
||||
- "6379:6379/tcp"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
- ./data:/data
|
||||
command: redis-server --requirepass "123456" --save 60 1
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.00'
|
||||
memory: 512M
|
||||
Reference in New Issue
Block a user