Compare commits
19 Commits
master
...
platform_1
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4aba5a194c | ||
![]() |
a7b5e9b435 | ||
![]() |
4ce3d7f51d | ||
![]() |
2d5612d0af | ||
![]() |
ad3650df71 | ||
![]() |
9acaf9e575 | ||
![]() |
c722df694a | ||
![]() |
1294779c9d | ||
![]() |
c3e5e33c59 | ||
![]() |
413a981418 | ||
![]() |
468866a486 | ||
![]() |
58031a6a38 | ||
![]() |
f7f89a24e8 | ||
![]() |
7d9ff07051 | ||
![]() |
ea0a654b47 | ||
![]() |
c6efcf8865 | ||
![]() |
c3ab75b87e | ||
![]() |
8d42994fd0 | ||
![]() |
8668026066 |
3
.gitignore
vendored
3
.gitignore
vendored
@ -10,10 +10,8 @@
|
||||
*.out
|
||||
|
||||
*.log
|
||||
bin/conf
|
||||
pb/proto
|
||||
.vscode/
|
||||
./bin/conf
|
||||
./bin/log
|
||||
./bin/mainte
|
||||
./bin/gateway
|
||||
@ -26,5 +24,6 @@ pb.bat
|
||||
cmd/v2/.cache.meta
|
||||
cmd/v2/my.db
|
||||
.idea/
|
||||
bin/conf
|
||||
bin/cross.json
|
||||
bin/gm.json
|
||||
|
@ -1,8 +0,0 @@
|
||||
set GOOS=linux
|
||||
set CGO_ENABLED=0
|
||||
cd ../
|
||||
del bin/mainte,bin/gateway,bin/worker
|
||||
go build -o ./bin/mainte ./services/mainte/main.go
|
||||
go build -o ./bin/gateway ./services/gateway/main.go
|
||||
go build -o ./bin/worker ./services/worker/main.go
|
||||
REM pause
|
@ -1,8 +0,0 @@
|
||||
SET CGO_ENABLED=0
|
||||
SET GOOS=windows
|
||||
SET GOARCH=amd64
|
||||
cd ../
|
||||
go build -o build/gateway.exe services/gateway/main.go
|
||||
go build -o build/worker.exe services/worker/main.go
|
||||
go build -o build/web.exe services/web/main.go
|
||||
go build -o build/dbservice.exe services/dbservice/main.go
|
27
bin/cross.json
Normal file
27
bin/cross.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"devcross01": {
|
||||
"AreaId": "devcross01",
|
||||
"LoaclDB": {
|
||||
"RedisIsCluster": false,
|
||||
"RedisAddr": [
|
||||
"10.0.0.9:10012"
|
||||
],
|
||||
"RedisPassword": "li13451234",
|
||||
"RedisDB": 2,
|
||||
"MongodbUrl": "mongodb://10.0.0.9:10013",
|
||||
"MongodbDatabase": "dreamfactory2"
|
||||
},
|
||||
"ServiceList": {
|
||||
"dev01": {
|
||||
"RedisIsCluster": false,
|
||||
"RedisAddr": [
|
||||
"10.0.0.9:10012"
|
||||
],
|
||||
"RedisPassword": "li13451234",
|
||||
"RedisDB": 1,
|
||||
"MongodbUrl": "mongodb://10.0.0.9:10013",
|
||||
"MongodbDatabase": "dreamfactory1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
version: '3.7'
|
||||
|
||||
# 申明同一个网络
|
||||
networks:
|
||||
net:
|
||||
name: net
|
||||
|
||||
# 游戏数据卷
|
||||
volumes:
|
||||
dreamfactory_consuldata:
|
||||
name: dreamfactory_consuldata
|
||||
dreamfactory_redisdata:
|
||||
name: dreamfactory_redisdata
|
||||
dreamfactory_mongodata:
|
||||
name: dreamfactory_mongodata
|
||||
# 服务
|
||||
services:
|
||||
redis:
|
||||
image: redis:latest
|
||||
container_name: dreamfactory_redis
|
||||
ports:
|
||||
- '10011:6379'
|
||||
networks:
|
||||
net:
|
||||
# 给网络取别名,可以用redis和cache找到
|
||||
aliases:
|
||||
- cache
|
||||
command: /etc/redis/redis.conf
|
||||
volumes:
|
||||
# 持久存储redis的数据
|
||||
- dreamfactory_redisdata:/data
|
||||
# 挂载本地配置文件
|
||||
- ./redis.conf:/etc/redis/redis.conf
|
||||
# 时间同步
|
||||
# - /etc/localtime:/etc/localtime
|
||||
consul:
|
||||
image: consul:latest
|
||||
container_name: dreamfactory_consul
|
||||
ports:
|
||||
- '10012:8500'
|
||||
command: consul agent -server -bootstrap -data-dir /consul/data -node=ylconsul -bind=0.0.0.0 -config-dir=/consul/config/ -client=0.0.0.0 -ui
|
||||
networks:
|
||||
net:
|
||||
# 给网络取别名,可以用consul和discovery找到
|
||||
aliases:
|
||||
- discovery
|
||||
volumes:
|
||||
- dreamfactory_consuldata:/consul/data
|
||||
mongo:
|
||||
image: mongo:latest
|
||||
container_name: dreamfactory_mongo
|
||||
ports:
|
||||
- '10013:27017'
|
||||
networks:
|
||||
net:
|
||||
# 给网络取别名,可以用mongodb和db找到
|
||||
aliases:
|
||||
- db
|
||||
command: ['mongod', '-f', '/etc/mongo/mongod.conf']
|
||||
# environment:
|
||||
# MONGO_INITDB_ROOT_USERNAME: liwei1dao
|
||||
# MONGO_INITDB_ROOT_PASSWORD: li13451234
|
||||
volumes:
|
||||
# 持久存储mongodb的数据
|
||||
- dreamfactory_mongodata:/data/db:rw
|
||||
- dreamfactory_mongodata:/data/configdb:rw
|
||||
# 挂载本地配置文件
|
||||
- ./mongod.conf:/etc/mongo/mongod.conf:rw
|
@ -1,48 +0,0 @@
|
||||
# mongod.conf
|
||||
|
||||
# for documentation of all options, see:
|
||||
# http://docs.mongodb.org/manual/reference/configuration-options/
|
||||
|
||||
# where to write logging data.
|
||||
# systemLog:
|
||||
# destination: file
|
||||
# logAppend: true
|
||||
# path: "/var/log/mongodb/mongod.log"
|
||||
|
||||
# Where and how to store data.
|
||||
storage:
|
||||
dbPath: /data/db
|
||||
journal:
|
||||
enabled: true
|
||||
wiredTiger:
|
||||
engineConfig:
|
||||
cacheSizeGB: 0.256
|
||||
# engine:
|
||||
# mmapv1:
|
||||
# wiredTiger:
|
||||
|
||||
# how the process runs
|
||||
# processManagement:
|
||||
# fork: false # fork and run in background
|
||||
# pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile
|
||||
# timeZoneInfo: /usr/share/zoneinfo
|
||||
|
||||
# network interfaces
|
||||
net:
|
||||
port: 27017
|
||||
bindIp: 0.0.0.0 # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
|
||||
|
||||
|
||||
#security:
|
||||
|
||||
#operationProfiling:
|
||||
|
||||
#replication:
|
||||
|
||||
#sharding:
|
||||
|
||||
## Enterprise-Only Options
|
||||
|
||||
#auditLog:
|
||||
|
||||
#snmp:
|
@ -1,37 +0,0 @@
|
||||
# Client port of 4222 on all interfaces
|
||||
port: 4222
|
||||
|
||||
# HTTP monitoring port
|
||||
monitor_port: 8222
|
||||
|
||||
# This is for clustering multiple servers together.
|
||||
cluster {
|
||||
|
||||
# Route connections to be received on any interface on port 6222
|
||||
port: 6222
|
||||
|
||||
# Routes are protected, so need to use them with --routes flag
|
||||
# e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
|
||||
# authorization {
|
||||
# user: ruser
|
||||
# password: T0pS3cr3t
|
||||
# timeout: 0.75
|
||||
# }
|
||||
|
||||
# Routes are actively solicited and connected to from this server.
|
||||
# This Docker image has none by default, but you can pass a
|
||||
# flag to the nats-server docker image to create one to an existing server.
|
||||
routes = []
|
||||
}
|
||||
|
||||
# max_connections
|
||||
max_connections: 100
|
||||
|
||||
# max_subscriptions (per connection)
|
||||
max_subscriptions: 1000
|
||||
|
||||
# maximum protocol control line
|
||||
max_control_line: 512
|
||||
|
||||
# maximum payload
|
||||
max_payload: 65536
|
@ -1,63 +0,0 @@
|
||||
user nginx;
|
||||
worker_processes 2;
|
||||
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 4096;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
|
||||
keepalive_timeout 120;
|
||||
|
||||
#gzip on;
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
#(配置请求体缓存区大小, 不配的话)
|
||||
}
|
||||
|
||||
stream {
|
||||
# redisd 代理
|
||||
upstream redis {
|
||||
hash $remote_addr consistent;
|
||||
server redis:6379 weight=5 max_fails=1 fail_timeout=10s;
|
||||
}
|
||||
server {
|
||||
listen 10001;
|
||||
proxy_pass redis;
|
||||
}
|
||||
# redisd 代理
|
||||
upstream mongo {
|
||||
hash $remote_addr consistent;
|
||||
server mongo:27017 weight=5 max_fails=1 fail_timeout=10s;
|
||||
}
|
||||
server {
|
||||
listen 10002;
|
||||
proxy_pass mongo;
|
||||
}
|
||||
# consul 代理
|
||||
upstream consul {
|
||||
hash $remote_addr consistent;
|
||||
server consul:8500 weight=5 max_fails=1 fail_timeout=10s;
|
||||
}
|
||||
server {
|
||||
listen 10003;
|
||||
proxy_pass consul;
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
BIN
bin/gateway
BIN
bin/gateway
Binary file not shown.
37
bin/gm.json
Normal file
37
bin/gm.json
Normal file
@ -0,0 +1,37 @@
|
||||
{
|
||||
"AreaId": "dev01",
|
||||
"AreaName":"测试服",
|
||||
"OpenServiceTime":"2022-04-01 12:03",
|
||||
"Channel":"channel_1",
|
||||
"Loglevel": 5,
|
||||
"MaxAgeTime": 7,
|
||||
"ConsulAddr": [
|
||||
"10.0.0.9:10012"
|
||||
],
|
||||
"IsCross": false,
|
||||
"BelongCrossServerId": "devcross01",
|
||||
"LoaclDB": {
|
||||
"RedisIsCluster": false,
|
||||
"RedisAddr": [
|
||||
"10.0.0.9:10011"
|
||||
],
|
||||
"RedisPassword": "li13451234",
|
||||
"RedisDB": 1,
|
||||
"MongodbUrl": "mongodb://10.0.0.9:10013",
|
||||
"MongodbDatabase": "dreamfactory1"
|
||||
},
|
||||
"Mainte": "127.0.0.1:7896",
|
||||
"MaintePort": 9572,
|
||||
"Gateways": [
|
||||
"127.0.0.1:7895",
|
||||
"127.0.0.1:7896"
|
||||
],
|
||||
"GatewayPorts": [
|
||||
9571,
|
||||
7812
|
||||
],
|
||||
"Workers": [
|
||||
"127.0.0.1:9573",
|
||||
"127.0.0.1:9573"
|
||||
]
|
||||
}
|
BIN
bin/mainte
BIN
bin/mainte
Binary file not shown.
4
bin/start.py
Normal file
4
bin/start.py
Normal file
@ -0,0 +1,4 @@
|
||||
import os
|
||||
|
||||
txt = os.system("cd /data/3dmenggongchang/dreamworks/ && ./start.sh")
|
||||
print txt
|
@ -1,9 +0,0 @@
|
||||
./stup.sh start dfcross_1_worker0 worker ./conf/dfcross_1_worker0.yaml
|
||||
sleep 1
|
||||
./stup.sh start dfcross_1_mainte mainte ./conf/dfcross_1_mainte.yaml
|
||||
sleep 1
|
||||
./stup.sh start df01_mainte mainte ./conf/df01_mainte.yaml
|
||||
sleep 1
|
||||
./stup.sh start df01_worker0 worker ./conf/df01_worker0.yaml
|
||||
sleep 1
|
||||
./stup.sh start df01_gateway0 gateway ./conf/df01_gateway0.yaml
|
@ -1,9 +0,0 @@
|
||||
./stup.sh stop df01_gateway0
|
||||
|
||||
./stup.sh stop df01_mainte
|
||||
|
||||
./stup.sh stop df01_worker0
|
||||
|
||||
./stup.sh stop dfcross_1_worker0
|
||||
|
||||
./stup.sh stop dfcross_1_mainte
|
BIN
bin/worker
BIN
bin/worker
Binary file not shown.
Loading…
Reference in New Issue
Block a user