Skip to content
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

How can I install elastic 5.0 rc with this cookbook? #500

Closed
red8888 opened this issue Oct 11, 2016 · 5 comments
Closed

How can I install elastic 5.0 rc with this cookbook? #500

red8888 opened this issue Oct 11, 2016 · 5 comments

Comments

@red8888
Copy link

red8888 commented Oct 11, 2016

I added this to the attributes file:
default['elasticsearch']['checksums']['5.0.0-rc1']['rhel'] = '702fb2c36301514f8e8bd991ce6fa5e9c48bcc9a'
default['elasticsearch']['version'] = '5.0.0-rc1'

But I get this error:
[2016-10-11T14:29:55-04:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out

       [2016-10-11T14:29:55-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
       [2016-10-11T14:29:55-04:00] ERROR: elasticsearch_install[elasticsearch] (elasticsearch::default line 11) had an error: Net::HTTPServerException: remote_file[/tmp/kitchen/cache/elasticsearch-5.0.0-rc1.rpm] (/tmp/kitchen/cache/cookbooks/elasticsearch/libraries/provider_install.rb line 52) had an error: Net::HTTPServerException: 404 "Not Found"
@centran
Copy link

centran commented Oct 11, 2016

Looks like it isn't downloading it at all. I'm not even sure this cookbook will work with 5.0 yet but if you want to try then what you can do is download the rpm and put it in your cookbook files/default folder. Do a cookbook_file to place it into temp and then install from there. I have to do this as my servers do not have internet access. Again... not sure if this cookbook even works for 5.0rc1 or if what I paste below isn't error free but here is an example of what I do if you want to see if you can get it to work.

cookbook_file '/tmp/elastic.rpm' do
  source "elasticsearch-#{VERSION}.rpm"
end
elasticsearch_install 'install_es' do
  type :package
  download_url "file:///tmp/elastic.rpm"
  download_checksum CHECKSUM
end
`

@red8888
Copy link
Author

red8888 commented Oct 11, 2016

Ok so I overwrote the URL attributes to point directly to the rpm (looks like there isn't a dev repo or anything where the RC is hosted):

# Overwrite URL attribute to point directly to the 5.0 RC
default['elasticsearch']['download_urls'] = {
  'debian' => 'https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-%s.deb',
  'rhel' => 'https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0-rc1.rpm',
  # 'rhel' => 'https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-%s.noarch.rpm',
  'tar' => 'https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-%s.tar.gz'
}
default['elasticsearch']['download_urls_v2'] = {
  'debian' => 'https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/%s/elasticsearch-%s.deb',
  'rhel' => 'https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0-rc1.rpm',
  # 'rhel' => 'https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/rpm/elasticsearch/%s/elasticsearch-%s.rpm',
  'tar' => 'https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/%s/elasticsearch-%s.tar.gz'
}

But the checksum isn't working. If I go here (https://www.elastic.co/downloads/elasticsearch) and download the checksum for 5 RC rpm package and then plug that in to this attribute:
default['elasticsearch']['checksums']['5.0.0-rc1']['rhel'] = '702fb2c36301514f8e8bd991ce6fa5e9c48bcc9a'

I get this error:
ERROR: elasticsearch_install[elasticsearch] (elasticsearch::default line 11) had an error: Chef::Exceptions::ChecksumMismatch: remote_file[/tmp/kitchen/cache/elasticsearch-5.0.0-rc1.rpm] (/tmp/kitchen/cache/cookbooks/elasticsearch/libraries/provider_install.rb line 52) had an error: Chef::Exceptions::ChecksumMismatch: Checksum on resource (702fb2) does not match checksum on content (1cc8f4)

@martinb3
Copy link
Contributor

Hi there -- Chef uses sha256 checksums; last I looked, Elastic wasn't posting sha256 checksums. Every time we add additional checksums, we've had to download the files and re-sum them so that we can use the builtin Chef resources (they all rely on sha256). That's probably the issue you're seeing with checksums.

Regarding the 5.0.0-rc1, if they've changed the URL pattern for releases, that's likely part of the issue. As you've noticed, you can always force a particular URL.

@martinb3
Copy link
Contributor

Confirmed -- it looks like they've changed the URLs again; compare:

https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0-rc1.tar.gz
https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.4.1/elasticsearch-2.4.1.tar.gz

@martinb3
Copy link
Contributor

Hi there -- it looks like you've got things deployed, albeit no thanks to the cookbook :) I've opened https://github.com/elastic/cookbook-elasticsearch/milestone/7, as we're likely to make some other breaking changes with the addition of support for ES 5.x. If you encounter other compatibility issues, I'd like to track them against #503, if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants