Skip to content

elasticsearch: add 5.x package, service #25857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 31, 2017
Merged

elasticsearch: add 5.x package, service #25857

merged 1 commit into from
May 31, 2017

Conversation

apeschar
Copy link
Contributor

@apeschar apeschar commented May 17, 2017

Motivation for this change

It would be nice to be able to install Elasticsearch 5.

The Elasticsearch service now works with Elasticsearch 1.x, 2.x and 5.x.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Sorry, something went wrong.

@mention-bot
Copy link

@apeschar, thanks for your PR! By analyzing the history of the files in this pull request, we identified @offlinehacker, @bjornfor and @rickynils to be potential reviewers.

@grahamc
Copy link
Member

grahamc commented May 17, 2017

Is it reasonable to continue packaging the older ES's?

@apeschar
Copy link
Contributor Author

I guess so:

  • ES 2.4 is still very popular.
  • Due to backwards incompatibilities some packages (such as Graylog2) won't work with ES 5.x.

I don't know anything about ES 1.x. Maybe drop it, if there's no dependencies?

Does @offlinehacker have an opinion on this?

@NeQuissimus
Copy link
Member

I doubt people are still using 1.x much, but keeping 2.x is reasonable.

@apeschar
Copy link
Contributor Author

Removing 1.x seems to break the elasticsearchPlugins build. This is a mess anyway, as some plugins in there are for 1.x, and some for 2.x, but they all use the 1.x code for building.

So I suggest doing this in a separate PR, and seeing if we can merge the ES 5 addition now.

@NeQuissimus
Copy link
Member

I don't have a chance to test this right now but LGTM in principle

@NeQuissimus NeQuissimus self-requested a review May 17, 2017 16:57
@globin
Copy link
Member

globin commented May 20, 2017

cc @fadenb who was working on this, too

@fadenb
Copy link
Contributor

fadenb commented May 21, 2017

Looks good to me. I can test this properly on Monday.

Did you test whether the current plugin logic of the module is working? I only got it to look for modules relative to the nix store path with my code.

@fadenb
Copy link
Contributor

fadenb commented May 22, 2017

When starting the service with package elasticsearch5 it fails after a brief moment:
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
Putting a LimitNOFILE = "1024000"; into the serviceConfig fixes that issue. I believe that this is also safe for elastic 2.x.

Another issues that comes up is: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

@fadenb
Copy link
Contributor

fadenb commented May 23, 2017

@apeschar With minor modifications your service is working fine for me. Take a look at https://gist.github.com/fadenb/dd01c673edf59099ed08cfaa0c2cbaf4

@basvandijk
Copy link
Member

I'm also getting the "Too many open files" error on elasticsearch-2.4.4. It would be great to get the LimitNOFILE fix from @fadenb on release-17.03 as well.

Speaking of which: since this whole change is backwards compatible we could cherry-pick this on release-17.03. I would love to try out the latest elasticsearch on our production systems!

fadenb pushed a commit to mayflower/nixpkgs that referenced this pull request May 23, 2017
@apeschar
Copy link
Contributor Author

@fadenb, thanks! I added your changes to the pull request.

I haven't looked into the plugins-- it won't break anything for 2.x, but I'm not sure if installing plugins works for 5.x. So that's something worth testing.

I'm more or less away for a week or so, so I won't be able to test this until then...

@basvandijk
Copy link
Member

basvandijk commented May 23, 2017

I also upgraded kibana to 5.4 using:

{
  kibana = super.kibana.overrideAttrs (_oldAttrs: {
    src = super.fetchurl {
      url = "https://artifacts.elastic.co/downloads/kibana/kibana-5.4.0-linux-x86_64.tar.gz";
      sha256 = "1g5i81wq77fk6pyaq3rpfqs2m23xsbz2cndh3rg4b59ibg5qv0sq";
    };
  });
}

The web interface appears in my browser:

2017-05-23-171418_1202x702_scrot

but kibana is getting timeouts on elasticsearch:

2017-05-23-171741_1202x468_scrot

@basvandijk
Copy link
Member

basvandijk commented May 29, 2017

Is somebody able to replicate my kibana-5.4 issue together with elasticsearch-5.4?

@basvandijk
Copy link
Member

I discovered a workaround for my kibana issue:

  • The timeout occurs when kibana tries to add an index pattern. I see my browser (chrome) POSTing some JSON to: http://kibana.lumi.guide/es_admin/.kibana/index-pattern/mypattern-*'. For some reason that request times out.

  • If I perform the same request via curl (in the chrome network inspector right click on the request and choose Copy->Copy as cURL) it succeeds instantly. After that my index pattern is created and kibana functions correctly.

@basvandijk
Copy link
Member

Note that Elastic recommends keeping the whole ELK stack on the same version so in #26252 I upgraded logstash, kibana and the beats to 5.4.0.

@fpletz fpletz added this to the 17.09 milestone May 31, 2017
@fpletz fpletz added 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (update) This PR updates a package to a newer version labels May 31, 2017
@fpletz fpletz merged commit 47d038c into NixOS:master May 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (update) This PR updates a package to a newer version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants