ElasticSearch: Indexing times out if number_of_replicas is greater than 1 - elasticsearch

I'm experimenting with scaling ElasticSearch and want to increase the amount of replicas, but I am unable to index anything if the number_of_replicas is set higher than 1.
I've been able to replicate the issue with a fresh install of ES:
Download and unzip ES
Modify the config/elasticsearch.yml file and set the index.number_of_replicas setting to 2
Run bin/elasticsearch
Index a test document: curl -XPUT 'localhost:9200/test/example/1' -d '{body:"Hello"}'
Timeout
I'm running the latest version of ES (1.2.1) on a Mac OSX 10.9.2. I've also been running ES on an Ubuntu Wheezy VM, but I encountered the same problem there. Setting the number of replicas on an index-basis (using a PUT request) has the same effect. It makes me feel like I'm missing something fundamental.

Power up more ES nodes (see my second comment)

Related

Can't pass path of my ES config file from the command line

Maybe I am thick, but I can't seem to find a way to pass ES a config file path from the command line. I have been searching and reading for 45 mins now (including several posts on Stack Overflow), and none of the proposed solutions works.
Here are the ones I tried:
elasticsearch -Des.config=/path/to/my/elasticsearch.yml
==> ERROR: D is not a recognized option
elasticsearch -Ees.config=/path/to/my/elasticsearch.yml
==> org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: unknown setting [es.config] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
elasticsearch -Econfig=/path/to/my/config.yml
==> org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: unknown setting [config] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
elasticsearch -Epath.conf=/path/to/config/dir/with/elasticsearch.yml
==> No exception, but the program terminates without any output whatsoever (no error message). Since I didn't specify the -d option, I am assuming that it's not running as a daemon and that therefore, the ES server is not running by the end of that.
Can anyone pull me out of the mud here?
Thx.
I too struggled with the same issue and tried the same sort of commands as you did. The problem here is caused due to the version of elastic search.
If your version is above 5.0.0 and as per this none of the above commands will work. Also it looks like they have limited the types of parameters that can be passed from the command line.
The easiest way is to just cd to the directory you installed elasticsearch and then just ./bin/elasticsearch (Make sure you don't execute it as root, it doesn't allow you to run as root.)
The issue here is that after every new version of ES, some older functionality gets removed/updated which is frustrating. I'm currently working with Elasticsearch v6.4.0 and as for now this works.

Elasticsearch not responding after update (1.7.5 -> 2.3.1)

I had Elasticsearch 1.7.5 and kopf plugin installed.
I've updated Elasticsearch to 2.3.1 and kopf to 2.0 and now it's not responding (Unable to connect error in browser). When I downgrade both to previous versions all work fine.
I run Ubuntu 14.04 + Apache2.
I checked here and here but did not find anything (tried various settings).
Thank you for any help.
So finally I got to the point where all works fine again.
you need to remember that it is yaml file so every character counts - I had unnecessary white spaces in it.
I added settings:
network.host: site (please remember to add _ before and after)
http.cors.enabled: true
http.cors.allow-origin: /https?://localhost(:[0-9]+)?/
and finally in my PHP code I set the host
$client =
ClientBuilder::create()->setHosts(['http://domain.local:9200'])->build();
In command line I'm calling and getting positive result
curl -XGET http://domain.local:9200/
Very, very big thank you for your help.

How to update the elasticsearch client properly

The version of the Elasticsearch client on my production server is 1.1.1
I need to update it because I had to use a function like "field_value_factor" which is not supported in this specific version. It's not a problem to loose the existing indexes. This is the commands lines I have imagined :
/etc/init.d/elasticsearch stop
dpkg -r elasticsearch
dpkg -i elasticsearch-1.4.1.deb
update-rc.d elasticsearch defaults 95 10
What do you think ?

Running Cassandra on Mac OS X

I am trying to run Cassandra on my mac.
I installed it following the steps detailed here: http://www.datastax.com/docs/1.0/getting_started/install_singlenode_root
but when I run:
bin/nodetool ring –h localhost
I get the following error message:
Class JavaLaunchHelper is implemented in both
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java and
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
How can I make cassandra work?
Many thanks
You are using ancient docs. On a recent version of Cassandra, run the command like this:
bin/nodetool -h localhost ring (see http://www.datastax.com/documentation/cassandra/2.1/cassandra/tools/toolsRing.html)
If you installed vnodes (the default), use nodetool status for an easier-to-read output.
Please use these docs or the docs that match your installation, I doubt you installed Cassandra 1.0. Please check the installation instructions that match the version you downloaded.
CORRECTION: the nodetool ring command worked for me using options in any position on 2.0.10:
bin/nodetool -h localhost ring
bin/nodetool ring -h localhost
and using --h instead of -h
It is a known bug in the JDK but it is not going to stop you from running Cassandra.
What you can do is to set JAVA_HOME variable explicitly.
It will not solve the bug, but it might remedy the error.
This is problem with jdk version, so you have to do the following
unset JAVA_HOME from your terminal.
edit nodetool and assign JAVA variable with jdk version less than jdk7.
JAVA = /Library/Java/JavaVirtualMachines/jdk1.6.0_xx.jdk/Contents/Home/bin/java
then run nodetool, you should be able to go without any issue.

MasterNotDiscoveredException in Elastic Search when creating an index

I've followed the simple tutorial to install elastic-search on a clean debian lenny machine:
http://www.elasticsearch.org/tutorials/2010/07/02/setting-up-elasticsearch-on-debian.html
However, when trying to create index with mapping:
curl -XPUT "localhost:9200/searchdata" -d #index.json
I get this error:
{"error":"MasterNotDiscoveredException[]","status":500}
I've used the index.json on another instance of ES, so I know that it works. I'm assuming I'm missing something the the ES config file. currently I have this:
cluster:
name: MyCluster
network:
host: _eth0_
As docs are pretty scarce for ES, I thought I'd see if anyone can lead me to a solution. Thanks in advance.
Not sure the issue, but a clean install of the OS fixed it.

Resources