Golang Package for System Clustering.
To create a cluster
import (
"fmt"
"github.com/clivern/cluster"
)
clus := &cluster.Cluster{}
// Generate a unique name
nodeName := clus.GetNodeName()
// Get a default configs
config := clus.GetConfig()
config.Name = nodeName
config.BindPort = 0 // assign a free port
config.Events = &cluster.NodeEvents{}
// Override configs
clus.SetConfig(config)
clus.AddLocalNode([]string{}) // or []string{"x.x.x.x:port"} in case of the second, third ... node
fmt.Println(clus.GetLocalNode())
// 2020/10/18 20:44:19 [DEBUG] memberlist: Using dynamic bind port 52053
// A node has joined: Clivern-2.local--c5553465-2bc9-4ef1-8a83-384e5a0c4097
// Clivern-2.local--c5553465-2bc9-4ef1-8a83-384e5a0c4097
For transparency into our release cycle and in striving to maintain backward compatibility, Cluster is maintained under the Semantic Versioning guidelines and release process is predictable and business-friendly.
See the Releases section of our GitHub project for changelogs for each release version of Cluster. It contains summaries of the most noteworthy changes made in each release.
If you have any suggestions, bug reports, or annoyances please report them to our issue tracker at https://github.com/clivern/cluster/issues
If you discover a security vulnerability within Cluster, please send an email to hello@clivern.com
We are an open source, community-driven project so please feel free to join us. see the contributing guidelines for more details.
© 2020, Clivern. Released under MIT License.
Cluster is authored and maintained by @clivern.