| | |
| | | } |
| | | |
| | | //Init serf Init |
| | | func Init(clusterID string, password string, nodeID string, addrs []string, snapshotPath string, hef HandleEventFunc) (*Agent, error) { |
| | | agent, err := InitNode(clusterID, password, nodeID, snapshotPath, hef) |
| | | func Init(clusterID string, password string, nodeID string, addrs []string, snapshotPath string) (*Agent, error) { |
| | | agent, err := InitNode(clusterID, password, nodeID, snapshotPath) |
| | | if err != nil { |
| | | logger.Error("InitNode failed, error: %s", err) |
| | | return agent, err |
| | |
| | | } |
| | | |
| | | //InitNode web后台收到创建集群的请求, |
| | | func InitNode(clusterID string, password string, nodeID string, snapshotPath string, hef HandleEventFunc) (*Agent, error) { |
| | | func InitNode(clusterID string, password string, nodeID string, snapshotPath string) (*Agent, error) { |
| | | conf := DefaultConfig() |
| | | logger.Info("clusterID:", clusterID, "password:", password, "nodeID:", nodeID) |
| | | conf.ClusterID = clusterID |