# Deploying script files to disk across all nodes

**URL:** <https://discuss.elastic.co/t/deploying-script-files-to-disk-across-all-nodes/725>\
**Category:** Elasticsearch\
**Created:** [May 15, 2015, 12:24am UTC](https://discuss.elastic.co/t/deploying-script-files-to-disk-across-all-nodes/725 "2015-05-15T00:24:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anant\_Aneja](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@Anant\_Aneja](https://discuss.elastic.co/u/Anant_Aneja)\
**Post date:** [May 15, 2015, 12:24am UTC](https://discuss.elastic.co/t/deploying-script-files-to-disk-across-all-nodes/725/1 "2015-05-15T00:24:24Z")

</div>

I intend to store scripts on disk as specified in [http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.htm](http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.htm)

I have few questions on using this -

1. How do I version control my scripts ? I can store different versions in different directories, but I would like it if I could specify a subdirectory that should be used inside config/scripts.  
I'm open to other ideas too.
2. How do I ensure that my copied scripts have been successfully picked up by ES and compiled. An API to test for failures would be nice (maybe augment \_cat/nodes) ?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 15, 2015, 3:29am UTC](https://discuss.elastic.co/t/deploying-script-files-to-disk-across-all-nodes/725/2 "2015-05-15T03:29:03Z")

</div>

1. Versioning maintenance is up to you. You could use git with a hook to push files once they have been committed. The scripting directory cannot be customised, but please feel free to raise a GH enhancement request if you want.
2. It should log when a script is loaded and compiled, so you need to watch for that.

---

<div class="post-metadata">

**Author:** ![Anant\_Aneja](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@Anant\_Aneja](https://discuss.elastic.co/u/Anant_Aneja)\
**Post date:** [May 15, 2015, 11:07pm UTC](https://discuss.elastic.co/t/deploying-script-files-to-disk-across-all-nodes/725/3 "2015-05-15T23:07:40Z")

</div>

W.r.t #2 - I know I can look at parse the logs to see when a script was picked up, but wouldn't it be better if there was an API which let you know which scripts were available on a particular node ?  
In the absence of this, the deployment validations of a file push is much harder; the only way is to run the actual script (and that too on a particular shard on a particular node) to see if it runs without errors

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 15, 2015, 11:37pm UTC](https://discuss.elastic.co/t/deploying-script-files-to-disk-across-all-nodes/725/4 "2015-05-15T23:37:37Z")

</div>

You're right. Feel free to raise a GH feature request to get this added 🙂

---

<div class="post-metadata">

**Author:** ![twigbranch](https://avatars.discourse-cdn.com/v4/letter/t/2bfe46/32.png) [@twigbranch](https://discuss.elastic.co/u/twigbranch)\
**Post date:** [July 21, 2015, 7:03pm UTC](https://discuss.elastic.co/t/deploying-script-files-to-disk-across-all-nodes/725/5 "2015-07-21T19:03:39Z")

</div>

1. Did you ever file an enhancement request for this?

2. We placed a script in a subdirectory and it appeared to be compiled, but for some reason upon execution we get, "ElasticsearchIllegalArgumentException[Unable to find on disk script ..." - did you have any issues executing scripts located in subdirectories of config/scripts/?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:00am UTC](https://discuss.elastic.co/t/deploying-script-files-to-disk-across-all-nodes/725/6 "2017-07-06T00:00:06Z")

</div>


