Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sphinx on centos 7 cant started because of searchd.pid absent

I installed sphinx-2.2.11 on my CentOS 7

yum install -y postgresql-libs unixODBC wget 
http://sphinxsearch.com/files/sphinx-2.2.11-1.rhel7.x86_64.rpm yum 
install sphinx-2.2.11-1.rhel7.x86_64.rpm

Installation went without any errors and then I created sphinx config and installed php extension (also all without error)

I restart apache (httpd) and I tried to START sphinx service

systemctl start searchd

I got this message

Job for searchd.service failed because a configured resource limit was > exceeded. See "systemctl status searchd.service" and "journalctl -xe" for details.

after launch command - systemctl status searchd.service

May 02 20:28:57 kvmde43-10657.fornex.org systemd[1]: Failed to read PID from file /var/run/sphinx/searchd.pid: Invalid argument May 02 20:28:57 kvmde43-10657.fornex.org systemd[1]: Failed to start SphinxSearch Search Engine.

In fact I havn't "searchd.pid" anywhere at system though installation went good) How should I fix it ?

Thanks in advance

like image 387
Eugene S Avatar asked May 02 '17 17:05

Eugene S


People also ask

Does Sphinx work on CentOS 7?

Sphinx runs on various Linux distributions such as Ubuntu, RHEL, CentOS, Fedora, and many more. It supports various databases like MySQL, PostgreSQL, ODBC. Sphinx allows you to distribute searches across multiple servers. In this tutorial we will learn how to install and configure Sphinx to index and search a database on CentOS 7.

Why MySQL PID could not be found CentOS?

We are available 24×7 to fix it for you.] In short, the MySQL PID could not be found CentOS error occurs due to the existing PID not allowing us to create a new PID. Also, it is a common problem during the restart of the MYSQL server.

What is Sphinx and how to use it?

Sphinx can be easily integrated into various web applications to provide high quality search results. Sphinx runs on various Linux distributions such as Ubuntu, RHEL, CentOS, Fedora, and many more. It supports various databases like MySQL, PostgreSQL, ODBC.

How do I run a SQL query in Sphinx?

The first column of the sql_query should be a unique id. The SQL query will run on every index and dump the data to Sphinx index file. Below are the descriptions of each field and the source block itself. type: Type of data source to index.


3 Answers

I have just resolved this issue.

I took a look at sphinx log /var/log/sphinx/searchd.log and noted that some data files under folder /var/log/sphinx/data/ are Permission denied;

I set chown sphinx:sphinx on /var/log/sphinx/data/ folder and It started to work as charm )

Thanks

like image 55
Eugene S Avatar answered Nov 04 '22 00:11

Eugene S


Same symptom with a slightly different cause... /var/log/sphinx/searchd.log shows

FATAL: failed to open '/var/data/binlog.lock': 13 'Permission denied'

Fixed by adding binlog_path = to the searchd section of sphinx.conf. Empty path disables binary logging which by default tries to open files in /var/data owned by root. Alternatively, you can supply a valid path writeable by sphinx.

like image 39
Tim D Avatar answered Nov 03 '22 23:11

Tim D


The Sphinx search index is a database distributed over several files in the /var/lib/sphinx/ folder. Those file names start with the doc prefix which is the index name as configured in /etc/sphinx/sphinx.conf.

The searchd service also stores the binlog files in that folder to be able to restore the Sphinx functionality in case of the system crash. If you cannot start the searchd service because it cannot create a binlog file, try to move or delete all binlog.* files from this folder and then start the service.

like image 39
Albert Avatar answered Nov 04 '22 00:11

Albert