Skip to content

Instantly share code, notes, and snippets.

@seang-es
Last active December 6, 2018 20:32
Show Gist options
  • Save seang-es/4679b526e5696181390b63daf27e6d43 to your computer and use it in GitHub Desktop.
Save seang-es/4679b526e5696181390b63daf27e6d43 to your computer and use it in GitHub Desktop.
ECE API plan update
<Reading the existing plan>:
sean@sean-ece-1:~$ curl -u root:<root_pw> -XGET localhost:12400/api/v1/clusters/elasticsearch/6ba13a2b14a44e8bafa6f517f1ad0cbc/plan
{
"zone_count": 2,
"cluster_topology": [{
"node_type": {
"master": false
},
"memory_per_node": 1024,
"node_count_per_zone": 1,
"node_configuration": "default"
}, {
"node_type": {
"data": false
},
"memory_per_node": 1024,
"node_count_per_zone": 1,
"node_configuration": "default"
}],
"elasticsearch": {
"version": "5.6.11",
"system_settings": {
"scripting": {
"file": {
"enabled": false
}
}
},
"user_settings_yaml": "# Note that the syntax for user settings can change between major versions.\n# You might need to update these user settings before performing a major version upgrade.\n#\n# Slack integration example (for version 5.0 and later)\n# xpack.notification.slack:\n# account:\n# monitoring:\n# url: https://hooks.slack.com/services/T0A6BLEEA/B0A6D1PRD/XYZ123\n#\n# Slack integration example (for versions before 5.0)\n# watcher.actions.slack.service:\n# account:\n# monitoring:\n# url: https://hooks.slack.com/services/T0A6BLEEA/B0A6D1PRD/XYZ123\n# message_defaults:\n# from: Watcher\n#\n# HipChat and PagerDuty integration are also supported. To learn more, see the documentation.\n\n"
}
<Applying a new plan (note Content-Type is required). This plan increases the zone count to 3.>:
sean@sean-ece-1:~$ curl -u root:<root_pw> -XPOST -H 'Content-Type: application/json' localhost:12400/api/v1/clusters/elasticsearch/6ba13a2b14a44e8bafa6f517f1ad0cbc/plan -d '
{
"zone_count": 3,
"cluster_topology": [{
"node_type": {
"master": false
},
"memory_per_node": 1024,
"node_count_per_zone": 1,
"node_configuration": "default"
}, {
"node_type": {
"data": false
},
"memory_per_node": 1024,
"node_count_per_zone": 1,
"node_configuration": "default"
}],
"elasticsearch": {
"version": "5.6.11",
"system_settings": {
"scripting": {
"file": {
"enabled": false
}
}
},
"user_settings_yaml": "# Note that the syntax for user settings can change between major versions.\n# You might need to update these user settings before performing a major version upgrade.\n#\n# Slack integration example (for version 5.0 and later)\n# xpack.notification.slack:\n# account:\n# monitoring:\n# url: https://hooks.slack.com/services/T0A6BLEEA/B0A6D1PRD/XYZ123\n#\n# Slack integration example (for versions before 5.0)\n# watcher.actions.slack.service:\n# account:\n# monitoring:\n# url: https://hooks.slack.com/services/T0A6BLEEA/B0A6D1PRD/XYZ123\n# message_defaults:\n# from: Watcher\n#\n# HipChat and PagerDuty integration are also supported. To learn more, see the documentation.\n\n"
}
}'
{
"elasticsearch_cluster_id": "6ba13a2b14a44e8bafa6f517f1ad0cbc"
}
<Applying this plan removed the dedicated master nodes and enabled master-eligibility on the data nodes, so the node count in the cluster drops from 5 (including tiebreaker) to 3.>
sean@sean-ece-1:~$ curl -u root:<root_pw> -XPOST -H 'Content-Type: application/json' localhost:12400/api/v1/clusters/elasticsearch/6ba13a2b14a44e8bafa6f517f1ad0cbc/plan -d '
{
"zone_count": 2,
"cluster_topology": [{
"node_type": {
"data": true
},
"memory_per_node": 1024,
"node_count_per_zone": 1,
"node_configuration": "default"
}],
"elasticsearch": {
"version": "5.6.11",
"system_settings": {
"scripting": {
"file": {
"enabled": false
}
}
},
"user_settings_yaml": "# Note that the syntax for user settings can change between major versions.\n# You might need to update these user settings before performing a major version upgrade.\n#\n# Slack integration example (for version 5.0 and later)\n# xpack.notification.slack:\n# account:\n# monitoring:\n# url: https://hooks.slack.com/services/T0A6BLEEA/B0A6D1PRD/XYZ123\n#\n# Slack integration example (for versions before 5.0)\n# watcher.actions.slack.service:\n# account:\n# monitoring:\n# url: https://hooks.slack.com/services/T0A6BLEEA/B0A6D1PRD/XYZ123\n# message_defaults:\n# from: Watcher\n#\n# HipChat and PagerDuty integration are also supported. To learn more, see the documentation.\n\n"
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment