# Starting elasticsearch via command line gives weird error

**URL:** <https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212>\
**Category:** Elasticsearch\
**Created:** [March 2, 2017, 7:48pm UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212 "2017-03-02T19:48:37Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)\
**Post date:** [March 2, 2017, 7:48pm UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/1 "2017-03-02T19:48:37Z")

</div>

Hello,

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

````auto
/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?
````

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [March 2, 2017, 11:04pm UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/2 "2017-03-02T23:04:29Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)\
**Post date:** [March 3, 2017, 6:58am UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/3 "2017-03-03T06:58:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)\
**Post date:** [March 3, 2017, 7:31am UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/4 "2017-03-03T07:31:00Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 3, 2017, 7:43am UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/5 "2017-03-03T07:43:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)\
**Post date:** [March 3, 2017, 7:56am UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/6 "2017-03-03T07:56:14Z")

</div>

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

````auto
-Xmx2g```

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

---

<div class="post-metadata">

**Author:** ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)\
**Post date:** [March 3, 2017, 8:24am UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/7 "2017-03-03T08:24:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 3, 2017, 8:49am UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/8 "2017-03-03T08:49:29Z")

</div>

> [@zozo6015](#):
>
> 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](https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html)

> [@zozo6015](#):
>
> That's the thing I have the jvm.options set

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

---

<div class="post-metadata">

**Author:** ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)\
**Post date:** [March 3, 2017, 10:54am UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/9 "2017-03-03T10:54:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 3, 2017, 11:09am UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/10 "2017-03-03T11:09:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)\
**Post date:** [March 3, 2017, 11:17am UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/11 "2017-03-03T11:17:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 3, 2017, 2:28pm UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/12 "2017-03-03T14:28:55Z")

</div>

> [@zozo6015](#):
>
> We have downloaded elasticsearch-5.2.2.tar.gz and copied all the folders to /usr/share/elasticsearch/v5/

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

```auto
/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:

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

```

And share your logs please?

---

<div class="post-metadata">

**Author:** ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)\
**Post date:** [March 3, 2017, 2:49pm UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/13 "2017-03-03T14:49:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)\
**Post date:** [March 3, 2017, 3:15pm UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/14 "2017-03-03T15:15:48Z")

</div>

here is the link to the log: [http://pastebin.com/hmseERjS](http://pastebin.com/hmseERjS)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 3, 2017, 7:12pm UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/15 "2017-03-03T19:12:03Z")

</div>

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?

```auto
/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.

---

<div class="post-metadata">

**Author:** ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)\
**Post date:** [March 3, 2017, 8:30pm UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/16 "2017-03-03T20:30:12Z")

</div>

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](http://pastebin.com/MyqTtca1)

---

<div class="post-metadata">

**Author:** ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)\
**Post date:** [March 5, 2017, 7:46am UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/17 "2017-03-05T07:46:45Z")

</div>

any other suggestions?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 5, 2017, 8:47am UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/18 "2017-03-05T08:47:00Z")

</div>

Can you answer to the questions I asked please?

---

<div class="post-metadata">

**Author:** ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)\
**Post date:** [March 5, 2017, 9:00am UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/19 "2017-03-05T09:00:47Z")

</div>

> [@dadoonet](#):
>
> /opt/sources/wpCloud/node-sql-service/static/etc/elasticsearch

```ls
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

````ls
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.
````

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 5, 2017, 9:03am UTC](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212/20 "2017-03-05T09:03:55Z")

</div>

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

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

[Next page](https://discuss.elastic.co/t/starting-elasticsearch-via-command-line-gives-weird-error/77212.md?page=2)
