Daniel Ferreira's picture

Hi guys,

 

I have a difficult to setup correctly the fulltext seach, specially the servlet address, there's no instructions from Turnkey about witch Ip and Port should use, because the default one "localhost:9200" doesn't work, after looking for opened ports I didn't find the correct port to use with the address.

 

So can anyone help-me with the Fulltext search setup?

Forum: 
Jeremy Davis's picture

TurnKey is Debian under the hood (v16.x = Debian 10/Buster) so following instructions for Debian 10/Buster should work fine.

Also, I'm totally unfamiliar with setting up fulltext search for Nextcloud so to be honest, I have no idea what you're talking about really... Could you please explain a little more about what you are referring to? If you can give me a bit more info, perhaps I can give you some guidance?

In the meantime, I did a search and found a tutorial on How to set up Elastic full text search for Nextcloud. It is a bit dated, but looks pretty reasonable. I also note that it doesn't include any note about hosts or ports. I'm not sure whether that is a good thing or not?!

Anyway, if you are running as root, you can omit any use of 'sudo'.

One other thing I'd possibly consider changing is installing the v7.x Elasticsearch package (rather than v6.x). To do that, change the '6.x' to '7.x' in the repo. I.e. in step 2, change this:

echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list

To this:

echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list

Note too that Elasticsearch has detailed docs on installing and configuring.

When you get to step 4 (and step 5), if you are using the latest TurnKey Nextcloud appliance, you can use the turnkey-occ wrapper script instead if you wish:

turnkey-occ fulltextsearch:test

If that fails, you can download it like this:

SCRIPT=usr/local/bin/turnkey-occ
URL=https://raw.githubusercontent.com/turnkeylinux-apps/nextcloud/master/overlay

wget -O /$SCRIPT $URL/$SCRIPT
chmod +x /$SCRIPT

If you get any error about permissions, then ensure that the webserver ('www-data') owns all the nextcloud files:

chown -R www-data:www-data /var/www/nextcloud
Daniel Ferreira's picture

Thank you so much Jeremy, 

 

Even not so sure about the real problem you'd but these steps help me understand what is happaning.

 

I've test the  command:

turnkey-occ fulltextsearch:test

So it's show me the elasticsearch was working but there's another problem. 

 

So after execute the command it's return "No alive nodes found in your cluster", I search about the nodes but I didn't found anything about create or configure nodes to work with the elasticseach, do you know anything about this issue?

Jeremy Davis's picture

From my understanding elasticsearch should run as a service, so this should give some info:

systemctl status elasticsearch

If it's not running, the you could try restarting it:

systemctl restart elasticsearch
Daniel Ferreira's picture

Yes I had the same idea about, I tried to start and restart the elasticsearch few times but without sucess. I installed again and upgraded to version 7.x, but it doesn't start, if use the command:

 turnkey-occ fulltextsearch:test

it's says about the elasticsearch is running as well but haven't any node to work on it as you can see in the last pic I sent before.

If i try the command 

systemctl restart elasticsearch

It fails, maybe there's a relation with the nodes maybe.

So I check the startus and try to restart the elasticseach service but again it fails.

 Maybe solving the nodes issue could solve the 'Active' issue too.

So any idea about?

Daniel Ferreira's picture

I set the port number and enable nodes in the elasticsearch.yml file. so I restarted the elasticsearch service, seems the service is working fine but the nodes issue still existing.

 

Jeremy Davis's picture

Just to clarify, you definately hae the required Nextcloud Apps installed? I.e.:

  • Full text search
  • Full text search - Elasticsearch platform
  • Full text search - Files
(From the tutorial that I shared previously).

Also, I'm not 100% sure, but a bit more reading suggests that there may need to be some config set within Nextcloud. That tutorial I noted before didn't say anything about that, but other information I've read suggests that you may need to configure the settings for elasticsearch within Nextcloud?! My guess is that it has default config, but for whatever reason, the default doesn't match your setup?!

If you are still struggling with it, please let me know and when I get a chance, I'll see if I can get it to work...

Daniel Ferreira's picture

Jeremy I found the issue, 

 

I did a fresh install as I meant before and I found some issues that I could see installing the elasticsearch manually.

I don't know which specifically issue is, but the problem is the turnkey's elasticsearch.

When the elasticsearch was installed manually everthing works well. 

Now I have another problem, when I install the elasticsearch manually the turnkey's nextcloud starts two instances of elasticsearch, it's own and mine, so I need a way to disable or uninstall the turnkey's elasticsearch to start just one, there's a way to do this?

Jeremy Davis's picture

When you refer to "turnkey's elasticsearch" what do you mean? TurnKey doesn't include Elastic search by default, nor is it available from the Debian repositories. The instructions that I linked to included installing Elasticsearch directly from Elasticsearch themselves. So I'm not at all clear on what the difference is between "turnkey's elasticsearch" and "elasticsearch installed manually"?

Regardless, I'm glad to hear that it's working.

As to why it's starting twice, my guess is that you now have it installed twice and they have slightly different service names so both are being started? Assuming I'm right, you'll need to work out which one needs to be disabled, then disable it. Hopefully they both include 'elastic' in the name, if so, this should show them:

systemctl list-units | grep elastic

If that doesn't bring up 2 service names that look like they are related to elasticsearch, then you might need to manually go through the full output of 'systemctl list-units' (i.e. the above command before the pipe - '|' character).

Once you have found the 2 names, then you can stop one like this:

systemctl stop SERVICENAME

(Where SERVICENAME is the name of the service you want to stop).

Then test whether the search still works in Nextcloud. If not, then start it again (same command, just swap "start" for "stop") and stop the other. Once you have worked out which one you want to disable, then disable it like this:

systemctl disable SERVICENAME

(Again where SERVICENAME is the name of the service you want to disable).

Hopefully that helps.

Daniel Ferreira's picture

Just to clarify, you definately hae the required Nextcloud Apps installed? I.e.:

  • Full text search
  • Full text search - Elasticsearch platform
  • Full text search - Files

(From the tutorial that I shared previously).

Yes I add these files and configured the full-text seach in Nextcloud.

 Also, I'm not 100% sure, but a bit more reading suggests that there may need to be some config set within Nextcloud. That tutorial I noted before didn't say anything about that, but other information I've read suggests that you may need to configure the settings for elasticsearch within Nextcloud?!

Yes, besides the tutorial doen't meant anything about the especific configuration of the Full text seach in Next cloud, I've read and watch some videos those configs, so I take a look into the activitty log and stopped show the message "wrong configuration of elasticsearch", also I did some tests that you meant before and looks working, active but it don't indexing nothing. 

And again after restart cannot active the elasticsearch anymore, even trying to restart.

 

Since the first time I installed the turnkey version of Nextcloud it never worked as well, so maybe doing a fresh install could be a better idea?

 

 

Add new comment