上传平台版本分支

This commit is contained in:
liwei1dao 2022-09-19 17:37:52 +08:00
parent 714da99c01
commit 8668026066
12 changed files with 232 additions and 1612 deletions

2
.gitignore vendored
View File

@ -10,10 +10,8 @@
*.out *.out
*.log *.log
bin/conf
pb/proto pb/proto
.vscode/ .vscode/
./bin/conf
./bin/log ./bin/log
./bin/mainte ./bin/mainte
./bin/gateway ./bin/gateway

View File

@ -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

View File

@ -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

45
bin/conf/gateway_1.yaml Normal file
View File

@ -0,0 +1,45 @@
id : "gateway_1" #服务的唯一id 在集群服务下不能重复即可 建议配置文件名与服务id一致
ip : "127.0.0.1" #运行主机Ip 集群通信中 按ip节点通行的查询字段 此字段可以注释掉 注释后取当前运行主机公网ip地址
port : 9567 #服务监听端口 RPC服务
tag : "df01" #服务集群标签 相同标签 且sys.registry 和 sys.rpc 配置一致 即可互相发现和通信
type : "gateway" #服务类型 相同服务类型相同 如 多个login 服务 相同服务多开 服务类型一致
category : "BusinessService" #服务类别 例如 网关服务器 或者 游戏服务器 以及普通业务服务器
version : 1.0 #服务版本 多服务器相同的服务类型 高版本比低版本拥有更高的访问优先级 使用场景 热更新机制
#系统配置
sys:
log: #日志系统
FileName: "./log/gateway_1.log" #日志文件存放地址
Loglevel: 5 #日志文件输出级别
MaxAgeTime: 7 #日志文件最多保留天数
IsDebug: true #是否开发模式
rpcx: #rpcx 系统配置
Debug: true
RpcxStartType: 1 #0 服务端 1是客户端
ConsulServers: ["10.0.0.9:10012"]
db: #存储系统
Loacl:
Enabled: true #是否生效
RedisIsCluster: false #是否是集群
RedisAddr: ["10.0.0.9:10011"]
RedisPassword: "li13451234"
RedisDB: 1
MongodbUrl: "mongodb://10.0.0.9:10013"
MongodbDatabase: "dreamfactory1"
Cross:
Enabled: true #是否生效
RedisIsCluster: false #是否是集群
RedisAddr: ["10.0.0.9:10011"]
RedisPassword: "li13451234"
RedisDB: 2
MongodbUrl: "mongodb://10.0.0.9:10013"
MongodbDatabase: "dreamfactory2"
configure: #存储系统
ConfigurePath: "./json"
#模块配置
modules:
gateway:
ListenPort: 7891
SpanServiceTag: "dfcross" #服务服务集群
Debug: true

47
bin/conf/mainte.yaml Normal file
View File

@ -0,0 +1,47 @@
id : "mainte" #服务的唯一id 在集群服务下不能重复即可 建议配置文件名与服务id一致
ip : "127.0.0.1" #运行主机Ip 集群通信中 按ip节点通行的查询字段 此字段可以注释掉 注释后取当前运行主机公网ip地址
port : 9568 #服务监听端口 RPC服务
tag : "df01" #服务集群标签 相同标签 且sys.registry 和 sys.rpc 配置一致 即可互相发现和通信
type : "mainte" #服务类型 相同服务类型相同 如 多个login 服务 相同服务多开 服务类型一致
category : "BusinessService" #服务类别 例如 网关服务器 或者 游戏服务器 以及普通业务服务器
version : 1.0 #服务版本 多服务器相同的服务类型 高版本比低版本拥有更高的访问优先级 使用场景 热更新机制
#系统配置
sys:
log: #日志系统
FileName: "./log/mainte.log" #日志文件存放地址
Loglevel: 5 #日志文件输出级别
MaxAgeTime: 7 #日志文件最多保留天数
IsDebug: true #是否开发模式
rpcx: #rpcx 系统配置
RpcxStartType: 0 #启动rpc服务端模式
ConsulServers: ["10.0.0.9:10012"]
db: #存储系统
Loacl:
Enabled: true #是否生效
RedisIsCluster: false #是否是集群
RedisAddr: ["10.0.0.9:10011"]
RedisPassword: "li13451234"
RedisDB: 1
MongodbUrl: "mongodb://10.0.0.9:10013"
MongodbDatabase: "dreamfactory1"
Cross:
Enabled: true #是否生效
RedisIsCluster: false #是否是集群
RedisAddr: ["10.0.0.9:10011"]
RedisPassword: "li13451234"
RedisDB: 2
MongodbUrl: "mongodb://10.0.0.9:10013"
MongodbDatabase: "dreamfactory2"
configure: #存储系统
ConfigurePath: "./json"
#模块配置
modules:
dbservice:
Debug: true
web:
Debug: true
WebDir: "./dist"
Port: 8000
Key: "@234%67g12q4*67m12#4l67!"
WebDir: "./dist"

