Fix master

Signed-off-by: neza2017 <yefu.chen@zilliz.com>
pull/4973/head^2
neza2017 2021-01-26 17:47:38 +08:00 committed by yefu.chen
parent 0b1c4f0420
commit c4f4ae8627
2 changed files with 14 additions and 0 deletions

View File

@ -12,6 +12,7 @@ import (
dnc "github.com/zilliztech/milvus-distributed/internal/distributed/datanode"
dsc "github.com/zilliztech/milvus-distributed/internal/distributed/dataservice"
msc "github.com/zilliztech/milvus-distributed/internal/distributed/masterservice"
ms "github.com/zilliztech/milvus-distributed/internal/masterservice"
"github.com/zilliztech/milvus-distributed/internal/proto/commonpb"
"github.com/zilliztech/milvus-distributed/internal/proto/internalpb2"
)
@ -32,6 +33,7 @@ func main() {
log.Println("Datanode is", dn.Params.NodeID)
// --- Master Service Client ---
ms.Params.Init()
log.Println("Master service address:", dn.Params.MasterAddress)
masterClient, err := msc.NewGrpcClient(dn.Params.MasterAddress, 20*time.Second)
if err != nil {

View File

@ -717,6 +717,18 @@ func (c *Core) GetComponentStates() (*internalpb2.ComponentStates, error) {
StateCode: code,
ExtraInfo: nil,
},
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
Reason: "",
},
SubcomponentStates: []*internalpb2.ComponentInfo{
{
NodeID: int64(Params.NodeID),
Role: typeutil.MasterServiceRole,
StateCode: code,
ExtraInfo: nil,
},
},
}, nil
}