# ConnectionRefusedError: \[Errno 111\] Connection refused error while running rally for an existing elastic cluster

**URL:** <https://discuss.elastic.co/t/connectionrefusederror-errno-111-connection-refused-error-while-running-rally-for-an-existing-elastic-cluster/335333>\
**Category:** Elasticsearch\
**Tags:** rally\
**Created:** [June 6, 2023, 11:45am UTC](https://discuss.elastic.co/t/connectionrefusederror-errno-111-connection-refused-error-while-running-rally-for-an-existing-elastic-cluster/335333 "2023-06-06T11:45:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Swathi\_Kakumanu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swathi_kakumanu/32/117764_2.png) [@Swathi\_Kakumanu](https://discuss.elastic.co/u/Swathi_Kakumanu)\
**Post date:** [June 6, 2023, 11:45am UTC](https://discuss.elastic.co/t/connectionrefusederror-errno-111-connection-refused-error-while-running-rally-for-an-existing-elastic-cluster/335333/1 "2023-06-06T11:45:13Z")

</div>

Hi,

I am new to rally and trying to run the benchmark for the existing cluster.

I have 3 K8's nodes (1 master,2 worker)  
192.168.105.116  
192.168.105.117  
192.168.105.118

I have created an Elasticsearch cluster on top of k8's cluster with 3 master and 5 data nodes.

I am using the section (benchmark existing cluster) in the following link.

[Tips and Tricks - Rally 2.7.1 documentation (esrally.readthedocs.io)](https://esrally.readthedocs.io/en/stable/recipes.html)

esrally race --track=pmc --target-hosts=192.168.105.116:9200,192.168.105.117:9200,192.168.105.118:9200 --pipeline=benchmark-only --client-options="use\_ssl:true,basic\_auth\_user:'elastic',basic\_auth\_password:'XXXXX',verify\_certs:false"

while running the above command, I'm getting connection refused error.

Can someone please guide me what went wrong in the command or the process that I'm following.

administrator@administrator:~/.rally$ esrally race --track=pmc --target-hosts=192.168.105.116:9200,192.168.105.117:9200,192.168.105.118:9200 --pipeline=benchmark-only --client-options="use\_ssl:true,basic\_auth\_user:'elastic',basic\_auth\_password:'XXXXX',verify\_certs:false"

[INFO] Race id is [b643574f-9c7e-4f9b-8ec7-16aa1911e771]  
[ERROR] Cannot race. Traceback (most recent call last):  
File "/home/administrator/.local/lib/python3.8/site-packages/urllib3/connection.py", line 174, in \_new\_conn  
conn = connection.create\_connection(  
File "/home/administrator/.local/lib/python3.8/site-packages/urllib3/util/connection.py", line 95, in create\_connection  
raise err  
File "/home/administrator/.local/lib/python3.8/site-packages/urllib3/util/connection.py", line 85, in create\_connection  
sock.connect(sa)  
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File "/home/administrator/.local/lib/python3.8/site-packages/elasticsearch/connection/http\_urllib3.py", line 251, in perform\_request  
response = self.pool.urlopen(  
File "/home/administrator/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 785, in urlopen  
retries = retries.increment(  
File "/home/administrator/.local/lib/python3.8/site-packages/urllib3/util/retry.py", line 525, in increment  
raise six.reraise(type(error), error, \_stacktrace)  
File "/home/administrator/.local/lib/python3.8/site-packages/urllib3/packages/six.py", line 770, in reraise  
raise value  
File "/home/administrator/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen  
httplib\_response = self.\_make\_request(  
File "/home/administrator/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 386, in \_make\_request  
self.\_validate\_conn(conn)  
File "/home/administrator/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1040, in \_validate\_conn  
conn.connect()  
File "/home/administrator/.local/lib/python3.8/site-packages/urllib3/connection.py", line 358, in connect  
self.sock = conn = self.\_new\_conn()  
File "/home/administrator/.local/lib/python3.8/site-packages/urllib3/connection.py", line 186, in \_new\_conn  
raise NewConnectionError(  
urllib3.exceptions.NewConnectionError: \<urllib3.connection.HTTPSConnection object at 0x7f2fc796cb20\>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

---

<div class="post-metadata">

**Author:** ![Quentin\_Pradet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/quentin_pradet/32/94192_2.png) [@Quentin\_Pradet](https://discuss.elastic.co/u/Quentin_Pradet)\
**Post date:** [June 8, 2023, 5:41am UTC](https://discuss.elastic.co/t/connectionrefusederror-errno-111-connection-refused-error-while-running-rally-for-an-existing-elastic-cluster/335333/2 "2023-06-08T05:41:39Z")

</div>

Hello, and thank you for your interest in Rally!

> [@Swathi\_Kakumanu](#):
>
> esrally race --track=pmc --target-hosts=192.168.105.116:9200,192.168.105.117:9200,192.168.105.118:9200 --pipeline=benchmark-only --client-options="use\_ssl:true,basic\_auth\_user:'elastic',basic\_auth\_password:'XXXXX',verify\_certs:false"

In order to rule out a configuration error, can you please try the following curl commands to see if they succeed?

```bash
curl --insecure https://elastic:XXXXX@192.168.105.116:9200/
curl --insecure https://elastic:XXXXX@192.168.105.117:9200/
curl --insecure https://elastic:XXXXX@192.168.105.118:9200/

```

---

<div class="post-metadata">

**Author:** ![Swathi\_Kakumanu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swathi_kakumanu/32/117764_2.png) [@Swathi\_Kakumanu](https://discuss.elastic.co/u/Swathi_Kakumanu)\
**Post date:** [June 11, 2023, 5:32am UTC](https://discuss.elastic.co/t/connectionrefusederror-errno-111-connection-refused-error-while-running-rally-for-an-existing-elastic-cluster/335333/4 "2023-06-11T05:32:07Z")

</div>

Hi @Quentin_Pradet ,

I was able to figure out on how to use the exact rally command for Elasticsearch container from outside.

` esrally race --track=pmc --pipeline=benchmark-only --target-hosts=192.168.105.116:9200 --client-options="timeout:60,use_ssl:true,verify_certs:true,ca_certs:'/home/administrator/ca.crt',basic_auth_user:'elastic',basic_auth_password:'xxxxx`

administrator@administrator:~$ curl --insecure [https://elastic:xxxxx@192.168.105.116:9200/](https://elastic:xxxxx@192.168.105.116:9200/)  
{  
"name" : "quickstart-es-master-0",  
"cluster\_name" : "quickstart",  
"cluster\_uuid" : "wmaV7NUORjCDIfmIRaE4rw",  
"version" : {  
"number" : "8.8.0",  
"build\_flavor" : "default",  
"build\_type" : "docker",  
"build\_hash" : "c01029875a091076ed42cdb3a41c10b1a9a5a20f",  
"build\_date" : "2023-05-23T17:16:07.179039820Z",  
"build\_snapshot" : false,  
"lucene\_version" : "9.6.0",  
"minimum\_wire\_compatibility\_version" : "7.17.0",  
"minimum\_index\_compatibility\_version" : "7.0.0"  
},  
"tagline" : "You Know, for Search"  
}

Currently I am facing a different issue now with SSL Verification of esrally for [rally-tracks.elastic.co](http://rally-tracks.elastic.co)', can you please have a look at this post ( [Max retries exceeded with url: /pmc/documents.json.bz2 SSLCertVerificationError [SSL: CERTIFICATE\_VERIFY\_FAILED] - Elastic Stack / Elasticsearch - Discuss the Elastic Stack](https://discuss.elastic.co/t/max-retries-exceeded-with-url-pmc-documents-json-bz2-sslcertverificationerror-ssl-certificate-verify-failed/335708))

---

<div class="post-metadata">

**Author:** ![Quentin\_Pradet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/quentin_pradet/32/94192_2.png) [@Quentin\_Pradet](https://discuss.elastic.co/u/Quentin_Pradet)\
**Post date:** [June 12, 2023, 6:37am UTC](https://discuss.elastic.co/t/connectionrefusederror-errno-111-connection-refused-error-while-running-rally-for-an-existing-elastic-cluster/335333/5 "2023-06-12T06:37:12Z")

</div>

I see that you've opened a new topic, so I'll answer there: [Max retries exceeded with url: /pmc/documents.json.bz2 SSLCertVerificationError [SSL: CERTIFICATE\_VERIFY\_FAILED]](https://discuss.elastic.co/t/max-retries-exceeded-with-url-pmc-documents-json-bz2-sslcertverificationerror-ssl-certificate-verify-failed/335708)

---

<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:** [July 10, 2023, 6:37am UTC](https://discuss.elastic.co/t/connectionrefusederror-errno-111-connection-refused-error-while-running-rally-for-an-existing-elastic-cluster/335333/6 "2023-07-10T06:37:44Z")

</div>

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