上传启动脚本

This commit is contained in:
liwei 2022-09-21 16:42:15 +08:00
parent 2bb6f4de0f
commit 8c125ce343
3 changed files with 17 additions and 17 deletions

View File

@ -2,6 +2,7 @@ CGO_ENABLED=0
GO111MODULE=on GO111MODULE=on
GOOS=linux GOOS=linux
cd ../ cd ../
go build -o ./bin/cmd ./services/cmd/main.go
go build -o ./bin/mainte ./services/mainte/main.go go build -o ./bin/mainte ./services/mainte/main.go
go build -o ./bin/gateway ./services/gateway/main.go go build -o ./bin/gateway ./services/gateway/main.go
go build -o ./bin/worker ./services/worker/main.go go build -o ./bin/worker ./services/worker/main.go

View File

@ -1,47 +1,47 @@
{ {
"AreaId": "dfli01", "AreaId": "df03",
"ConsulAddr": [ "ConsulAddr": [
"10.0.0.9:10012" "10.0.0.9:10012"
], ],
"IsCross": false, "IsCross": false,
"BelongCrossServerId": "dflicross01", "BelongCrossServerId": "dfcross_2",
"LoaclDB": { "LoaclDB": {
"RedisIsCluster": false, "RedisIsCluster": false,
"RedisAddr": "10.0.0.9:10011", "RedisAddr": ["10.0.0.9:10011"],
"RedisPassword": "li13451234", "RedisPassword": "li13451234",
"RedisDB": 5, "RedisDB": 3,
"MongodbUrl": "mongodb://10.0.0.9:10013", "MongodbUrl": "mongodb://10.0.0.9:10013",
"MongodbDatabase": "dreamfactory5" "MongodbDatabase": "dreamfactory3"
}, },
"CrossDB": { "CrossDB": {
"RedisIsCluster": false, "RedisIsCluster": false,
"RedisAddr": "10.0.0.9:10011", "RedisAddr": ["10.0.0.9:10011"],
"RedisPassword": "li13451234", "RedisPassword": "li13451234",
"RedisDB": 6, "RedisDB": 12,
"MongodbUrl": "mongodb://10.0.0.9:10013", "MongodbUrl": "mongodb://10.0.0.9:10013",
"MongodbDatabase": "dreamfactory6" "MongodbDatabase": "dreamfactory12"
}, },
"Services": [ "Services": [
{ {
"ServiceType": "gateway", "ServiceType": "gateway",
"Host": "127.0.0.1", "Host": "127.0.0.1",
"Port": 9567, "Port": 9571,
"Loglevel": 5, "Loglevel": 5,
"MaxAgeTime": 7, "MaxAgeTime": 7,
"ListenPort": 7891 "ListenPort": 7895
}, },
{ {
"ServiceType": "mainte", "ServiceType": "mainte",
"Host": "127.0.0.1", "Host": "127.0.0.1",
"Port": 9568, "Port": 9572,
"Loglevel": 5, "Loglevel": 5,
"MaxAgeTime": 7, "MaxAgeTime": 7,
"ListenPort": 8000 "ListenPort": 7896
}, },
{ {
"ServiceType": "worker", "ServiceType": "worker",
"Host": "127.0.0.1", "Host": "127.0.0.1",
"Port": 9569, "Port": 9573,
"Loglevel": 5, "Loglevel": 5,
"MaxAgeTime": 7 "MaxAgeTime": 7
} }

View File

@ -4,12 +4,11 @@
start(){ start(){
echo "starting $SERVICE..." echo "starting $SERVICE..."
num=`ps -ef | grep conf | grep $SERVICE | grep -v grep | grep -v /bin/bash | wc -l`
num=`ps -ef | grep $SERVICE | grep -v grep | wc -l`
if [ $num -eq 0 ] if [ $num -eq 0 ]
then then
nohup $CMD > /dev/null 2>&1 & # nohup $CMD > /dev/null 2>&1 &
#nohup $CMD > $SERVICE.log 2>&1 & nohup $CMD > $SERVICE.log 2>&1 &
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
echo "start failed, please check the log!" echo "start failed, please check the log!"