| | |
| | | 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 |
| | |
| | | |
| | | 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 |
| | |
| | | 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") |