Installing Sphinx

Version 15 - Updated on 14 Nov 2017 at 12:12AM by Joachim Hansen

Description

http://sphinxsearch.com/docs/current/installing-debian.html

Dependencies:

$ sudo apt-get install mysql-client unixodbc libpq5

Command above seems to have worked just fine

 install Sphinx

sudo dpkg -i sphinxsearch_2.2.11-dev-0ubuntu12~trusty_amd64.deb

Command above did not work, but the command:

sudo apt-get install sphinxsearch

worked - from https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-sphinx-on-ubuntu-16-04

Thats the only command I have used on this webpage ... there is also a tutorial for setting up search 


13.11.2017:

installed sudo apt-get install mysql-server with admin as password

mysql-server-5.7

used command sudo mysql -h localhost -u root -P 9306 -p <ENTER>

Enter password: <admin>

....

This worked! The -P is for pid and -p is for password

http://sphinxsearch.com/docs/current/quick-tour.html

$ cd /etc/sphinxsearch/
$ sudo cp sphinx.conf.dist sphinx.conf

created a sphinx.conf file from the sphinx.conf.dist...

The sphinx.conf file is what the sphinx search engine is looking after for indexes and other configurations...


substituted sql_user = test to sql_user = root and substrituted sql_pass = <empty> to sql_pass = admin in src1 in file sphinx.conf


used command sudo searchd in command prompt... 

got error message: using config file '/etc/sphinxsearch/sphinx.conf' Fatal: failed to create pid file '/var/run/sphinxsearch/searchd.pid' no such file or directory

maybe I have to change the path in the conf file? I created a folder in '/var/run/sphinxsearch/'

which was not there before. Now it fails to open some index files including the index rt.

searchd --config /etc/sphinxsearch/sphinx.conf --stop

to stop searchd


added the line  listen = localhost:9306:mysql41 to searchd in sphinx.conf

can also start searchd with sudo /usr/bin/searchd


seems to be that searchd do not create pidfile (searchd.pid??)

I can also use the command sudo /usr/bin/searchd --pidfile to force it to use pidfile...

Before i only had the file rt.lock but now I also have rt.kill, rt.meta and rt.ram.

when showing status for mysql it showed unix socket: /var/run/mysqld.sock

tried adding /var/run/mysqld.sock as listning and as sql_sock

pid_file

searchd process ID file name. Mandatory.

PID file will be re-created (and locked) on startup. It will contain head daemon process ID while the daemon is running, and it will be unlinked on daemon shutdown. It's mandatory because Sphinx uses it internally for a number of things: to check whether there already is a running instance of searchd; to stop searchd; to notify it that it should rotate the indexes. Can also be used for different external automation scripts.

http://sphinxsearch.com/docs/current/conf-pid-file.html


PLAN: 

Getting sphinx to work seem to be a non trivial task... Either my configuration is wrong and I should delete it and start over or maybe I need to restart my virtual machine in order to generate my searchd.pid

Anyways I should postpone working with sphinx before I have finished my experiments with elasticsearch and Solr. This is becouse I do not know how my stable setup with elasticsearch and solr would be effected by a restart.

To uinstall sphinx https://www.howtoinstall.co/en/ubuntu/trusty/sphinxsearch?action=remove