blob: 73270271051a19f319e0b3cb43cca449898dc0f5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Author: arnej
package configserver
import (
"fmt"
"github.com/vespa-engine/vespa/client/go/internal/admin/defaults"
"github.com/vespa-engine/vespa/client/go/internal/admin/trace"
"github.com/vespa-engine/vespa/client/go/internal/util"
)
func checkIsConfigserver(myname string) {
onlyHosts := defaults.VespaConfigserverHosts()
for _, hn := range onlyHosts {
if hn == "localhost" || hn == myname {
trace.Debug("should run configserver:", hn)
return
}
}
trace.Warning("only these hosts should run a config server:", onlyHosts)
util.JustExitMsg(fmt.Sprintf("this host [%s] should not run a config server", myname))
}
|