Allow server to start if one of local nodes in docker/kubernetes setup is resolved (#7452)

Allow server to start if one of the local nodes in docker/kubernetes setup is successfully resolved

- The rule is that we need atleast one local node to work. We dont need to resolve the
  rest at that point.

- In a non-orchestrational setup, we fail if we do not have atleast one local node up
  and running.

- In an orchestrational setup (docker-swarm and kubernetes), We retry with a sleep of 5
  seconds until any one local node shows up.

Fixes #6995
This commit is contained in:
Praveen raj Mani
2019-04-19 22:56:44 +05:30
committed by kannappanr
parent d42496cc74
commit d96584ef58
6 changed files with 150 additions and 76 deletions

View File

@@ -200,6 +200,8 @@ func serverMain(ctx *cli.Context) {
cli.ShowCommandHelpAndExit(ctx, "server", 1)
}
signal.Notify(globalOSSignalCh, os.Interrupt, syscall.SIGTERM)
// Disable logging until server initialization is complete, any
// error during initialization will be shown as a fatal message
logger.Disable = true
@@ -305,8 +307,6 @@ func serverMain(ctx *cli.Context) {
globalHTTPServerErrorCh <- globalHTTPServer.Start()
}()
signal.Notify(globalOSSignalCh, os.Interrupt, syscall.SIGTERM)
newObject, err := newObjectLayer(globalEndpoints)
if err != nil {
// Stop watching for any certificate changes.