Skip to content

Commit

Permalink
modify component check (#342)
Browse files Browse the repository at this point in the history
* update init config

* update init

* update component check
  • Loading branch information
AndrewZuo01 authored Dec 25, 2023
1 parent 5fb01e1 commit 8d50804
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/component/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
)

var (
MaxConnectTimes = 100
MaxConnectTimes = 200
)

func ComponentCheck(cfgPath string, hide bool) error {
Expand Down Expand Up @@ -66,8 +66,9 @@ func successPrint(s string, hide bool) {
func newZkClient() (*zk.Conn, error) {
var c *zk.Conn
c, _, err := zk.Connect(config.Config.Zookeeper.ZkAddr, time.Second, zk.WithLogger(log.NewZkLogger()))
result, _, _ := c.Exists("zookeeper")
fmt.Println("zk addr=", config.Config.Zookeeper.ZkAddr)
if err != nil {
if err != nil || !result {
fmt.Println("zookeeper connect error:", err)
return nil, errs.Wrap(err, "Zookeeper Addr: "+strings.Join(config.Config.Zookeeper.ZkAddr, " "))
} else {
Expand Down

0 comments on commit 8d50804

Please sign in to comment.