Closed Bug 1131124 Opened 9 years ago Closed 9 years ago

fix Elasticsearch running issues in vagrant vm

Categories

(Input :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: willkg, Assigned: lgp171188, Mentored)

Details

(Whiteboard: u=contributor c=vagrant p= s=input.2015q2)

The vagrant_provision.sh script installs Elasticsearch from the Elasticsearch ubuntu repositories. It's currently installing 0.90.10, but at some point in the future our Elasticsearch cluster will get upgraded to something more recent. After Elasticsearch is installed from the package, the provision script runs update-rc.d and sets it up to start on startup.

Thus when a contributor starts their vm, Elasticsearch should be up and running and everything should be groovy.

I've heard several anecdotes about how this isn't always the case. Also, I've heard several anecdotes about Elasticsearch dying after a few test runs.

The current working theory is that Elasticsearch is consuming too much memory for the vagrant vm and that it dies on startup or at some point with out of memory errors.

This bug covers looking into this further and doing something to alleviate the problems.
For now, until there's evidence otherwise, let's assume the theory is correct. Therefore, we should do the following:

1. add a note to the docs about how to increase the amount of memory that vagrant uses for the vm in case the user needs/wants to

2. fix the vagrant_provision.sh script to stomp on the default elasticsearch configuration with a configuration that's better suited for a one-node/shard virtual machine environment--theoretically this will use less memory

3. (if all else fails) increase the default memory requirements to 1024--we should avoid this if we can since it's likely to reduce the pool of contributors who can run this in the first place
Whiteboard: u=contributor c=vagrant p= s=input.2015q1
Kitsune and DXR both use vagrant and Elasticsearch. It's possible one of them has this working better.
I've been doing other Vagrant-y things lately. I think we should do the following here:

1. Raise the vm memory to 1024mb.

2. Change the vagrant_provision.sh script to stomp on the Elasticsearch config with one that's better suited for one-node/shard Elasticsearch environment might alleviate some memory tensions


I tweak my local Elasticsearch configuration with these lines:

index.number_of_shards: 1
index.number_of_replicas: 0
index.refresh_interval: 10

The way DXR does it is that they tell you to increase the memory of the vm to 6gb. I don't think we want to require that since it prevents many people from contributing to Fjord.

Kitsune doesn't have a working vagrant environment.
Erik suggested we make sure we're using at least Java 7, too. OpenJDK is fine.
Anecdote: mkelly had problems with running the tests. He got an OSError("Out of Memory") kind of thing from Python (not Elasticsearch, but I think it's still a memory scarcity problem). He increased the vm memory to 1024mb and didn't have it happen again.
LGuruprasad is working on this--assigning it to him.
Assignee: nobody → lgp171188
Mentor: willkg
Bumping this to 2015q2.
Whiteboard: u=contributor c=vagrant p= s=input.2015q1 → u=contributor c=vagrant p= s=input.2015q2
Landed in https://github.com/mozilla/fjord/commit/fb8dce2916d5b4237ea9e3e4d520ea624800f364

This doesn't affect production environments, so I'm marking it FIXED.

Thank you!
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.