I am new to Manticore but the more I try to get started with it the more confused I get. I am running Ubuntu 22.04.1 LTS. How should indexer and searchd be run to provide consistent results that do not give errors?
The documentation says that searchd is started by the init system under the user named manticore and all files created by the server will be owned by this user, and that if searchd is started under, for example, the root user, the permissions of files will be changed which may lead to issues when running again searchd as service.
However, the “indexing data from MySQL” tutorial appears to be running under the root user to create indexes and to start searchd. Is this the right way to do things?
If I try running indexer --all as my regular (non-root, non-manticore) username, I get the error
FATAL: failed to open /var/lib/manticore/indx.spl: Permission denied, will not index. Try --rotate option.
If I try running indexer --all as user manticore with the command sudo runuser -l manticore -c 'indexer --all', I get the error
runuser: warning: cannot change directory to /home/manticore: No such file or directory
I can build the indexes as the root user using sudo index --all, but then when I go into MySQL using mysql -P9306 -h0 and run the command SHOW TABLES; it just says Empty set (0.000 sec). Also, if I run ls -ls in /var/lib/manticore, it shows that indx.spa and indx.spb are owned by root:root, and that might be bad, right?
I once was able to get SHOW TABLES; to show the indexes, but I’m not sure what I did to make it work. I think it involved running searchd as root (sudo searchd) first. Now, if I try that, I get the error message
FATAL: failed to lock pid file '/var/run/manticore/searchd.pid': Resource temporarily unavailable (searchd already running?)
So I get the feeling that the interactive tutorials are taking some shortcuts by running as root that I should not be taking. What is the right way to set things up so that my indexes get built, I have no permissions problems, and I can access the indexes using the PHP client manticoresearch-php?
(Trying to run the PHP client to execute a search gives the following error:
PHP Fatal error: Uncaught Manticoresearch\\Exceptions\\ResponseException: "unknown local index(es) 'indx' in search request" in /home/myusername/public_html/vendor/manticoresoftware/manticoresearch-php/src/Manticoresearch/Transport/Http.php:127\nStack trace:\n#0)
