# Xpack setup-passwords gives java.net.BindException

**URL:** <https://discuss.elastic.co/t/xpack-setup-passwords-gives-java-net-bindexception/139702>\
**Category:** Elasticsearch\
**Created:** [July 12, 2018, 9:12am UTC](https://discuss.elastic.co/t/xpack-setup-passwords-gives-java-net-bindexception/139702 "2018-07-12T09:12:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkparkar](https://avatars.discourse-cdn.com/v4/letter/r/82dd89/32.png) [@rkparkar](https://discuss.elastic.co/u/rkparkar)\
**Post date:** [July 12, 2018, 9:12am UTC](https://discuss.elastic.co/t/xpack-setup-passwords-gives-java-net-bindexception/139702/1 "2018-07-12T09:12:24Z")

</div>

I am following elastic guideto install xpack. (ref: [https://www.elastic.co/guide/en/elasticsearch/reference/6.2/installing-xpack-es.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/installing-xpack-es.html))

but when i try to setup-password (command : bin/x-pack/setup-passwords interactive) i get the following error :  
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 8946; nested exception is:  
java.net.BindException: Address already in use (Bind failed)

The port seems to be used to by elasticsearch itself. this port is in use when i start elasticsearch which is as per step 6 in the guide.

is that we need to shut elasticsearch while setting up the password ?

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [July 12, 2018, 9:28am UTC](https://discuss.elastic.co/t/xpack-setup-passwords-gives-java-net-bindexception/139702/2 "2018-07-12T09:28:23Z")

</div>

> is that we need to shut elasticsearch while setting up the password ?

No, you need to have Elasticsearch running in order to set the passwords.

The problem seems to be that your java processes are configured to enable an RMI server when they start. I'm not quite sure how you've managed to do that - maybe you've got a custom java agent installed, or something like that.

What details can you provide about your java installation and environment variables?

---

<div class="post-metadata">

**Author:** ![rkparkar](https://avatars.discourse-cdn.com/v4/letter/r/82dd89/32.png) [@rkparkar](https://discuss.elastic.co/u/rkparkar)\
**Post date:** [July 12, 2018, 10:26am UTC](https://discuss.elastic.co/t/xpack-setup-passwords-gives-java-net-bindexception/139702/3 "2018-07-12T10:26:06Z")

</div>

oh thanks .

i did find that the jmxremote port (elasticsearch env file) was pointing to the same port number. currently i commented the java args.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 9, 2018, 10:26am UTC](https://discuss.elastic.co/t/xpack-setup-passwords-gives-java-net-bindexception/139702/4 "2018-08-09T10:26:09Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
