Where license data is stored?

Hi!

Where license data is stored in Elasticsearch 1.7.3? I am looking for the directory which keeps this information.

We are using Elasticsearch with Shield inside Docker container and we want to keep our license updated when we remove container and create it again. In order to do this we need to keep data about our license as separate volume which will be restored in the specified directory after Docker container recreation.

Hi Karzmu,

The license itself is stored inside of the cluster, so you'll need your docker install to use the license API when you're instantiating a cluster. In 1.x, that can be done by

curl -XPUT -u admin 'http://<host>:<port>/_licenses' -d @license.json
And you can store your license.json file wherever you like.

The full documentation can be found on the 1.3 shield license management docs. Note that as of 2.0, there was a slight, slightly tricky, change to that endpoint: _licenses was renamed _license. So as you move forward into 2.x, bear this in mind. Documentation as of 2.1 (the most current at the time of this writing) can be found here. And this is an important general note: the documentation is versioned, so make sure you read the right version of the documentation :slight_smile:

Thanks for reply.

I am aware how to update my license through license API, thanks for advise about reading the right version of the documentation :slight_smile:

I rather want to know where (in terms of directory on hard drive) the information about my license is stored after I use license API.

I need to know the directory which is used to store it. Which directory from link below is it?
https://www.elastic.co/guide/en/elasticsearch/reference/1.7/setup-dir-layout.html

The license is stored in the cluster state which is persisted to disk under path.data (it's a few directories down).

Given this, I imagine that you already have path.data on a separate volume?

Yes, we have our data on separate volume in order to keep our logs between docker container recreations. It's good to know that license information is kept in the same place :slight_smile:

Thanks for help! :slight_smile:

Cheers. :slight_smile: