Install Elasticsearch 1.0.1 on Ubuntu 12.04 fails with sudo dpkg -i elasticsearch-1.0.1.deb

2.9k Views Asked by At

I am trying to install Elasticsearch 1.0.1 on Ubuntu 12.04. So far I have done:

First I removed the old elasticsearch 0.90 package

sudo dpkg -r elasticsearch

Then

cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y

wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
sudo dpkg -i elasticsearch-1.0.1.deb

The last step results in the following

(Reading database ... 57341 files and directories currently installed.)
Preparing to replace elasticsearch 1.0.1 (using elasticsearch-1.0.1.deb) ...
Unpacking replacement elasticsearch ...
Setting up elasticsearch (1.0.1) ...
chown: cannot access `/etc/elasticsearch/*': No such file or directory

So I created /etc/elasticsearch with a dummy file in it and then did

sudo chmod 777 /etc/elasticsearch

Now when I run

sudo dpkg -i elasticsearch-1.0.1.deb

I get

(Reading database ... 57341 files and directories currently installed.)
Preparing to replace elasticsearch 1.0.1 (using elasticsearch-1.0.1.deb) ...
Unpacking replacement elasticsearch ...
Setting up elasticsearch (1.0.1) ...
Processing triggers for ureadahead ...

But nothing appears in /etc/elasticsearch

However I do get a folder appear in

/usr/share/elasticsearch

With the following contents

bin  core-signatures.txt  lib  NOTICE.txt  README.textile

From here if I run

sudo bin/elasticsearch

I get

log4j:WARN No appenders could be found for logger (node). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

And continues to run

If I open a new window and run

curl -XGET 'localhost:9200'

I get

{
  "status" : 200,
  "name" : "Volstagg",
  "version" : {
    "number" : "1.0.1",
    "build_hash" : "5c03844e1978e5cc924dab2a423dc63ce881c42b",
    "build_timestamp" : "2014-02-25T15:52:53Z",
    "build_snapshot" : false,
    "lucene_version" : "4.6"
  },
  "tagline" : "You Know, for Search"
}

So it appears to be running, and I can populate the search (symfony2 FOSElasticaBundle) with

php app/console fos:elastica:populate

But if I do a search no results are found.

So the question is please, has it installed or not and why isn't it working properly?

I am using the github.com/FriendsOfSymfony/FOSElasticaBundle with Symfony2 PHP framework. The config for the bundle is this:

fos_elastica:
clients:
    default: { host: localhost, port: 9200 }
indexes:
    products:
        client: default
        types:
            product:
                mappings:
                    name: { boost: 5 }
                    commonName: { boost: 5 }
                    sku: { boost: 3 }
                    description:
                    isRemedy:
                    countries:
                        type: "nested"
                        properties:
                            code: ~
                    book:
                        type: "nested"
                        properties:
                            author: ~
                            isbn: ~

                persistence:
                    driver: orm
                    model: Helios\CoreBundle\Entity\Product
                    provider: ~
                    finder: ~
                    listener: ~
                    elastica_to_model_transformer:
                        ignore_missing: true

When I populate I don't get any errors, but still the search does not work.

Thanks

2

There are 2 best solutions below

7
Jettro Coenradie On

Not sure why you cannot search, but there are a few things that you can check. On this page the paths to configuration files are mentioned.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-service.html

The init script is placed at /etc/init.d/elasticsearch is you would expect it. The configuration file is placed at /etc/default/elasticsearch.

To check if everything is fine by running queries like: /_cluster/health /_nodes/stats

Hope that helps

0
Patrick On

I have managed to install elasticsearch- 1.0.1 by using an old method

cd ~
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.tar.gz
tar -xf elasticsearch-1.0.1.tar.gz
cd /usr/local/
sudo mkdir elasticsearch
cd elasticsearch
cd ~
sudo mv elasticsearch-1.0.1 /usr/local/elasticsearch/

now if I run

curl -XGET 'localhost:9200'

it returns

{
  "status" : 200,
  "name" : "Mister Jip",
  "version" : {
    "number" : "1.0.1",
    "build_hash" : "5c03844e1978e5cc924dab2a423dc63ce881c42b",
    "build_timestamp" : "2014-02-25T15:52:53Z",
    "build_snapshot" : false,
    "lucene_version" : "4.6"
  },
  "tagline" : "You Know, for Search"
}

curl -XGET 'localhost:9200/_cluster/health?pretty'

now returns:

{
  "cluster_name" : "elasticsearch",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 2,
  "number_of_data_nodes" : 2,
  "active_primary_shards" : 5,
  "active_shards" : 10,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0
}

I can populate my search indexes and all is working fine. I still don't know why I couldn't install with the package installer so my original question is unanswered.