Starting elasticsearch via command line gives weird error

Hello,

I am starting the elasticsearch via command line using the following command:

/usr/share/elasticsearch/bin/elasticsearch -d -Edefault.cluster.name=test -Edefault.node.name=test-client-cluster-1 -Edefault.http.port=19270 -Edefault.http.host=0.0.0.0 -Edefault.path.conf=/opt/sources/wpCloud/node-sql-service/static/etc/elasticsearch -Edefault.path.logs=/var/log/elasticsearch/clients/test -Edefault.path.home=/usr/share/elasticsearch/v5 -Edefault.path.data=/var/lib/elasticsearch/clients/test -Edefault.transport.tcp.port=19370-19470 -Edefault.transport.host=0.0.0.0 -Edefault.pidfile=/var/run/elasticsearch/clients/test/test.pid -Edefault.path.repo=/.snapshots/test ```

But this is failing with the following error: ` ERROR: Parameter [-Edefault.cluster.name=test]does not start with --` 

Any idea how to fix it?

What version of Elasticsearch are you using? The syntax used to be -D, but was switched to -E in 5.0.0. So perhaps you have a pre-5.0 node installed but the startup option is trying to use the post-5.0 syntax?

The elasticsearch version is the latest o 5.2.2 downloaded and installed yesterday. I don't use the -D flag anywhere on -d which acording to the help is equal with --daemonize.

I have fixed that by starting it in the foregound. It was missing the log4j2.properties from the config folder. However now I am having a different error:

ERROR: bootstrap checks failed
initial heap size [1073741824] not equal to maximum heap size [2147483648]; this can cause resize pauses and prevents mlockall from locking the entire heap
memory locking requested for elasticsearch process but memory is not locked

Any idea?

Please read https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html

That's the thing I have the jvm.options set

-Xmx2g```

and still it's saying that the initial heap size is not equal with the max one.

Update: if I take out the -Edefault.http.host=0.0.0.0 and -Edefault.transport.host=0.0.0.0 then elasticsearch starts correctly but ones I add those options it quit working with the error above.

That's expected as described in Bootstrap Checks | Elasticsearch Guide [8.11] | Elastic

May be you changed a file which is not the expected one. The location depends I think on the package you downloaded.

That's not a solution. I need to make it able listen on 0.0.0.0 with random ports. This is a production setup not development where localhost binding would be enough. Also I need the ability to start it from command line without sysv or systemd, cause we are running multiple instances of elasticsearch on the same nodes for different customers so that they have their own environment.

What did you downloaded?

BTW running multiple nodes on the same physical machine only makes sense when you have more than 64gb of RAM. Otherwise use aliases, secure access with whatever you want (I'd recommend xpack - commercial).

But running multiple nodes on the same machine and sharing resources is a bad idea in general.

We have downloaded elasticsearch-5.2.2.tar.gz and copied all the folders to /usr/share/elasticsearch/v5/ since we have a default installation of elasticsearch 2.4.4. Basically the two should cohabit for some time. We are not running multiple nodes on the same machine. There are three machines each is runnign one node for the same instance but currently we have about 9 intances running v2.4.4 with no issues and we were thinking on moving slowly to v5 with the same setup.

So then you just launched elasticsearch with /usr/share/elasticsearch/v5/bin/elasticsearch without touching anything in /usr/share/elasticsearch/v5/config/jvm.options. Do I understand correctly?

This worked.

But then you launched

/usr/share/elasticsearch/v5/bin/elasticsearch -Edefault.http.host=0.0.0.0 -Edefault.transport.host=0.0.0.0

This did not work. Am I still right?
Not sure where this default is coming from. Never used that. Can you try with:

/usr/share/elasticsearch/v5/bin/elasticsearch -Enetwork.host=0.0.0.0

And share your logs please?

Somehow correct. If I start the command without the -Edefault.http.host=0.0.0.0 and -Edefault.transport.host=0.0.0.0 then it is working but it binded to the 127.0.0.1 which is not correct. As soon as I add those options or -Edefault.network.host=8.8.8.8 then it does not start anymore.

I am trying to find a way to send output since it's too long and this chat does not accept it.

here is the link to the log: http://pastebin.com/hmseERjS

Can you ls -l /opt/sources/wpCloud/node-sql-service/static/etc/elasticsearch please?

What is this? /opt/sources/wpCloud/node-sql-service/static/etc/elasticsearch/logging.yml
If you installed a fresh new version of elasticsearch you should not have that.

Can you remove all default. in your CLI parameters?

/usr/share/elasticsearch/v5/bin/elasticsearch -Ecluster.name=test -Enode.name=test-client-cluster-1 -Ehttp.port=19270 -Epath.conf=/opt/sources/wpCloud/node-sql-service/static/etc/elasticsearch -Epath.logs=/var/log/elasticsearch/clients/test -Epath.data=/var/lib/elasticsearch/clients/test -Etransport.tcp.port=19370-19470 -Epidfile=/var/run/elasticsearch/clients/test/test.pid -Epath.repo=/.snapshots/test -Enetwork.host=0.0.0.0

Don't try to share settings for version 2 and 5. May be dedicate a new config dir instead of /opt/sources/wpCloud/node-sql-service/static/etc/elasticsearch which I suppose was used by 2.x nodes.

I have created a new config folder to the elasticsearch v5.2.2 and restarted the command without the default. in -E.
The output can be seen in here:

http://pastebin.com/MyqTtca1

any other suggestions?

Can you answer to the questions I asked please?

elasticsearch-client.yml  elasticsearch.yml  logging.yml

This was the configuration folder of 2.4.4 since the elasticsearch.yml for v2.4.4. and v5.2.2 is the same I thought it wouldn't matter if I use the same folder. However I have splitted now and using different folder for 5.2.2

elasticsearch.yml  jvm.options  log4j2.properties```

I have tried to start without the default. I get the exact same errors as it can be seen above.

Great. Can you share the content of jvm.options?

You should have in it -Dlog4j2.disable.jmx=true. Is it there?