71
bin/conf/worker_1.yaml Normal file
View File

@ -0,0 +1,71 @@
id : "worker_1" #服务的唯一id 在集群服务下不能重复即可 建议配置文件名与服务id一致
ip : "127.0.0.1" #运行主机Ip 集群通信中 按ip节点通行的查询字段 此字段可以注释掉 注释后取当前运行主机公网ip地址
port : 9569 #服务监听端口 RPC服务
tag : "df01" #服务集群标签 相同标签 且sys.registry 和 sys.rpc 配置一致 即可互相发现和通信
type : "worker" #服务类型 相同服务类型相同 如 多个login 服务 相同服务多开 服务类型一致
category : "BusinessService" #服务类别 例如 网关服务器 或者 游戏服务器 以及普通业务服务器
version : 1.0 #服务版本 多服务器相同的服务类型 高版本比低版本拥有更高的访问优先级 使用场景 热更新机制
comps:
SC_GateRouteComp:
Debug: true
#系统配置
sys:
log: #日志系统
FileName: "./log/worker_1.log" #日志文件存放地址
Loglevel: 5 #日志文件输出级别
MaxAgeTime: 7 #日志文件最多保留天数
IsDebug: true #是否开发模式
rpcx: #rpcx 系统配置
Debug: true
RpcxStartType: 0 #启动rpc服务端模式
ConsulServers: ["10.0.0.9:10012"]
db: #存储系统
Loacl:
Enabled: true #是否生效
RedisIsCluster: false #是否是集群
RedisAddr: ["10.0.0.9:10011"]
RedisPassword: "li13451234"
RedisDB: 1
MongodbUrl: "mongodb://10.0.0.9:10013"
MongodbDatabase: "dreamfactory1"
Cross:
Enabled: true #是否生效
RedisIsCluster: false #是否是集群
RedisAddr: ["10.0.0.9:10011"]
RedisPassword: "li13451234"
RedisDB: 2
MongodbUrl: "mongodb://10.0.0.9:10013"
MongodbDatabase: "dreamfactory2"
configure: #存储系统
ConfigurePath: "./json"
#模块配置
modules:
modules:
user:
Debug: true
pack:
Debug: true
mail:
Debug: true
friend:
Debug: true
equipment:
Debug: true
hero:
Debug: true
forum:
Debug: true
items:
Debug: true
shop:
Debug: true
task:
Debug: true
story:
Debug: true
notify:
Debug: true
chat:
Debug: true
GM: true

View File

@ -0,0 +1,69 @@
id : "worker_cross_1" #服务的唯一id 在集群服务下不能重复即可 建议配置文件名与服务id一致
ip : "127.0.0.1" #运行主机Ip 集群通信中 按ip节点通行的查询字段 此字段可以注释掉 注释后取当前运行主机公网ip地址
port : 9570 #服务监听端口 RPC服务
tag : "dfcross" #服务集群标签 相同标签 且sys.registry 和 sys.rpc 配置一致 即可互相发现和通信
type : "worker" #服务类型 相同服务类型相同 如 多个login 服务 相同服务多开 服务类型一致
category : "BusinessService" #服务类别 例如 网关服务器 或者 游戏服务器 以及普通业务服务器
version : 1.0 #服务版本 多服务器相同的服务类型 高版本比低版本拥有更高的访问优先级 使用场景 热更新机制
comps:
SC_GateRouteComp:
Debug: true
#系统配置
sys:
log: #日志系统
FileName: "./log/worker_cross_1.log" #日志文件存放地址
Loglevel: 5 #日志文件输出级别
MaxAgeTime: 7 #日志文件最多保留天数
IsDebug: true #是否开发模式
rpcx: #rpcx 系统配置
Debug: true
RpcxStartType: 0 #启动rpc服务端模式
ConsulServers: ["10.0.0.9:10012"]
db: #存储系统
Loacl:
Enabled: true #是否生效
RedisIsCluster: false #是否是集群
RedisAddr: ["10.0.0.910011"]
RedisPassword: "li13451234"
RedisDB: 2
MongodbUrl: "mongodb://10.0.0.9:10013"
MongodbDatabase: "dreamfactory2"
ServerList:
df01: #1 区
Enabled: true #是否生效
RedisIsCluster: false #是否是集群
RedisAddr: ["10.0.0.9:10011"]
RedisPassword: "li13451234"
RedisDB: 1
MongodbUrl: "mongodb://10.0.0.9:10013"
MongodbDatabase: "dreamfactory1"
configure: #存储系统
ConfigurePath: "./json"
#模块配置
modules:
modules:
user:
Debug: true
pack:
Debug: true
mail:
Debug: true
friend:
Debug: true
equipment:
Debug: true
hero:
Debug: true
forum:
Debug: true
items:
Debug: true
shop:
Debug: true
task:
Debug: true
story:
Debug: true
notify:
Debug: true

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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