From 6dcbc52e31d0cef61cc9b18b70822690a92e0381 Mon Sep 17 00:00:00 2001 From: agile6v Date: Mon, 1 Apr 2019 22:43:16 +0800 Subject: [PATCH] Update docker-compose.yml --- docker-compose.yml | 4 ++-- pkg/server/web_server.go | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4c768cf..bdcafad 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: slave: image: 'agile6v/squeeze:v0.1.0' - command: 'squeeze slave --grpcMasterAddr=master:9997 --masterAddr=master:9998 --grpcAddr=0.0.0.0:9991 --alsologtostderr -v=2' + command: 'squeeze slave --grpcMasterAddr=master:9997 --httpMasterAddr=master:9998 --alsologtostderr -v=2' depends_on: - master networks: @@ -20,7 +20,7 @@ services: web: image: 'agile6v/squeeze:v0.1.0' - command: 'squeeze web --type="sqlite" --masterAddr="http://master:9998" --alsologtostderr' + command: 'squeeze web --type="sqlite" --masterAddr="master:9998" --alsologtostderr' depends_on: - master networks: diff --git a/pkg/server/web_server.go b/pkg/server/web_server.go index 31f699d..f0098d4 100644 --- a/pkg/server/web_server.go +++ b/pkg/server/web_server.go @@ -42,8 +42,14 @@ func (s *WebServer) Initialize(args *ServerArgs) error { return err } + // check if the HttpMasterAddr is valid + _, _, err = util.GetHostPort(args.HttpMasterAddr) + if err != nil { + return err + } + api := &api.AppAPI{ - MasterAddr: s.args.HttpMasterAddr, + MasterAddr: fmt.Sprintf("http://%v", s.args.HttpMasterAddr), HTTPAddr: s.args.HTTPAddr, LocalAddr: ip + ":" + port, }