enable-index-allocation.asciidoc 3.6 KB

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