Documentation
¶
Overview ¶
Update voting configuration exclusions. Update the cluster voting config exclusions by node IDs or node names. By default, if there are more than three master-eligible nodes in the cluster and you remove fewer than half of the master-eligible nodes in the cluster at once, the voting configuration automatically shrinks. If you want to shrink the voting configuration to contain fewer than three nodes or to remove half or more of the master-eligible nodes in the cluster at once, use this API to remove departing nodes from the voting configuration manually. The API adds an entry for each specified node to the cluster’s voting configuration exclusions list. It then waits until the cluster has reconfigured its voting configuration to exclude the specified nodes.
Clusters should have no voting configuration exclusions in normal operation. Once the excluded nodes have stopped, clear the voting configuration exclusions with `DELETE /_cluster/voting_config_exclusions`. This API waits for the nodes to be fully removed from the cluster before it returns. If your cluster has voting configuration exclusions for nodes that you no longer intend to remove, use `DELETE /_cluster/voting_config_exclusions?wait_for_removal=false` to clear the voting configuration exclusions without waiting for the nodes to leave the cluster.
A response to `POST /_cluster/voting_config_exclusions` with an HTTP status code of 200 OK guarantees that the node has been removed from the voting configuration and will not be reinstated until the voting configuration exclusions are cleared by calling `DELETE /_cluster/voting_config_exclusions`. If the call to `POST /_cluster/voting_config_exclusions` fails or returns a response with an HTTP status code other than 200 OK then the node may not have been removed from the voting configuration. In that case, you may safely retry the call.
NOTE: Voting exclusions are required only when you remove at least half of the master-eligible nodes from a cluster in a short time period. They are not required when removing master-ineligible nodes or when removing fewer than half of the master-eligible nodes.
Index ¶
- Variables
- type NewPostVotingConfigExclusions
- type PostVotingConfigExclusions
- func (r PostVotingConfigExclusions) Do(ctx context.Context) (bool, error)
- func (r *PostVotingConfigExclusions) ErrorTrace(errortrace bool) *PostVotingConfigExclusions
- func (r *PostVotingConfigExclusions) FilterPath(filterpaths ...string) *PostVotingConfigExclusions
- func (r *PostVotingConfigExclusions) Header(key, value string) *PostVotingConfigExclusions
- func (r *PostVotingConfigExclusions) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *PostVotingConfigExclusions) Human(human bool) *PostVotingConfigExclusions
- func (r PostVotingConfigExclusions) IsSuccess(providedCtx context.Context) (bool, error)
- func (r *PostVotingConfigExclusions) NodeIds(ids ...string) *PostVotingConfigExclusions
- func (r *PostVotingConfigExclusions) NodeNames(names ...string) *PostVotingConfigExclusions
- func (r PostVotingConfigExclusions) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *PostVotingConfigExclusions) Pretty(pretty bool) *PostVotingConfigExclusions
- func (r *PostVotingConfigExclusions) Timeout(duration string) *PostVotingConfigExclusions
Constants ¶
This section is empty.
Variables ¶
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")
ErrBuildPath is returned in case of missing parameters within the build of the request.
Functions ¶
This section is empty.
Types ¶
type NewPostVotingConfigExclusions ¶
type NewPostVotingConfigExclusions func() *PostVotingConfigExclusions
NewPostVotingConfigExclusions type alias for index.
func NewPostVotingConfigExclusionsFunc ¶
func NewPostVotingConfigExclusionsFunc(tp elastictransport.Interface) NewPostVotingConfigExclusions
NewPostVotingConfigExclusionsFunc returns a new instance of PostVotingConfigExclusions with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type PostVotingConfigExclusions ¶
type PostVotingConfigExclusions struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *PostVotingConfigExclusions
Update voting configuration exclusions. Update the cluster voting config exclusions by node IDs or node names. By default, if there are more than three master-eligible nodes in the cluster and you remove fewer than half of the master-eligible nodes in the cluster at once, the voting configuration automatically shrinks. If you want to shrink the voting configuration to contain fewer than three nodes or to remove half or more of the master-eligible nodes in the cluster at once, use this API to remove departing nodes from the voting configuration manually. The API adds an entry for each specified node to the cluster’s voting configuration exclusions list. It then waits until the cluster has reconfigured its voting configuration to exclude the specified nodes.
Clusters should have no voting configuration exclusions in normal operation. Once the excluded nodes have stopped, clear the voting configuration exclusions with `DELETE /_cluster/voting_config_exclusions`. This API waits for the nodes to be fully removed from the cluster before it returns. If your cluster has voting configuration exclusions for nodes that you no longer intend to remove, use `DELETE /_cluster/voting_config_exclusions?wait_for_removal=false` to clear the voting configuration exclusions without waiting for the nodes to leave the cluster.
A response to `POST /_cluster/voting_config_exclusions` with an HTTP status code of 200 OK guarantees that the node has been removed from the voting configuration and will not be reinstated until the voting configuration exclusions are cleared by calling `DELETE /_cluster/voting_config_exclusions`. If the call to `POST /_cluster/voting_config_exclusions` fails or returns a response with an HTTP status code other than 200 OK then the node may not have been removed from the voting configuration. In that case, you may safely retry the call.
NOTE: Voting exclusions are required only when you remove at least half of the master-eligible nodes from a cluster in a short time period. They are not required when removing master-ineligible nodes or when removing fewer than half of the master-eligible nodes.
https://www.elastic.co/guide/en/elasticsearch/reference/current/voting-config-exclusions.html
func (PostVotingConfigExclusions) Do ¶
func (r PostVotingConfigExclusions) Do(ctx context.Context) (bool, error)
Do runs the request through the transport, handle the response and returns a postvotingconfigexclusions.Response
func (*PostVotingConfigExclusions) ErrorTrace ¶ added in v8.14.0
func (r *PostVotingConfigExclusions) ErrorTrace(errortrace bool) *PostVotingConfigExclusions
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*PostVotingConfigExclusions) FilterPath ¶ added in v8.14.0
func (r *PostVotingConfigExclusions) FilterPath(filterpaths ...string) *PostVotingConfigExclusions
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*PostVotingConfigExclusions) Header ¶
func (r *PostVotingConfigExclusions) Header(key, value string) *PostVotingConfigExclusions
Header set a key, value pair in the PostVotingConfigExclusions headers map.
func (*PostVotingConfigExclusions) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*PostVotingConfigExclusions) Human ¶ added in v8.14.0
func (r *PostVotingConfigExclusions) Human(human bool) *PostVotingConfigExclusions
Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"eixsts_time_in_millis": 3600000` for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines. API name: human
func (PostVotingConfigExclusions) IsSuccess ¶
func (r PostVotingConfigExclusions) IsSuccess(providedCtx context.Context) (bool, error)
IsSuccess allows to run a query with a context and retrieve the result as a boolean. This only exists for endpoints without a request payload and allows for quick control flow.
func (*PostVotingConfigExclusions) NodeIds ¶
func (r *PostVotingConfigExclusions) NodeIds(ids ...string) *PostVotingConfigExclusions
NodeIds A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify node_names. API name: node_ids
func (*PostVotingConfigExclusions) NodeNames ¶
func (r *PostVotingConfigExclusions) NodeNames(names ...string) *PostVotingConfigExclusions
NodeNames A comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify node_ids. API name: node_names
func (PostVotingConfigExclusions) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*PostVotingConfigExclusions) Pretty ¶ added in v8.14.0
func (r *PostVotingConfigExclusions) Pretty(pretty bool) *PostVotingConfigExclusions
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*PostVotingConfigExclusions) Timeout ¶
func (r *PostVotingConfigExclusions) Timeout(duration string) *PostVotingConfigExclusions
Timeout When adding a voting configuration exclusion, the API waits for the specified nodes to be excluded from the voting configuration before returning. If the timeout expires before the appropriate condition is satisfied, the request fails and returns an error. API name: timeout