mirror of
https://github.com/datarhei/core.git
synced 2025-10-15 12:30:45 +08:00
Allow to provide complete cluster configuration
Replace CORE_CLUSTER_JOIN_ADDRESS with CORE_CLUSTER_PEERS. This is a comma separated list of cluster members with their IDs of the form ID@host:port On startup the node tries to connect to all the peers. In case of sudden deaths of a node this will allow to find back into the cluster. The list in CLUSTER_PEERS is a starting point of known peers. Other node that are not in that list can still join the cluster. File and stream proxy has been moved to the Proxy type.
This commit is contained in:
@@ -42,8 +42,6 @@ type JoinRequest struct {
|
||||
ID string `json:"id"`
|
||||
RaftAddress string `json:"raft_address"`
|
||||
APIAddress string `json:"api_address"`
|
||||
APIUsername string `json:"api_username"`
|
||||
APIPassword string `json:"api_password"`
|
||||
}
|
||||
|
||||
type LeaveRequest struct {
|
||||
@@ -73,8 +71,8 @@ func NewAPI(config APIConfig) (API, error) {
|
||||
a.router.Debug = true
|
||||
a.router.HTTPErrorHandler = errorhandler.HTTPErrorHandler
|
||||
a.router.Validator = validator.New()
|
||||
a.router.HideBanner = false
|
||||
a.router.HidePort = false
|
||||
a.router.HideBanner = true
|
||||
a.router.HidePort = true
|
||||
|
||||
mwlog.NewWithConfig(mwlog.Config{
|
||||
Logger: a.logger,
|
||||
@@ -105,7 +103,7 @@ func NewAPI(config APIConfig) (API, error) {
|
||||
return httpapi.Err(http.StatusLoopDetected, "", "breaking circuit")
|
||||
}
|
||||
|
||||
err := a.cluster.Join(r.Origin, r.ID, r.RaftAddress, r.APIAddress, r.APIUsername, r.APIPassword)
|
||||
err := a.cluster.Join(r.Origin, r.ID, r.RaftAddress, r.APIAddress, "")
|
||||
if err != nil {
|
||||
a.logger.Debug().WithError(err).Log("unable to join cluster")
|
||||
return httpapi.Err(http.StatusInternalServerError, "unable to join cluster", "%s", err)
|
||||
|
Reference in New Issue
Block a user