More debug information for connecting to master
This commit is contained in:
@@ -53,6 +53,7 @@ func (mn *MasterNodes) findMaster() (string, error) {
|
|||||||
}
|
}
|
||||||
if mn.lastNode < 0 {
|
if mn.lastNode < 0 {
|
||||||
for _, m := range mn.nodes {
|
for _, m := range mn.nodes {
|
||||||
|
glog.V(4).Infof("Listing masters on %s", m)
|
||||||
if masters, e := operation.ListMasters(m); e == nil {
|
if masters, e := operation.ListMasters(m); e == nil {
|
||||||
if len(masters) == 0 {
|
if len(masters) == 0 {
|
||||||
continue
|
continue
|
||||||
@@ -61,6 +62,8 @@ func (mn *MasterNodes) findMaster() (string, error) {
|
|||||||
mn.lastNode = rand.Intn(len(mn.nodes))
|
mn.lastNode = rand.Intn(len(mn.nodes))
|
||||||
glog.V(2).Info("current master node is :", mn.nodes[mn.lastNode])
|
glog.V(2).Info("current master node is :", mn.nodes[mn.lastNode])
|
||||||
break
|
break
|
||||||
|
} else {
|
||||||
|
glog.V(4).Infof("Failed listing masters on %s: %v", m, e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -308,6 +311,7 @@ func (s *Store) SendHeartbeatToMaster() (masterNode string, secretKey security.S
|
|||||||
}
|
}
|
||||||
|
|
||||||
joinUrl := "http://" + masterNode + "/dir/join"
|
joinUrl := "http://" + masterNode + "/dir/join"
|
||||||
|
glog.V(4).Infof("Connecting to %s ...", joinUrl)
|
||||||
|
|
||||||
jsonBlob, err := util.PostBytes(joinUrl, data)
|
jsonBlob, err := util.PostBytes(joinUrl, data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -64,10 +64,12 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string,
|
|||||||
go func() {
|
go func() {
|
||||||
connected := true
|
connected := true
|
||||||
|
|
||||||
|
glog.V(0).Infof("Volume server bootstraps with master %s", vs.GetMasterNode())
|
||||||
vs.store.SetBootstrapMaster(vs.GetMasterNode())
|
vs.store.SetBootstrapMaster(vs.GetMasterNode())
|
||||||
vs.store.SetDataCenter(vs.dataCenter)
|
vs.store.SetDataCenter(vs.dataCenter)
|
||||||
vs.store.SetRack(vs.rack)
|
vs.store.SetRack(vs.rack)
|
||||||
for {
|
for {
|
||||||
|
glog.V(4).Infof("Volume server sending to master %s", vs.GetMasterNode())
|
||||||
master, secretKey, err := vs.store.SendHeartbeatToMaster()
|
master, secretKey, err := vs.store.SendHeartbeatToMaster()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if !connected {
|
if !connected {
|
||||||
|
|||||||
Reference in New Issue
Block a user