Increase default TTL and heartbeat value

Increases the default ttl and heartbeat value for discovery.
Because the node will still be listed for a long period on
`docker info`, there is now a Status to know if a node is
in the healthy or unhealthy state.

Signed-off-by: Alexandre Beslic <abronan@docker.com>
This commit is contained in:
Alexandre Beslic 2015-12-04 17:11:33 -08:00
parent 6aa6f76f3e
commit f21efa4337
3 changed files with 11 additions and 2 deletions

View File

@ -48,12 +48,12 @@ var (
}
flHeartBeat = cli.StringFlag{
Name: "heartbeat",
Value: "20s",
Value: "60s",
Usage: "period between each heartbeat",
}
flTTL = cli.StringFlag{
Name: "ttl",
Value: "60s",
Value: "180s",
Usage: "sets the expiration of an ephemeral node",
}
flTimeout = cli.StringFlag{

View File

@ -184,6 +184,14 @@ func (e *Engine) IsHealthy() bool {
return e.healthy
}
// Status returns the health status of the Engine: Healthy or Unhealthy
func (e *Engine) Status() string {
if e.healthy {
return "Healthy"
}
return "Unhealthy"
}
// Gather engine specs (CPU, memory, constraints, ...).
func (e *Engine) updateSpecs() error {
info, err := e.client.Info()

View File

@ -734,6 +734,7 @@ func (c *Cluster) Info() [][]string {
for _, engine := range engines {
info = append(info, []string{engine.Name, engine.Addr})
info = append(info, []string{" └ Status", engine.Status()})
info = append(info, []string{" └ Containers", fmt.Sprintf("%d", len(engine.Containers()))})
info = append(info, []string{" └ Reserved CPUs", fmt.Sprintf("%d / %d", engine.UsedCpus(), engine.TotalCpus())})
info = append(info, []string{" └ Reserved Memory", fmt.Sprintf("%s / %s", units.BytesSize(float64(engine.UsedMemory())), units.BytesSize(float64(engine.TotalMemory())))})