上传后台运行脚本
This commit is contained in:
parent
93278a51c0
commit
7287d9e5fb
1
.gitignore
vendored
1
.gitignore
vendored
@ -18,4 +18,5 @@ bin/conf
|
||||
./bin/gateway
|
||||
./bin/worker
|
||||
~$*.xlsx
|
||||
*.pid
|
||||
cmd/luban/
|
BIN
bin/dbservice
Executable file
BIN
bin/dbservice
Executable file
Binary file not shown.
@ -7,17 +7,17 @@ networks:
|
||||
|
||||
# 游戏数据卷
|
||||
volumes:
|
||||
consuldata:
|
||||
name: consuldata
|
||||
redisdata:
|
||||
name: redisdata
|
||||
mongodata:
|
||||
name: mongodata
|
||||
dreamfactory_consuldata:
|
||||
name: dreamfactory_consuldata
|
||||
dreamfactory_redisdata:
|
||||
name: dreamfactory_redisdata
|
||||
dreamfactory_mongodata:
|
||||
name: dreamfactory_mongodata
|
||||
# 服务
|
||||
services:
|
||||
redis:
|
||||
image: redis:latest
|
||||
container_name: redis
|
||||
container_name: dreamfactory_redis
|
||||
ports:
|
||||
- '10011:6379'
|
||||
networks:
|
||||
@ -28,14 +28,14 @@ services:
|
||||
command: /etc/redis/redis.conf
|
||||
volumes:
|
||||
# 持久存储redis的数据
|
||||
- redisdata:/data
|
||||
- dreamfactory_redisdata:/data
|
||||
# 挂载本地配置文件
|
||||
- ./redis.conf:/etc/redis/redis.conf
|
||||
# 时间同步
|
||||
# - /etc/localtime:/etc/localtime
|
||||
consul:
|
||||
image: consul:latest
|
||||
container_name: consul
|
||||
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
|
||||
@ -45,10 +45,10 @@ services:
|
||||
aliases:
|
||||
- discovery
|
||||
volumes:
|
||||
- consuldata:/consul/data
|
||||
- dreamfactory_consuldata:/consul/data
|
||||
mongo:
|
||||
image: mongo:latest
|
||||
container_name: mongo
|
||||
container_name: dreamfactory_mongo
|
||||
ports:
|
||||
- '10013:27017'
|
||||
networks:
|
||||
@ -62,7 +62,7 @@ services:
|
||||
# MONGO_INITDB_ROOT_PASSWORD: li13451234
|
||||
volumes:
|
||||
# 持久存储mongodb的数据
|
||||
- mongodata:/data/db:rw
|
||||
- mongodata:/data/configdb:rw
|
||||
- dreamfactory_mongodata:/data/db:rw
|
||||
- dreamfactory_mongodata:/data/configdb: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/core"
|
||||
"go_dreamfactory/lego/core/cbase"
|
||||
"go_dreamfactory/lego/sys/cron"
|
||||
"go_dreamfactory/lego/sys/event"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/lego/sys/rpcx"
|
||||
|
||||
"github.com/smallnest/rpcx/client"
|
||||
)
|
||||
|
||||
@ -116,7 +114,6 @@ func (this *RPCXService) Destroy() (err error) {
|
||||
if err = rpcx.Stop(); err != nil {
|
||||
return
|
||||
}
|
||||
cron.Stop()
|
||||
err = this.ServiceBase.Destroy()
|
||||
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