|
|
@ -102,19 +102,24 @@ func main() {
|
|
|
|
if !check.flag {
|
|
|
|
if !check.flag {
|
|
|
|
err = check.function(check.config)
|
|
|
|
err = check.function(check.config)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
if check.name == "Minio" {
|
|
|
|
if errors.Is(err, errMinioNotEnabled) {
|
|
|
|
if errors.Is(err, errMinioNotEnabled) {
|
|
|
|
fmt.Println(err.Error())
|
|
|
|
fmt.Println(err.Error(), " check ", check.name)
|
|
|
|
checks[index].flag = true
|
|
|
|
checks[index].flag = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if errors.Is(err, errSignEndPoint) {
|
|
|
|
if errors.Is(err, errSignEndPoint) {
|
|
|
|
fmt.Fprintf(os.Stderr, err.Error())
|
|
|
|
fmt.Fprintf(os.Stderr, err.Error(), " check ", check.name)
|
|
|
|
checks[index].flag = true
|
|
|
|
checks[index].flag = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
component.ErrorPrint(fmt.Sprintf("Starting %s failed:%v.", check.name, errs.Unwrap(err).Error()))
|
|
|
|
component.ErrorPrint(fmt.Sprintf("Starting %s failed:%v.", check.name, errs.Unwrap(err).Error()))
|
|
|
|
if !strings.Contains(errs.Unwrap(err).Error(), "connection refused") &&
|
|
|
|
if strings.Contains(errs.Unwrap(err).Error(), "connection refused") ||
|
|
|
|
!strings.Contains(errs.Unwrap(err).Error(), "timeout waiting") {
|
|
|
|
strings.Contains(errs.Unwrap(err).Error(), "timeout") ||
|
|
|
|
component.ErrorPrint("Some components started failed!")
|
|
|
|
strings.Contains(errs.Unwrap(err).Error(), "context deadline exceeded") {
|
|
|
|
os.Exit(-1)
|
|
|
|
component.ErrorPrint(fmt.Sprintf("try check connection %s", check.name))
|
|
|
|
|
|
|
|
allSuccess = false
|
|
|
|
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
checks[index].flag = true
|
|
|
|
checks[index].flag = true
|
|
|
@ -258,13 +263,13 @@ func checkKafka(config *config.GlobalConfig) error {
|
|
|
|
_, err = kafka.NewMConsumerGroup(&kafka.MConsumerGroupConfig{
|
|
|
|
_, err = kafka.NewMConsumerGroup(&kafka.MConsumerGroupConfig{
|
|
|
|
KafkaVersion: sarama.V2_0_0_0,
|
|
|
|
KafkaVersion: sarama.V2_0_0_0,
|
|
|
|
OffsetsInitial: sarama.OffsetNewest, IsReturnErr: false,
|
|
|
|
OffsetsInitial: sarama.OffsetNewest, IsReturnErr: false,
|
|
|
|
}, []string{config.Kafka.MsgToPush.Topic},
|
|
|
|
}, []string{config.Kafka.MsgToMongo.Topic},
|
|
|
|
config.Kafka.Addr, config.Kafka.ConsumerGroupID.MsgToMongo, tlsConfig)
|
|
|
|
config.Kafka.Addr, config.Kafka.ConsumerGroupID.MsgToMongo, tlsConfig)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
kafka.NewMConsumerGroup(&kafka.MConsumerGroupConfig{
|
|
|
|
_, err = kafka.NewMConsumerGroup(&kafka.MConsumerGroupConfig{
|
|
|
|
KafkaVersion: sarama.V2_0_0_0,
|
|
|
|
KafkaVersion: sarama.V2_0_0_0,
|
|
|
|
OffsetsInitial: sarama.OffsetNewest, IsReturnErr: false,
|
|
|
|
OffsetsInitial: sarama.OffsetNewest, IsReturnErr: false,
|
|
|
|
}, []string{config.Kafka.MsgToPush.Topic}, config.Kafka.Addr,
|
|
|
|
}, []string{config.Kafka.MsgToPush.Topic}, config.Kafka.Addr,
|
|
|
|