|
|
|
@ -46,7 +46,7 @@ import (
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
// defaultCfgPath is the default path of the configuration file
|
|
|
|
|
// defaultCfgPath is the default path of the configuration file.
|
|
|
|
|
defaultCfgPath = "../../../../../config/config.yaml"
|
|
|
|
|
minioHealthCheckDuration = 1
|
|
|
|
|
maxRetry = 100
|
|
|
|
@ -66,6 +66,7 @@ func initCfg() error {
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return yaml.Unmarshal(data, &config.Config)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -79,6 +80,7 @@ func main() {
|
|
|
|
|
|
|
|
|
|
if err := initCfg(); err != nil {
|
|
|
|
|
fmt.Printf("Read config failed: %v\n", err)
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -111,6 +113,7 @@ func main() {
|
|
|
|
|
|
|
|
|
|
if allSuccess {
|
|
|
|
|
successPrint("All components started successfully!")
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -126,9 +129,11 @@ func exactIP(urll string) string {
|
|
|
|
|
if strings.HasSuffix(host, ":") {
|
|
|
|
|
host = host[0 : len(host)-1]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return host
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func checkMysql() error {
|
|
|
|
|
var sqlDB *sql.DB
|
|
|
|
|
defer func() {
|
|
|
|
@ -148,6 +153,7 @@ func checkMysql() error {
|
|
|
|
|
return errs.Wrap(err)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -177,6 +183,7 @@ func checkMongo() error {
|
|
|
|
|
return errs.Wrap(err)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -209,6 +216,7 @@ func checkMinio() error {
|
|
|
|
|
return ErrConfig.Wrap("apiURL or Minio SignEndpoint endpoint contain 127.0.0.1")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -236,6 +244,7 @@ func checkRedis() error {
|
|
|
|
|
if err != nil {
|
|
|
|
|
return errs.Wrap(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -260,6 +269,7 @@ func checkZookeeper() error {
|
|
|
|
|
return errs.Wrap(err)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -295,6 +305,7 @@ func checkKafka() error {
|
|
|
|
|
return ErrComponentStart.Wrap(fmt.Sprintf("kafka doesn't contain topic:%v", config.Config.Kafka.LatestMsgToRedis.Topic))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|