Guarding from double-start


(Andrew Gaydenko) #1

There were a couple of times during development workflow I have started ES
script the second time. It results in red status (I use Elastic HQ) and
not-working. So I'm forced to regenerate all indexes (with all test data)
again. It takes noticeable time.

At the moment I use this script

ES_MAX_MEM="512M"
export ES_MAX_MEM
cd /ES-dir/bin
./elasticsearch.in.sh
./elasticsearch -f &

under Linux to start ES. Can you. please, suggest a trick to avoid falling
in red?

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/a79fba10-3fad-4c76-bc19-d744c2f79ef2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Maciej Dziardziel) #2

use start-stop-daemon or adapt /etc/init.d/elasticsearch to set up pidfile
guarding es instance. Or just run this way:
pgrep -f elasticsearch || ./start_es.sh

On Friday, June 20, 2014 3:21:08 PM UTC+1, Andrew Gaydenko wrote:

There were a couple of times during development workflow I have started ES
script the second time. It results in red status (I use Elastic HQ) and
not-working. So I'm forced to regenerate all indexes (with all test data)
again. It takes noticeable time.

At the moment I use this script

ES_MAX_MEM="512M"
export ES_MAX_MEM
cd /ES-dir/bin
./elasticsearch.in.sh
./elasticsearch -f &

under Linux to start ES. Can you. please, suggest a trick to avoid falling
in red?

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d78daaaf-305b-45b4-ad9a-e34cf1adbb22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Ivan Brusic) #3

You can either use the startup scripts that come with the package when you
install via apt/yum [1] or use the service wrapper [2].

[1]
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-repositories.html
[2] https://github.com/elasticsearch/elasticsearch-servicewrapper

--
Ivan

On Fri, Jun 20, 2014 at 7:49 AM, Maciej Dziardziel fiedzia@gmail.com
wrote:

use start-stop-daemon or adapt /etc/init.d/elasticsearch to set up pidfile
guarding es instance. Or just run this way:
pgrep -f elasticsearch || ./start_es.sh

On Friday, June 20, 2014 3:21:08 PM UTC+1, Andrew Gaydenko wrote:

There were a couple of times during development workflow I have started
ES script the second time. It results in red status (I use Elastic HQ) and
not-working. So I'm forced to regenerate all indexes (with all test data)
again. It takes noticeable time.

At the moment I use this script

ES_MAX_MEM="512M"
export ES_MAX_MEM
cd /ES-dir/bin
./elasticsearch.in.sh
./elasticsearch -f &

under Linux to start ES. Can you. please, suggest a trick to avoid
falling in red?

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/d78daaaf-305b-45b4-ad9a-e34cf1adbb22%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/d78daaaf-305b-45b4-ad9a-e34cf1adbb22%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQDQMVO4sf-%3Dgq_cnQRX6cTP1RG7_HquR_tAoVa6A_VoFg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(Andrew Gaydenko) #4

On Friday, June 20, 2014 6:49:04 PM UTC+4, Maciej Dziardziel wrote:

use start-stop-daemon or adapt /etc/init.d/elasticsearch to set up pidfile
guarding es instance. Or just run this way:
pgrep -f elasticsearch || ./start_es.sh

Aha, thanks! - at my case pgrep is the most appropriate.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/115162b2-d679-48f0-a06e-24c47f74d079%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Clinton Gormley) #5

And in your config file, set:

node.max_local_storage_nodes: 1

that way you won't start two nodes on a single instance

On 20 June 2014 16:54, Andrew Gaydenko andrew.gaydenko@gmail.com wrote:

On Friday, June 20, 2014 6:49:04 PM UTC+4, Maciej Dziardziel wrote:

use start-stop-daemon or adapt /etc/init.d/elasticsearch to set up
pidfile guarding es instance. Or just run this way:
pgrep -f elasticsearch || ./start_es.sh

Aha, thanks! - at my case pgrep is the most appropriate.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/115162b2-d679-48f0-a06e-24c47f74d079%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/115162b2-d679-48f0-a06e-24c47f74d079%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAPt3XKTwyNM0DGJ_6HMoSbWmyJkSv5PObsfwGOF3tZ1a0QmJ9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(Andrew Gaydenko) #6

On Saturday, June 21, 2014 2:33:28 AM UTC+4, Clinton Gormley wrote:

And in your config file, set:

node.max_local_storage_nodes: 1

that way you won't start two nodes on a single instance

Great, thanks!

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/244c064e-3b2e-4b86-a2df-d1fa88617042%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #7