上传后台运行脚本
This commit is contained in:
parent
93278a51c0
commit
7287d9e5fb
1
.gitignore
vendored
1
.gitignore
vendored
@ -18,4 +18,5 @@ bin/conf
|
|||||||
./bin/gateway
|
./bin/gateway
|
||||||
./bin/worker
|
./bin/worker
|
||||||
~$*.xlsx
|
~$*.xlsx
|
||||||
|
*.pid
|
||||||
cmd/luban/
|
cmd/luban/
|
BIN
bin/dbservice
Executable file
BIN
bin/dbservice
Executable file
Binary file not shown.
@ -7,17 +7,17 @@ networks:
|
|||||||
|
|
||||||
# 游戏数据卷
|
# 游戏数据卷
|
||||||
volumes:
|
volumes:
|
||||||
consuldata:
|
dreamfactory_consuldata:
|
||||||
name: consuldata
|
name: dreamfactory_consuldata
|
||||||
redisdata:
|
dreamfactory_redisdata:
|
||||||
name: redisdata
|
name: dreamfactory_redisdata
|
||||||
mongodata:
|
dreamfactory_mongodata:
|
||||||
name: mongodata
|
name: dreamfactory_mongodata
|
||||||
# 服务
|
# 服务
|
||||||
services:
|
services:
|
||||||
redis:
|
redis:
|
||||||
image: redis:latest
|
image: redis:latest
|
||||||
container_name: redis
|
container_name: dreamfactory_redis
|
||||||
ports:
|
ports:
|
||||||
- '10011:6379'
|
- '10011:6379'
|
||||||
networks:
|
networks:
|
||||||
@ -28,14 +28,14 @@ services:
|
|||||||
command: /etc/redis/redis.conf
|
command: /etc/redis/redis.conf
|
||||||
volumes:
|
volumes:
|
||||||
# 持久存储redis的数据
|
# 持久存储redis的数据
|
||||||
- redisdata:/data
|
- dreamfactory_redisdata:/data
|
||||||
# 挂载本地配置文件
|
# 挂载本地配置文件
|
||||||
- ./redis.conf:/etc/redis/redis.conf
|
- ./redis.conf:/etc/redis/redis.conf
|
||||||
# 时间同步
|
# 时间同步
|
||||||
# - /etc/localtime:/etc/localtime
|
# - /etc/localtime:/etc/localtime
|
||||||
consul:
|
consul:
|
||||||
image: consul:latest
|
image: consul:latest
|
||||||
container_name: consul
|
container_name: dreamfactory_consul
|
||||||
ports:
|
ports:
|
||||||
- '10012:8500'
|
- '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
|
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
|
||||||
@ -45,10 +45,10 @@ services:
|
|||||||
aliases:
|
aliases:
|
||||||
- discovery
|
- discovery
|
||||||
volumes:
|
volumes:
|
||||||
- consuldata:/consul/data
|
- dreamfactory_consuldata:/consul/data
|
||||||
mongo:
|
mongo:
|
||||||
image: mongo:latest
|
image: mongo:latest
|
||||||
container_name: mongo
|
container_name: dreamfactory_mongo
|
||||||
ports:
|
ports:
|
||||||
- '10013:27017'
|
- '10013:27017'
|
||||||
networks:
|
networks:
|
||||||
@ -62,7 +62,7 @@ services:
|
|||||||
# MONGO_INITDB_ROOT_PASSWORD: li13451234
|
# MONGO_INITDB_ROOT_PASSWORD: li13451234
|
||||||
volumes:
|
volumes:
|
||||||
# 持久存储mongodb的数据
|
# 持久存储mongodb的数据
|
||||||
- mongodata:/data/db:rw
|
- dreamfactory_mongodata:/data/db:rw
|
||||||
- mongodata:/data/configdb:rw
|
- dreamfactory_mongodata:/data/configdb:rw
|
||||||
# 挂载本地配置文件
|
# 挂载本地配置文件
|
||||||
- ./mongod.conf:/etc/mongo/mongod.conf:rw
|
- ./mongod.conf:/etc/mongo/mongod.conf:rw
|
BIN
bin/gateway
Executable file
BIN
bin/gateway
Executable file
Binary file not shown.
50
bin/stup.sh
Executable file
50
bin/stup.sh
Executable file
@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
SERVICE=$2
|
||||||
|
CMD="./$2 -conf $3"
|
||||||
|
|
||||||
|
start(){
|
||||||
|
echo "starting..."
|
||||||
|
nohup $CMD > /dev/null 2>&1 &
|
||||||
|
# nohup $CMD >output.log 2>&1 &
|
||||||
|
if [ $? -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "start failed, please check the log!"
|
||||||
|
exit $?
|
||||||
|
else
|
||||||
|
echo $! > $SERVICE.pid
|
||||||
|
echo "start success"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
stop(){
|
||||||
|
echo "stopping..."
|
||||||
|
kill -9 `cat $SERVICE.pid`
|
||||||
|
if [ $? -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "stop failed, may be $SERVICE isn't running"
|
||||||
|
exit $?
|
||||||
|
else
|
||||||
|
rm -rf $SERVICE.pid
|
||||||
|
echo "stop success"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
restart(){
|
||||||
|
stop&&start
|
||||||
|
}
|
||||||
|
status(){
|
||||||
|
num=`ps -ef | grep $SERVICE | grep -v grep | wc -l`
|
||||||
|
if [ $num -eq 0 ]
|
||||||
|
then
|
||||||
|
echo "$SERVICE isn't running"
|
||||||
|
else
|
||||||
|
echo "$SERVICE is running"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
case $1 in
|
||||||
|
start) start ;;
|
||||||
|
stop) stop ;;
|
||||||
|
restart) restart ;;
|
||||||
|
status) status ;;
|
||||||
|
*) echo "Usage: $0 {start|stop|restart|status}" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
BIN
bin/worker
Executable file
BIN
bin/worker
Executable file
Binary file not shown.
@ -8,11 +8,9 @@ import (
|
|||||||
"go_dreamfactory/lego/base"
|
"go_dreamfactory/lego/base"
|
||||||
"go_dreamfactory/lego/core"
|
"go_dreamfactory/lego/core"
|
||||||
"go_dreamfactory/lego/core/cbase"
|
"go_dreamfactory/lego/core/cbase"
|
||||||
"go_dreamfactory/lego/sys/cron"
|
|
||||||
"go_dreamfactory/lego/sys/event"
|
"go_dreamfactory/lego/sys/event"
|
||||||
"go_dreamfactory/lego/sys/log"
|
"go_dreamfactory/lego/sys/log"
|
||||||
"go_dreamfactory/lego/sys/rpcx"
|
"go_dreamfactory/lego/sys/rpcx"
|
||||||
|
|
||||||
"github.com/smallnest/rpcx/client"
|
"github.com/smallnest/rpcx/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -116,7 +114,6 @@ func (this *RPCXService) Destroy() (err error) {
|
|||||||
if err = rpcx.Stop(); err != nil {
|
if err = rpcx.Stop(); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
cron.Stop()
|
|
||||||
err = this.ServiceBase.Destroy()
|
err = this.ServiceBase.Destroy()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
0
linux_bulid.sh
Normal file → Executable file
0
linux_bulid.sh
Normal file → Executable file
Loading…
Reference in New Issue
Block a user