554325746@qq.com
2020-05-13 8fec134c09589b1229c84f51fb37add1c4be35cc
sync.go
@@ -46,7 +46,7 @@
   return true
}
func SyncInit(clusterID string, password string, nodeID string, strAddrs string) bool {
func SyncInit(clusterID string, password string, nodeID string, strAddrs string, snapshotPath string) bool {
   var ips []string
   if strAddrs == "" {
      ips = nil
@@ -56,7 +56,7 @@
   pwdFull := syncClusterKeyPrefix + password
   agent, _ = sdb.Init(clusterID, pwdFull, nodeID, ips)
   agent, _ = sdb.Init(clusterID, pwdFull, nodeID, ips, snapshotPath)
   if agent == nil {
      logger.Error("sdb.Init")
      return false
@@ -80,9 +80,9 @@
   return true
}
func JoinCluster(clusterID, password, strAddrs, devID, devIP, devName string) bool {
func JoinCluster(clusterID, password, strAddrs, devID, devIP, devName string, snapshotPath string) bool {
   isOk := SyncInit(clusterID, password, devID, strAddrs)
   isOk := SyncInit(clusterID, password, devID, strAddrs,snapshotPath)
   if isOk { 
      logger.Debug("dbSync.Init success")