Generating a licenseedit

If a license is not already registered for the cluster, one is generated when the nodes start. By default, this is a 30 day trial license that gives access to all X-Pack features.

You are allowed to initiate a trial license only if your cluster has not already activated a trial license for the current major X-Pack version. For example, if you have already activated a trial for v6.0, you cannot start a new trial until v7.0.

If you do not want to immediately use your trial license, you can set the xpack.license.self_generated.type to basic in your elasticsearch.yml file. This setting generates a basic license instead of a trial license. In this case, the self-generated license gives access only to the features of a standard basic license. For more information, see X-Pack License Settings.

You can also use the start_trial API to start a trial license:

  1. Check if you are eligible to start a trial:

    curl -XGET -u elastic:elastic_password 'http://<host>:<port>/_xpack/license/trial_status'
  2. If you are eligible, start a trial:

    curl -XPOST -u elastic:elastic_password 'http://<host>:<port>/_xpack/license/start_trial'

When you use this API, the trial license replaces your existing license. If you want to revert to your existing license when the trial is complete, you must install your license again. If you do not already have a license, you must register for a new basic license.