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

Latest version of elasticsearch can't be installed #39

Closed
mikehaertl opened this issue Jul 2, 2013 · 15 comments
Closed

Latest version of elasticsearch can't be installed #39

mikehaertl opened this issue Jul 2, 2013 · 15 comments

Comments

@mikehaertl
Copy link

I've installed your package under Vagrant and tried to install elasticsearch 0.90.2 on a precise64 box with a configuration like this:

class { 'elasticsearch':
  version => '0.90.2'
}

During vagrant provision i get this error:

err: /Stage[main]/Elasticsearch::Package/Package[elasticsearch]/ensure: change from purged to 0.90.2 failed: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install elasticsearch=0.90.2' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package elasticsearch
 at /tmp/vagrant-puppet/modules-0/elasticsearch/manifests/package.pp:82

I have to admit that i'm quite new to puppet, so maybe i miss a basic step. But isn't the main idea that the module should take care of the complete installation process and add apt repos if neccessary?

Sorry if this is an invalid bug. I'd appreciate any help.

@electrical
Copy link

Thank you for using the puppet module and your full report.
With this puppet module by default i assume elasticsearch is available via some repository.
When that's not possible for some reason you can supply the .deb. or .rpm package via 'pkg_source' variable option; for example:

class { 'elasticsearch':
  pkg_source => 'puppet:///path/to/elasticsearch-0.90.2.deb'
}

Hope this makes it more clearer for you?

@mikehaertl
Copy link
Author

Thanks, that really helps a lot!

Can I also point to some URL (e.g. the official elasticsearch download location)?

@electrical
Copy link

I'm afraid an URL won't work, its a possible feature though but think it will barely be used.
You can best put the package in the vagrant dir and use that.

@mikehaertl
Copy link
Author

Ok, thanks for your help. Maybe you should also add the above option as example to the README?

@electrical
Copy link

Good point :-) will put it on my todo list. Thanks.

@mikehaertl
Copy link
Author

Sorry, it's still not quite working.

I've put the file under vagrant/modules/elasticsearch/files/elasticsearch-0.90.2.deb and configured your module like

class { 'elasticsearch' :
  pkg_source => 'puppet:///modules/elasticsearch/files/elasticsearch-0.90.2.deb'
}

The error then is

err: /Stage[main]/Elasticsearch::Package/File[/tmp/elasticsearch-0.90.2.deb]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:///modules/elasticsearch/files/elasticsearch-0.90.2.deb at /tmp/vagrant-puppet/modules-0/elasticsearch/manifests/package.pp:65

What's wrong?

@mikehaertl
Copy link
Author

I also found this link where they suggest to create an empty lib directory in any puppet module. So i created vagrant/modules/elasticsearch/lib but no difference. Still get the same error message.

@mikehaertl
Copy link
Author

Ok, after learning more about puppets file serving i changed the configuration to:

class { 'elasticsearch' :
  pkg_source => 'puppet:///modules/elasticsearch/elasticsearch-0.90.2.deb'
}

Note the missing files. Now it almost works. I get another error that the service could not be started. But i'll open another issue, as this is not related to installation anymore.

Sorry for the noise :)

@mikehaertl
Copy link
Author

It finally works. I had to install java. So i downloaded the java module from here and added

class { 'java': }
class { 'elasticsearch' :
  pkg_source => 'puppet:///modules/elasticsearch/elasticsearch-0.90.2.deb'
}

to my puppet config. I'm not sure if this is the right way, but at least it works.

@electrical
If you think I could improve that setup i'm happy to hear about it. :)

@electrical
Copy link

Hi, that can work fine yeah.
In the module it self i also provide a way to install java ( not completely documented yet )
But using an other module is usually better :-)

Glad its working now.

@yonromai
Copy link

I had the same problem on ubuntu 12.04. Worked like a charm!
Thanks a ton mike!

@philfreo
Copy link

So what's the recommended approach in Puppet to get the elasticsearch-0.90.3.deb file downloaded locally from wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.3.deb so that it can be installed? Rather than checking the a 17MB file into the puppetmaster config source control repo.

@philfreo
Copy link

In case this helps somebody else, here's how I installed ElasticSearch 0.90.3 on Ubuntu 12.04 LTS with Puppet + this module:

class our_elasticsearch($version='0.90.3') {

  # We couldn't simply rely on the 'elasticsearch' module from:
  # https://github.com/elasticsearch/puppet-elasticsearch because it requires your desired
  # version to be in your package manager, but ours isn't.

  exec { "download_elasticsearch":
    command => "/usr/bin/wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-${version}.deb -O /tmp/elasticsearch-${version}.deb",
    creates => "/tmp/elasticsearch-${version}.deb"
  }

  package { 'openjdk-7-jre-headless': ensure => present }

  class { 'elasticsearch':
    pkg_source  => "/tmp/elasticsearch-${version}.deb",
    require     => [ Package['openjdk-6-jre-headless'], Exec['download_elasticsearch'] ],
    autoupgrade => true,
  }

}

@eddiejaoude
Copy link

Thanks @philfreo

@electrical
Copy link

@eddiejaoude @philfreo im working on a re-write of the module which will provide different ways of getting the package installed.
It will contain the following options:
repository install ( default ) http, https, ftp downloads. puppet:// file resource or file: ( localfile ) resource )

Hope this will help in future deployments.

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

5 participants