enable-index-allocation.asciidoc 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. //////////////////////////
  2. [source,console]
  3. --------------------------------------------------
  4. PUT my-index-000001
  5. {
  6. "settings": {
  7. "index.routing.allocation.enable": "primaries"
  8. }
  9. }
  10. --------------------------------------------------
  11. // TESTSETUP
  12. [source,console]
  13. --------------------------------------------------
  14. DELETE my-index-000001
  15. --------------------------------------------------
  16. // TEARDOWN
  17. //////////////////////////
  18. // tag::cloud[]
  19. In order to get the shards assigned we'll need to change the value of the
  20. <<index-routing-allocation-enable-setting, configuration>> that restricts the
  21. assignemnt of the shards to `all`.
  22. **Use {kib}**
  23. //tag::kibana-api-ex[]
  24. . Log in to the {ess-console}[{ecloud} console].
  25. +
  26. . On the **Elasticsearch Service** panel, click the name of your deployment.
  27. +
  28. NOTE: If the name of your deployment is disabled your {kib} instances might be
  29. unhealthy, in which case please contact https://support.elastic.co[Elastic Support].
  30. If your deployment doesn't include {kib}, all you need to do is
  31. {cloud}/ec-access-kibana.html[enable it first].
  32. . Open your deployment's side navigation menu (placed under the Elastic logo in the upper left corner)
  33. and go to **Dev Tools > Console**.
  34. +
  35. [role="screenshot"]
  36. image::images/kibana-console.png[{kib} Console,align="center"]
  37. . Inspect the `index.routing.allocation.enable` <<indices-get-settings, index setting>>
  38. for the index with unassigned shards:
  39. +
  40. [source,console]
  41. ----
  42. GET /my-index-000001/_settings/index.routing.allocation.enable?flat_settings
  43. ----
  44. +
  45. The response will look like this:
  46. +
  47. [source,console-result]
  48. ----
  49. {
  50. "my-index-000001": {
  51. "settings": {
  52. "index.routing.allocation.enable": "none" <1>
  53. }
  54. }
  55. }
  56. ----
  57. // TESTRESPONSE[skip:the result is for illustrating purposes only]
  58. +
  59. <1> Represents the current configured value that controls if the index is allowed
  60. to be partially or totally allocated.
  61. . <<indices-update-settings,Change>> the <<index-routing-allocation-enable-setting, configuration>>
  62. value to allow the index to be fully allocated:
  63. +
  64. [source,console]
  65. ----
  66. PUT /my-index-000001/_settings
  67. {
  68. "index" : {
  69. "routing.allocation.enable" : "all" <1>
  70. }
  71. }
  72. ----
  73. // TEST[continued]
  74. +
  75. <1> The new value for the `allocation.enable` configuration for the `my-index-000001` index
  76. is changed to allow all the shards to be allocated.
  77. //end::kibana-api-ex[]
  78. // end::cloud[]
  79. // tag::self-managed[]
  80. In order to get the shards assigned we'll need to change the value of the
  81. <<index-routing-allocation-enable-setting, configuration>> that restricts the
  82. assignemnt of the shards to `all`.
  83. . Inspect the `index.routing.allocation.enable` <<indices-get-settings, index setting>>
  84. for the index with unassigned shards:
  85. +
  86. [source,console]
  87. ----
  88. GET /my-index-000001/_settings/index.routing.allocation.enable?flat_settings
  89. ----
  90. +
  91. The response will look like this:
  92. +
  93. [source,console-result]
  94. ----
  95. {
  96. "my-index-000001": {
  97. "settings": {
  98. "index.routing.allocation.enable": "none" <1>
  99. }
  100. }
  101. }
  102. ----
  103. // TESTRESPONSE[skip:the result is for illustrating purposes only]
  104. +
  105. <1> Represents the current configured value that controls if the index is allowed
  106. to be partially or totally allocated.
  107. . <<indices-update-settings,Change>> the <<index-routing-allocation-enable-setting, configuration>>
  108. value to allow the index to be fully allocated:
  109. +
  110. [source,console]
  111. ----
  112. PUT /my-index-000001/_settings
  113. {
  114. "index" : {
  115. "routing.allocation.enable" : "all" <1>
  116. }
  117. }
  118. ----
  119. // TEST[continued]
  120. +
  121. <1> The new value for the `allocation.enable` configuration for the `my-index-000001` index
  122. is changed to allow all the shards to be allocated.
  123. // end::self-managed[]