# Jdbc river re-indexing after each start of server?

**URL:** <https://discuss.elastic.co/t/jdbc-river-re-indexing-after-each-start-of-server/21830>\
**Category:** Elasticsearch\
**Created:** [January 26, 2015, 12:09pm UTC](https://discuss.elastic.co/t/jdbc-river-re-indexing-after-each-start-of-server/21830 "2015-01-26T12:09:29Z")\
**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:** [January 26, 2015, 12:09pm UTC](https://discuss.elastic.co/t/jdbc-river-re-indexing-after-each-start-of-server/21830/1 "2015-01-26T12:09:29Z")

</div>

Hi all,

I configured a river for one-time indexing like:  
PUT /\_river/my\_river/\_meta  
{  
"type": "jdbc",  
"jdbc": {  
"driver": "com.mysql.jdbc.Driver",  
"url": "jdbc:mysql://192.168.110.180:3306/my\_db",  
"user": "user",  
"password": "password",  
"index": "my\_idx",  
"type": "order",  
"sql": "SELECT o.order\_id AS \_id, o.order\_name FROM orders o"  
}  
}

After performing the PUT, the data is being indexed. When finished, I stop  
the server and start it again. The CPU load now is remarkably high. Looking  
at /\_river/jdbc/\*/\_state it tells me that _last\_active\_end_ is null.

So, does the restart of elasicsearch trigger a complete reindexing? If so,  
how can I avoid this - e.g by using timestamps?

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/b006c70b-93f7-48a9-b423-136d288ef7f3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b006c70b-93f7-48a9-b423-136d288ef7f3%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:** [January 26, 2015, 12:15pm UTC](https://discuss.elastic.co/t/jdbc-river-re-indexing-after-each-start-of-server/21830/2 "2015-01-26T12:15:18Z")

</div>

You should delete the river instance after usage. Otherwise, the river is  
executed each time the node starts.

Jörg

On Mon, Jan 26, 2015 at 1:09 PM, Abid Hussain [hussain@novacom.mygbiz.com](mailto:hussain@novacom.mygbiz.com)  
wrote:

> Hi all,
> 
> I configured a river for one-time indexing like:  
> PUT /\_river/my\_river/\_meta  
> {  
> "type": "jdbc",  
> "jdbc": {  
> "driver": "com.mysql.jdbc.Driver",  
> "url": "jdbc:mysql://192.168.110.180:3306/my\_db",  
> "user": "user",  
> "password": "password",  
> "index": "my\_idx",  
> "type": "order",  
> "sql": "SELECT o.order\_id AS \_id, o.order\_name FROM orders o"  
> }  
> }
> 
> After performing the PUT, the data is being indexed. When finished, I stop  
> the server and start it again. The CPU load now is remarkably high. Looking  
> at /\_river/jdbc/\*/\_state it tells me that _last\_active\_end_ is null.
> 
> So, does the restart of elasicsearch trigger a complete reindexing? If so,  
> how can I avoid this - e.g by using timestamps?
> 
> 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/b006c70b-93f7-48a9-b423-136d288ef7f3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b006c70b-93f7-48a9-b423-136d288ef7f3%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/b006c70b-93f7-48a9-b423-136d288ef7f3%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b006c70b-93f7-48a9-b423-136d288ef7f3%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/CAKdsXoE9J\_TvKbE7%2BWO7\_DByD%3DoQ1M293BOxLoX\_AchyeMMJJw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoE9J_TvKbE7%2BWO7_DByD%3DoQ1M293BOxLoX_AchyeMMJJw%40mail.gmail.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:** [January 26, 2015, 12:30pm UTC](https://discuss.elastic.co/t/jdbc-river-re-indexing-after-each-start-of-server/21830/3 "2015-01-26T12:30:23Z")

</div>

Thanks for you quick help!

Am Montag, 26. Januar 2015 13:15:26 UTC+1 schrieb Jörg Prante:

> You should delete the river instance after usage. Otherwise, the river is  
> executed each time the node starts.
> 
> Jörg
> 
> On Mon, Jan 26, 2015 at 1:09 PM, Abid Hussain \<[hus...@novacom.mygbiz.com](mailto:hus...@novacom.mygbiz.com)  
> \<javascript:\>\> wrote:
> 
> > Hi all,
> > 
> > I configured a river for one-time indexing like:  
> > PUT /\_river/my\_river/\_meta  
> > {  
> > "type": "jdbc",  
> > "jdbc": {  
> > "driver": "com.mysql.jdbc.Driver",  
> > "url": "jdbc:mysql://192.168.110.180:3306/my\_db",  
> > "user": "user",  
> > "password": "password",  
> > "index": "my\_idx",  
> > "type": "order",  
> > "sql": "SELECT o.order\_id AS \_id, o.order\_name FROM orders o"  
> > }  
> > }
> > 
> > After performing the PUT, the data is being indexed. When finished, I  
> > stop the server and start it again. The CPU load now is remarkably high.  
> > Looking at /\_river/jdbc/\*/\_state it tells me that _last\_active\_end_ is  
> > null.
> > 
> > So, does the restart of elasicsearch trigger a complete reindexing? If  
> > so, how can I avoid this - e.g by using timestamps?
> > 
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/b006c70b-93f7-48a9-b423-136d288ef7f3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b006c70b-93f7-48a9-b423-136d288ef7f3%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/b006c70b-93f7-48a9-b423-136d288ef7f3%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b006c70b-93f7-48a9-b423-136d288ef7f3%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/0be9e039-87e2-44fa-8952-67711e83cfe8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0be9e039-87e2-44fa-8952-67711e83cfe8%40googlegroups.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:36am UTC](https://discuss.elastic.co/t/jdbc-river-re-indexing-after-each-start-of-server/21830/4 "2017-07-06T00:36:40Z")

</div>


