# Unable to create Index in Elastic Search

**URL:** <https://discuss.elastic.co/t/unable-to-create-index-in-elastic-search/376256>\
**Category:** Elasticsearch\
**Created:** [March 22, 2025, 1:34pm UTC](https://discuss.elastic.co/t/unable-to-create-index-in-elastic-search/376256 "2025-03-22T13:34:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pengdijie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pengdijie/32/142187_2.png) [@pengdijie](https://discuss.elastic.co/u/pengdijie)\
**Post date:** [March 22, 2025, 1:34pm UTC](https://discuss.elastic.co/t/unable-to-create-index-in-elastic-search/376256/1 "2025-03-22T13:34:08Z")

</div>

Hello, I'm trying to Use Elasticsearch to index the Wikipedia dump, but this error appears here

```python
elastic_transport.ConnectionError: Connection error caused by: NewConnectionError(<elastic_transport._node._urllib3_chain_certs.HTTPSConnection object at 0x7f21c40cb100>: Failed to establish a new connection: [Errno 111] Connection refused)
WARNING:elastic_transport.node_pool:Node <Urllib3HttpNode(https://127.0.0.1:9200)> has failed for 7 times in a row, putting on 30 second timeout
WARNING:elastic_transport.transport:Retrying request after failure (attempt 2 of 3)

```

And my config is as follows:

```python
'hostname': 'https://127.0.0.1:9200' ,
        # 'hostname': 'http://localhost:9200',
        'index_name': index_name,
        'keys': {'title': 'title', 'body': 'txt'},
        'timeout': 600,
        'retry_on_timeout': True,
        'maxsize': 24,
        'number_of_shards': 'default',
        'language': 'english',
        'file': "${workspaceFolder}/index.html"

```

What's happening. How do I fix it?

---

<div class="post-metadata">

**Author:** ![RainTown](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raintown/32/140206_2.png) [@RainTown](https://discuss.elastic.co/u/RainTown)\
**Post date:** [March 22, 2025, 9:12pm UTC](https://discuss.elastic.co/t/unable-to-create-index-in-elastic-search/376256/2 "2025-03-22T21:12:31Z")

</div>

Hello and welcome to the forum. Hopefully we can get you started ...

> [@pengdijie](#):
>
> `Connection refused`  
> \<Urllib3HttpNode([https://127.0.0.1:9200](https://127.0.0.1:9200))\> has failed for 7 times in a row

There is your first problem.

Can you show some evidence that elasticsearch is up and running on the host?

How did you setup elasticsearch?

> [@pengdijie](#):
>
> `'hostname': 'https://127.0.0.1:9200'`

You don't need to supply any credentials to access elasticsearch?

---

<div class="post-metadata">

**Author:** ![pengdijie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pengdijie/32/142187_2.png) [@pengdijie](https://discuss.elastic.co/u/pengdijie)\
**Post date:** [March 23, 2025, 3:30am UTC](https://discuss.elastic.co/t/unable-to-create-index-in-elastic-search/376256/3 "2025-03-23T03:30:44Z")

</div>

I followed this prompt to install

```python
cd data # This is the path where I installed elasticsearch
wget -O elasticsearch-8.15.0.tar.gz https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.15.0-linux-x86_64.tar.gz # download Elasticsearch
tar zxvf elasticsearch-8.15.0.tar.gz
rm elasticsearch-8.15.0.tar.gz 
cd elasticsearch-8.15.0
nohup bin/elasticsearch & # run Elasticsearch in background
cd ../..
python prep_elastic.py --data_path data/dpr/psgs_w100.tsv --index_name wiki # build index

```

but when I run

```python
nohup bin/elasticsearch

```

that prompt

```python
nohup: ignoring input and appending output to 'nohup.out'

```

I thought it had started elasticsearch, and when I run "systemctl status elasticsearch" to checking if the Elasticsearch service is started, The following prompt appears. It confuses me.

```auto
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

```

--------------------------------------------------------------------------------------------dividing line----------------------------------------------------------------------------------------------------------

"You don't need to supply any credentials to access elasticsearch?" Is this statement saying that I'm missing some credentials? But I'm also just following the project from the github repository, do I need to add any credentials?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [March 23, 2025, 2:59pm UTC](https://discuss.elastic.co/t/unable-to-create-index-in-elastic-search/376256/4 "2025-03-23T14:59:45Z")

</div>

Hi @pengdijie

First and foremost I think you should look at the elasticsearch installation documentation. You appear to making some significant assumption

> **[Installing Elasticsearch | Elasticsearch Guide \[8.17\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html#hosted-elasticsearch-service)**

`nohup bin/elasticsearch &`

From a tar.gz that will start elasticsearch with default security and authentication. You would have gotten authorization creds at startup the first time

You should follow [this](https://www.elastic.co/guide/en/elasticsearch/reference/current/targz.html#_check_that_elasticsearch_is_running) first

> [@pengdijie](#):
>
> "systemctl status elasticsearch" to checking if the Elasticsearch service

If you want to use `systemctl` you would need to I stall from a package

Either way I suggest you go back and look at the installation docs.

Then after you can `curl` propely to elasticsearch connecting via Python should be pretty straightforward.

---

<div class="post-metadata">

**Author:** ![RainTown](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raintown/32/140206_2.png) [@RainTown](https://discuss.elastic.co/u/RainTown)\
**Post date:** [March 23, 2025, 7:38pm UTC](https://discuss.elastic.co/t/unable-to-create-index-in-elastic-search/376256/5 "2025-03-23T19:38:46Z")

</div>

As explained, you just need read and follow the standard installations instructions.

Is there a good reason to not use the most current release (8.17.3) ?

When you follow the installation instructions, then at some point you will learn that (for secure installation, even when using self-signed certificate) there is an "elastic" user, and a password, that you should use to connect to elasticsearch over HTTPS.

Elasticsearch is up and running when if you do this:

```auto
EUSER="elastic" EPASS="your-elastic-password" EHOST="localhost" EPORT="9200"
curl -s -k -u "${EUSER}:${EPASS}" "https://${EHOST}:${EPORT}"

```

you receive something like this:

```auto
{
  "name" : "macmini",
  "cluster_name" : "my-cluster",
  "cluster_uuid" : "xxxxxxxxxxxxxxxxxxxxx",
  "version" : {
    "number" : "8.17.2",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "747663ddda3421467150de0e4301e8d4bc636b0c",
    "build_date" : "2025-02-05T22:10:57.067596412Z",
    "build_snapshot" : false,
    "lucene_version" : "9.12.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

```

Good luck. If you get further but still hit issues please just ask again.
