create-enrollment-token.asciidoc 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. [roles="xpack"]
  2. [[create-enrollment-token]]
  3. == elasticsearch-create-enrollment-token
  4. The `elasticsearch-create-enrollment-token` command creates enrollment tokens for
  5. {es} nodes and {kib} instances.
  6. [discrete]
  7. === Synopsis
  8. [source,shell]
  9. ----
  10. bin/elasticsearch-create-enrollment-token
  11. [-f, --force] [-h, --help] [-E <KeyValuePair>] [-s, --scope]
  12. ----
  13. [discrete]
  14. === Description
  15. Use this command to create enrollment tokens, which you can use to enroll new
  16. {es} nodes to an existing cluster or configure {kib} instances to communicate
  17. with an existing {es} cluster that has security features enabled.
  18. The command generates (and subsequently removes) a temporary user in the
  19. <<file-realm,file realm>> to run the request that creates enrollment tokens.
  20. IMPORTANT: You cannot use this tool if the file realm is disabled in your
  21. `elasticsearch.yml` file.
  22. This command uses an HTTP connection to connect to the cluster and run the user
  23. management requests. The command automatically attempts to establish the connection
  24. over HTTPS by using the `xpack.security.http.ssl` settings in
  25. the `elasticsearch.yml` file. If you do not use the default configuration directory,
  26. ensure that the `ES_PATH_CONF` environment variable returns the
  27. correct path before you run the `elasticsearch-create-enrollment-token` command. You can
  28. override settings in your `elasticsearch.yml` file by using the `-E` command
  29. option. For more information about debugging connection failures, see
  30. <<trb-security-setup>>.
  31. [discrete]
  32. [[create-enrollment-token-parameters]]
  33. === Parameters
  34. `-E <KeyValuePair>`:: Configures a standard {es} or {xpack} setting.
  35. `-f, --force`:: Forces the command to run against an unhealthy cluster.
  36. `-h, --help`:: Returns all of the command parameters.
  37. `-s, --scope`:: Specifies the scope of the generated token. Supported values are `node` and `kibana`.
  38. [discrete]
  39. === Examples
  40. The following command creates an enrollment token for enrolling an {es} node into a cluster:
  41. [source,shell]
  42. ----
  43. bin/elasticsearch-create-enrollment-token -s node
  44. ----