How to get Elasticsearch working?

I’ve installed and configured Elasticsearch as an App in NC18. Then I’ve logged in via CLI in order to create the index. But this failed:

~/public_html$ php occ fulltextsearch:index
In StaticNoPingConnectionPool.php line 50:
No alive nodes found in your cluster  
fulltextsearch:index [--output [OUTPUT]] [-r|--no-readline] [--] [<options>]

What am I doing wrong?

did you install elasticsearch itself?

what’s the output of

occ fulltextsearch:test

Ooops!

occ fulltextsearch:test
-bash: occ: command not found

That’s not what I’ve expected. What do I have to do?

ok. in your case it would be like this
~/public_html$ php occ fulltextsearch:test

with the correct user. in the correct path.

~/public_html$ php occ fulltextsearch:test
 
.Testing your current setup:  
Creating mocked content provider. ok  
Testing mocked provider: get indexable documents. (2 items) ok  
Loading search platform. (Elasticsearch) ok  
Testing search platform. fail 
In StaticNoPingConnectionPool.php line 50:
                                        
  No alive nodes found in your cluster  
                                        

fulltextsearch:test [--output [OUTPUT]] [-j|--json] [-d|--platform_delay PLATFORM_DELAY]

Make it easy, run this script:

https://raw.githubusercontent.com/nextcloud/vm/master/apps/fulltextsearch.sh

This end’s with:

<my_username> is not in the sudoers file.  This incident will be reported.

You have to run it with a user that have sudo privileges, or root.

@enoch85 - thanks for the script. I just ran it, but got this:

Your current version are still not compatible with the version required to run this script.

But I just installed NC today and have the latest version. Is there an issue with Elastic Search and this version?

Thanks for your help.

Could you please run the script with sudo bash -x fulltextsearch.sh and post the output here?

Thanks!

Thanks for following up @enoch85 - I actually did manage to get Elastic working in the end. IIRC the problem was an old version of JAVA.

1 Like

An addition, if your error doesn´t disappear.
I had the same problem. I couldn´t use the suggested script because I have Nextcloud and Elastic running on different servers. Therefore I have entered the properties manually on the Nextcloud settings page.
The error disappeard not till I added the port number to the Address of the Servlet (even with the default port 443 for https).