# Real one shot jdbc river

**URL:** <https://discuss.elastic.co/t/real-one-shot-jdbc-river/22135>\
**Category:** Elasticsearch\
**Created:** [February 12, 2015, 2:22pm UTC](https://discuss.elastic.co/t/real-one-shot-jdbc-river/22135 "2015-02-12T14:22:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abid\_Hussain](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Abid\_Hussain](https://discuss.elastic.co/u/Abid_Hussain)\
**Post date:** [February 12, 2015, 2:22pm UTC](https://discuss.elastic.co/t/real-one-shot-jdbc-river/22135/1 "2015-02-12T14:22:27Z")

</div>

Hi all,

we run a jdbc river once per night for a complete recreation of our index.

The river - once it has been created - will run again after a restart of  
elasticsearch cluster (single node cluster). But what we try to achieve is  
a one shot river, which isn't being re-run after restart of cluster.

Naturally we can trigger an event (e.g. as a cronjob) which - after the  
estimated end of river run - deletes the river again. But this results in  
additional efforts.

The easiest strategy may be do delete the river right away after creating  
it. But I suppose in this case the running river would be stopped...?

_My question is: what is the best way to create a one shot river which is  
not being re-run after restart of cluster?_

I noticed the oneshot strategy but didn't find any documentation  
in [https://github.com/jprante/elasticsearch-river-jdbc/wiki/Strategies](https://github.com/jprante/elasticsearch-river-jdbc/wiki/Strategies).

Any help would be appreciated.

Regards,

Abid

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d642e1ff-64a1-4ac9-b2b3-bba38b5c07e5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d642e1ff-64a1-4ac9-b2b3-bba38b5c07e5%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Abid\_Hussain](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Abid\_Hussain](https://discuss.elastic.co/u/Abid_Hussain)\
**Post date:** [February 12, 2015, 4:18pm UTC](https://discuss.elastic.co/t/real-one-shot-jdbc-river/22135/2 "2015-02-12T16:18:15Z")

</div>

So I tried the oneshot strategy with no success. The river is being rerun  
after restart of cluster.

Am Donnerstag, 12. Februar 2015 15:22:27 UTC+1 schrieb Abid Hussain:

> Hi all,
> 
> we run a jdbc river once per night for a complete recreation of our index.
> 
> The river - once it has been created - will run again after a restart of  
> elasticsearch cluster (single node cluster). But what we try to achieve is  
> a one shot river, which isn't being re-run after restart of cluster.
> 
> Naturally we can trigger an event (e.g. as a cronjob) which - after the  
> estimated end of river run - deletes the river again. But this results in  
> additional efforts.
> 
> The easiest strategy may be do delete the river right away after creating  
> it. But I suppose in this case the running river would be stopped...?
> 
> _My question is: what is the best way to create a one shot river which is  
> not being re-run after restart of cluster?_
> 
> I noticed the oneshot strategy but didn't find any documentation in  
> [Strategies · jprante/elasticsearch-jdbc Wiki · GitHub](https://github.com/jprante/elasticsearch-river-jdbc/wiki/Strategies).
> 
> Any help would be appreciated.
> 
> Regards,
> 
> Abid

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/dea5b9f2-36a5-4f09-b2c0-ca44157a4d9c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/dea5b9f2-36a5-4f09-b2c0-ca44157a4d9c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [February 12, 2015, 4:23pm UTC](https://discuss.elastic.co/t/real-one-shot-jdbc-river/22135/3 "2015-02-12T16:23:50Z")

</div>

Yes, a river instance is restarted by ES automatically at node restart. You  
must delete it after work is done in order to free resources.

Just a note, in future versions, I will drop the ES river API, and the JDBC  
plugin will manage an internal state, where the number of execution cycles  
can be configured.

Jörg

On Thu, Feb 12, 2015 at 5:18 PM, Abid Hussain [hussain@novacom.mygbiz.com](mailto:hussain@novacom.mygbiz.com)  
wrote:

> So I tried the oneshot strategy with no success. The river is being rerun  
> after restart of cluster.
> 
> Am Donnerstag, 12. Februar 2015 15:22:27 UTC+1 schrieb Abid Hussain:
> 
> > Hi all,
> > 
> > we run a jdbc river once per night for a complete recreation of our index.
> > 
> > The river - once it has been created - will run again after a restart of  
> > elasticsearch cluster (single node cluster). But what we try to achieve is  
> > a one shot river, which isn't being re-run after restart of cluster.
> > 
> > Naturally we can trigger an event (e.g. as a cronjob) which - after the  
> > estimated end of river run - deletes the river again. But this results in  
> > additional efforts.
> > 
> > The easiest strategy may be do delete the river right away after creating  
> > it. But I suppose in this case the running river would be stopped...?
> > 
> > _My question is: what is the best way to create a one shot river which is  
> > not being re-run after restart of cluster?_
> > 
> > I noticed the oneshot strategy but didn't find any documentation in  
> > [Strategies · jprante/elasticsearch-jdbc Wiki · GitHub](https://github.com/jprante/elasticsearch-river-jdbc/wiki/Strategies).
> > 
> > Any help would be appreciated.
> > 
> > Regards,
> > 
> > Abid
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/dea5b9f2-36a5-4f09-b2c0-ca44157a4d9c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/dea5b9f2-36a5-4f09-b2c0-ca44157a4d9c%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/dea5b9f2-36a5-4f09-b2c0-ca44157a4d9c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/dea5b9f2-36a5-4f09-b2c0-ca44157a4d9c%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHD2VbNz78YwzLK6iETXjYGCEtXyiwYmhBrXr2AsGvr0A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHD2VbNz78YwzLK6iETXjYGCEtXyiwYmhBrXr2AsGvr0A%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:33am UTC](https://discuss.elastic.co/t/real-one-shot-jdbc-river/22135/4 "2017-07-06T00:33:06Z")

</div>


