Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Clivern/Cluster
Golang Package for System Clustering.
https://github.com/Clivern/Cluster
clivern clustering fault-tolerance hashicorp high-availability leader-election memberlist pubsub
Last synced: about 2 months ago
JSON representation
Golang Package for System Clustering.
- Host: GitHub
- URL: https://github.com/Clivern/Cluster
- Owner: Clivern
- License: mit
- Created: 2020-10-15T18:01:05.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-19T17:49:59.000Z (9 months ago)
- Last Synced: 2024-06-19T15:16:11.141Z (6 months ago)
- Topics: clivern, clustering, fault-tolerance, hashicorp, high-availability, leader-election, memberlist, pubsub
- Language: Go
- Homepage:
- Size: 251 KB
- Stars: 15
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
Cluster
Golang Package for System Clustering.
## Documentation
### Usage
To create a cluster
```golang
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
```## Versioning
For transparency into our release cycle and in striving to maintain backward compatibility, Cluster is maintained under the [Semantic Versioning guidelines](https://semver.org/) and release process is predictable and business-friendly.
See the [Releases section of our GitHub project](https://github.com/clivern/cluster/releases) for changelogs for each release version of Cluster. It contains summaries of the most noteworthy changes made in each release.
## Bug tracker
If you have any suggestions, bug reports, or annoyances please report them to our issue tracker at https://github.com/clivern/cluster/issues
## Security Issues
If you discover a security vulnerability within Cluster, please send an email to [[email protected]](mailto:[email protected])
## Contributing
We are an open source, community-driven project so please feel free to join us. see the [contributing guidelines](CONTRIBUTING.md) for more details.
## License
© 2020, Clivern. Released under [MIT License](https://opensource.org/licenses/mit-license.php).
**Cluster** is authored and maintained by [@clivern](http://github.com/clivern).