diff --git a/.gitignore b/.gitignore index cfbc91300..7d55a4ad9 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,5 @@ bin/conf ./bin/gateway ./bin/worker ~$*.xlsx +*.pid cmd/luban/ \ No newline at end of file diff --git a/bin/dbservice b/bin/dbservice new file mode 100755 index 000000000..cc4ee108e Binary files /dev/null and b/bin/dbservice differ diff --git a/bin/docker_dreamfactory/docker-compose.yml b/bin/docker_dreamfactory/docker-compose.yml index c044fd657..12db05765 100644 --- a/bin/docker_dreamfactory/docker-compose.yml +++ b/bin/docker_dreamfactory/docker-compose.yml @@ -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 \ No newline at end of file diff --git a/bin/gateway b/bin/gateway new file mode 100755 index 000000000..5690b2c4f Binary files /dev/null and b/bin/gateway differ diff --git a/bin/stup.sh b/bin/stup.sh new file mode 100755 index 000000000..08bcd3127 --- /dev/null +++ b/bin/stup.sh @@ -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 \ No newline at end of file diff --git a/bin/worker b/bin/worker new file mode 100755 index 000000000..1e392f822 Binary files /dev/null and b/bin/worker differ diff --git a/lego/base/rpcx/service.go b/lego/base/rpcx/service.go index 2df101975..f541eda5e 100644 --- a/lego/base/rpcx/service.go +++ b/lego/base/rpcx/service.go @@ -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 } diff --git a/linux_bulid.sh b/linux_bulid.sh old mode 100644 new mode 100755