Forums | Mahara Community

Support /
Unable to set up Elastic Search


A.Emily's profile picture
Posts: 23

12 April 2021, 14:35

Hi,

 I'm currently setting up mahara 20.10 for our college using MySQL as the DB. I tried to enable the elastic search in Admin Setting>>site page>>Search but I got the error below:

The configuration settings for the search plugin "elasticsearch" are incorrect. Please check the configuration settings under "Extensions" → "Plugin type: search". You may need to hit the search's 'Reset' button when done.

Then I tried to look into the elastic search setting, and I got the error below:

Failed to connect to 127.0.0.1 port 9200: Connection refuse

I did not manage to find the solution online. Did anyone have any experience about this error?

Robert Lyon's profile picture
Posts: 767

14 April 2021, 12:28

Hi

Can you check that an elasticsearch server is running on localhost?

From a terminal try something like:  curl -XGET 'http://localhost:9200'

It should return some info about the cluster including the version number, eg "number" : "5.5.1"

If it returns

curl: (7) Failed to connect to localhost port 9200: Connection refused

It means there is no elasticsearch server running on localhost at port 9200

The information here https://git.mahara.org/mahara/mahara/-/blob/master/htdocs/search/elasticsearch/upgrade_elasticsearch.readme sould help you get a compatible version of elasticsearch up and running for Mahara to talk to

Cheers

Robert

 

 

A.Emily's profile picture
Posts: 23

14 April 2021, 13:42

Hi Robert,

You are right, the elastic search is not running in the localhost previously. I then start the elastic search and now i got this error:

404: no such index

Not sure what is wrong with the settings i've done. I'm really new to this

Michael Gray's profile picture
Posts: 7

16 April 2021, 21:29

Hi Robert,

I too am seeing issues with elasticsearch install.

Having established connectivity, I also get the error:

404 No such index

When I try to 'Reset' the index, I get the error:

"Index cron job is running.  Please try again in a few minutes"

This error keeps happening - I've tried stopping httpd, stopping crond etc but this cron job running error persists.

Any ideas?

Many thanks,

Mike Gray.

Kristina Hoeppner's profile picture
Posts: 4770

20 April 2021, 7:51

Hi Emily and Mike,

It looks like your index hasn't been built yet. Are you running Elasticsearch on a local computer to try things out or do you have a proper Elasticsearch cluster set up? If you are running it on your computer, make the following changes in the Elasticsearch settings in the Mahara plugin administration:

  • Cron record limit: 1500
  • Shards: 5
  • Replica shards: 0

Then reset the index (and save the page) and also activate Elasticsearch in Admin menu -> Configure site -> Site options -> Search settings. You may also need to run the cron if it is not running automatically.

Return to the plugin admin Elasticsearch page and see if you have a green message at the top.

Cheers

Kristina

5 results