Problem to set same path.data for Java client and elasticsearch service

Hi,

I just started using elasticsearch in the java application and have a
problem to configure path.data in elasticsearch.yml to point to the same
location on my local PC. I created some simple inputs from the java
application. I configured my client as given bellow:

ImmutableSettings.Builder settings = ImmutableSettings.settingsBuilder();
settings.put("path.home", "/home/zoran/elasticsearch");
settings.put("cluster.name","elasticsearch");
settings.put("node.name","movies");
settings.put("index.number_of_replicas", 0);
settings.put("index.number_of_shards", 1);

I'm trying to configure the same in elasticsearch server through the
configuration file, so I can access data from the web browser restful
client, but it fails to restart after I add
path.data: /home/zoran/elasticsearch

I'm sure that there is not a problem in permission (it's 777). I have
managed to make it start once, but it didn't point to the same directory as
data inserted from the java application was available only from the java
application.

Can you give me instructions what should I do here?

Thanks

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hey,

can you please paste the exception which occurs, I cannot imagine, that it
just does not work.

Also see http://www.elasticsearch.org/guide/reference/setup/dir-layout/
Setting path.home might require some more directories to exist (with the
correct permissions), please verify that.

--Alex

On Fri, May 24, 2013 at 12:15 AM, Zoran Jeremic zoran.jeremic@gmail.comwrote:

Hi,

I just started using elasticsearch in the java application and have a
problem to configure path.data in elasticsearch.yml to point to the same
location on my local PC. I created some simple inputs from the java
application. I configured my client as given bellow:

ImmutableSettings.Builder settings = ImmutableSettings.settingsBuilder();
settings.put("path.home", "/home/zoran/elasticsearch");
settings.put("cluster.name","elasticsearch");
settings.put("node.name","movies");
settings.put("index.number_of_replicas", 0);
settings.put("index.number_of_shards", 1);

I'm trying to configure the same in elasticsearch server through the
configuration file, so I can access data from the web browser restful
client, but it fails to restart after I add
path.data: /home/zoran/elasticsearch

I'm sure that there is not a problem in permission (it's 777). I have
managed to make it start once, but it didn't point to the same directory as
data inserted from the java application was available only from the java
application.

Can you give me instructions what should I do here?

Thanks

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Alexander,

Thank you for your email. Here is the whole method I'm using to get the
elasticsearch node:

ImmutableSettings.Builder settings = ImmutableSettings.settingsBuilder();
ElasticSearchConfig
elasticSearchConfig=Settings.getInstance().config.elastiSearchConfig;
String homePath=elasticSearchConfig.homePath; //homePath is set
to /home/zoran/elasticsearch
settings.put("cluster.name", elasticSearchConfig.clusterName);
settings.put("path.conf", homePath);
settings.put("path.data", homePath + "/data");
settings.put("path.work", homePath + "/work");
settings.put("path.logs", homePath + "/logs") ;
settings.put("index.number_of_replicas",
elasticSearchConfig.replicasNumber);
settings.put("index.number_of_shards",
elasticSearchConfig.shardsNumber);
settings.build();

    Node node =

NodeBuilder.nodeBuilder().settings(settings).local(true).build().start();
return node;

After I ran the java application and inserted couple of the documents, the
data directory was created in elasticsearch directory which was empty
before.
As sudo I added 777 permissions on /home/zoran/elasticsearch and all
subdirectories.
Furthermore, in /etc/elasticsearch/elasticsearch.yml I uncommented line:

path.data: /home/zoran/elasticsearch/data

after elasticsearch restart I had

  • Stopping ElasticSearch
    Server [ OK
    ]
  • Starting ElasticSearch
    Server [fail]

There is no exception I can paste here. In elasticsearch.log this is the
whole log I have:

[2013-05-27 09:35:51,035][INFO ][node ] [movies]
{0.90.0}[2107]: initializing ...
[2013-05-27 09:35:51,040][INFO ][plugins ] [movies] loaded
[], sites []
[2013-05-27 09:35:52,885][INFO ][node ] [movies]
{0.90.0}[2107]: initialized
[2013-05-27 09:35:52,885][INFO ][node ] [movies]
{0.90.0}[2107]: starting ...
[2013-05-27 09:35:52,972][INFO ][transport ] [movies]
bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/
192.168.0.23:9300]}
[2013-05-27 09:35:55,994][INFO ][cluster.service ] [movies]
new_master [movies][gHSsdNzqSU-0BZH_8C5HEQ][inet[/192.168.0.23:9300]],
reason: zen-disco-join (elected_as_master)
[2013-05-27 09:35:56,016][INFO ][discovery ] [movies]
elasticsearch/gHSsdNzqSU-0BZH_8C5HEQ
[2013-05-27 09:35:56,028][INFO ][http ] [movies]
bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/
192.168.0.23:9200]}
[2013-05-27 09:35:56,028][INFO ][node ] [movies]
{0.90.0}[2107]: started
[2013-05-27 09:35:56,642][INFO ][gateway ] [movies]
recovered [1] indices into cluster_state
[2013-05-27 11:49:31,244][INFO ][node ] [movies]
{0.90.0}[2107]: stopping ...
[2013-05-27 11:49:31,290][INFO ][node ] [movies]
{0.90.0}[2107]: stopped
[2013-05-27 11:49:31,290][INFO ][node ] [movies]
{0.90.0}[2107]: closing ...
[2013-05-27 11:49:31,299][INFO ][node ] [movies]
{0.90.0}[2107]: closed

Do you have any idea, what could be the problem?

Thanks

On Sun, May 26, 2013 at 11:25 PM, Alexander Reelsen alr@spinscale.dewrote:

Hey,

can you please paste the exception which occurs, I cannot imagine, that it
just does not work.

Also see http://www.elasticsearch.org/guide/reference/setup/dir-layout/
Setting path.home might require some more directories to exist (with the
correct permissions), please verify that.

--Alex

On Fri, May 24, 2013 at 12:15 AM, Zoran Jeremic zoran.jeremic@gmail.comwrote:

Hi,

I just started using elasticsearch in the java application and have a
problem to configure path.data in elasticsearch.yml to point to the same
location on my local PC. I created some simple inputs from the java
application. I configured my client as given bellow:

ImmutableSettings.Builder settings = ImmutableSettings.settingsBuilder();
settings.put("path.home", "/home/zoran/elasticsearch");
settings.put("cluster.name","elasticsearch");
settings.put("node.name","movies");
settings.put("index.number_of_replicas", 0);
settings.put("index.number_of_shards", 1);

I'm trying to configure the same in elasticsearch server through the
configuration file, so I can access data from the web browser restful
client, but it fails to restart after I add
path.data: /home/zoran/elasticsearch

I'm sure that there is not a problem in permission (it's 777). I have
managed to make it start once, but it didn't point to the same directory as
data inserted from the java application was available only from the java
application.

Can you give me instructions what should I do here?

Thanks

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/J2aeOjHuMk8/unsubscribe?hl=en-US
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--


Zoran Jeremic, PhD
Postdoctoral Fellow

Ryerson University, Toronto
Tel: +1 604 92 89 944
E-mail: zoran.jeremic@gmail.com zoran.jeremic@va.mod.gov.rs
Homepage: http://zoranjeremic.org


--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.