Skip to content

starting first a non-data node and after that the data node will fail to allocate the index #167

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

Closed
ghost opened this issue May 11, 2010 · 4 comments

Comments

@ghost
Copy link

ghost commented May 11, 2010

Thanks a lot for the great work!
Not sure if the following is really a small bug or intentional:
For now (elasticsearch <=0.6) it is mandatory to start first a data-node and after that the non-data-node if you want to have access to the index (else => { "error" : "IndexMissingException[[twitter] missing]" }.

-o

@kimchy
Copy link
Member

kimchy commented May 11, 2010

Can you explain more the process? Not sure I followed. For example, run this curl script, then start X, then stop, then restart, yada yada yada ;)

@ghost
Copy link
Author

ghost commented May 14, 2010

First, let me explain, I figured out what I was doing wrong - see at the bottom. But first here is my scenario:

start nodes to index something

$ bin/elasticsearch -Des.gateway.type=fs -Des.gateway.fs.location=/home/lucene/elasticsearch/snapshot/gateway -Des.index.gateway.snapshot_interval=-1 -Des.index.engine.robin.refresh_interval=-1 -Des.http.enabled=false

$ bin/elasticsearch -f -Des.node.data=false

$ curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d '
{
"user": "kimchy",
"postDate": "2009-11-15T13:12:00",
"message": "Trying out Elastic Search, so far so good?"
}'

$ curl -XGET 'http://localhost:9200/twitter/tweet/1?pretty=true'

{
"_index" : "twitter",
"_type" : "tweet",
"_id" : "1", "_source" :
{
"user": "kimchy",
"postDate": "2009-11-15T13:12:00",
"message": "Trying out Elastic Search, so far so good?"
}
}

shutdown all nodes and start first data node and after that the non data node

$ curl -XPOST 'http://localhost:9200/_cluster/nodes/_all/_shutdown'

$ bin/elasticsearch -Des.gateway.type=fs -Des.gateway.fs.location=/home/lucene/elasticsearch/snapshot/gateway -Des.index.gateway.snapshot_interval=-1 -Des.index.engine.robin.refresh_interval=-1 -Des.http.enabled=false

$ bin/elasticsearch -f -Des.node.data=false

$ curl -XGET 'http://localhost:9200/twitter/tweet/1?pretty=true'

{
"_index" : "twitter",
"_type" : "tweet",
"_id" : "1", "_source" :
{
"user": "kimchy",
"postDate": "2009-11-15T13:12:00",
"message": "Trying out Elastic Search, so far so good?"
}
}

shutdown all nodes and start first the non-data node and after that the data

$ curl -XPOST 'http://localhost:9200/_cluster/nodes/_all/_shutdown'

$ bin/elasticsearch -f -Des.node.data=false

$ bin/elasticsearch -Des.gateway.type=fs -Des.gateway.fs.location=/home/lucene/elasticsearch/snapshot/gateway -Des.index.gateway.snapshot_interval=-1 -Des.index.engine.robin.refresh_interval=-1 -Des.http.enabled=false

$ curl -XGET 'http://localhost:9200/twitter/tweet/1?pretty=true'

{
"error" : "IndexMissingException[[twitter] missing]"

Btw. even when I now shutdown the non-data node and restart that non-data node,
these nodes donot "find" them (I guess) => cannot XGET a document.

But at least, I figured that when I start the non-data node with all the
parameters used for the data node, it works:

$ bin/elasticsearch -f -Des.node.data=false -Des.gateway.type=fs -Des.gateway.fs.location=/home/lucene/elasticsearch/snapshot/gateway -Des.index.gateway.snapshot_interval=-1 -Des.index.engine.robin.refresh_interval=-1

I was a little bit confused that it is necessary to parametrize a non-data node
with data-parameters, but that will do it :)

@kimchy
Copy link
Member

kimchy commented May 14, 2010

Ahh, I see what happened... . The problem is that the first node started will become the master and reload the cluster meta data (which includes indices created) from the gateway. This is why you need to configure the gateway on it as well.

What you can do, by the way, is set node.client to true (will automatically set it to be a non data node as well). In this case (this only works with the new zen discovery in upcoming 0.7), the client node will not become master, but wait till one will be started.

make sense?

@ghost
Copy link
Author

ghost commented May 14, 2010

excellent :)

rmuir pushed a commit to rmuir/elasticsearch that referenced this issue Nov 8, 2015
With elasticsearch 2.0, `path.home` must be set now. Standalone Runner (test) is using elasticsearch CLI which relies on `Environment` to be set.

It produces now:

```
Exception in thread "main" java.lang.IllegalStateException: path.home is not configured
	at org.elasticsearch.env.Environment.<init>(Environment.java:99)
	at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:85)
	at org.elasticsearch.common.cli.CliTool.<init>(CliTool.java:107)
	at org.elasticsearch.common.cli.CliTool.<init>(CliTool.java:100)
	at org.elasticsearch.index.mapper.attachment.test.standalone.StandaloneRunner.<init>(StandaloneRunner.java:170)
	at org.elasticsearch.index.mapper.attachment.test.standalone.StandaloneRunner.main(StandaloneRunner.java:175)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
```

Closes elastic#167.
rmuir pushed a commit to rmuir/elasticsearch that referenced this issue Nov 8, 2015
Don't use forbidden API. Actually we don't need to create any `tmp` dir.

Related to elastic#167.
costin pushed a commit that referenced this issue Dec 6, 2022
🤖 ESQL: Merge upstream
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this issue Oct 2, 2023
elastic/rally-eventdata-track#67 changes
the track parameter `shard_count` to the convention `number_of_shards`
used in the standard tracks.

This commit applies this change to the longrunning benchmarks
race configuration.
This issue was closed.
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

1 participant