Linux installation of sphinx record commands and detailed explanations

Source: Internet
Author: User
First of course is to download the sphnix source code package from the sphnix website, the current latest version is: sphinx-0.9.8.1.tar.gz. Of course, you also need to ensure that your system has installed mysql. Next, install the software according to the official installation instructions. The basic steps are as follows: decompress the sphinx source code package: $...
First of course is to download the sphnix source code package from the sphnix website, the current latest version is: sphinx-0.9.8.1.tar.gz. Of course, you also need to ensure that your system has installed mysql.
Secondly, according to the official installation instructions for the installation, the basic steps are as follows: unzip the sphvf source package: $ tar xzvf sphinx-0.9.8.1.tar.gz $ cd sphinx run configure configuration program: $. /configure [options] has some parameters that can be specified during configuration, mainly as follows: -- prefix, which specifies the position where sphinx is installed on the system; for example, -- prefix =/usr/local/sphfix -- with-mysql, mysql installation directory, specifying the directory to which to find if the mysql-related library file fails to be detected automatically -- with-pgsql, same as above, the complete configuration command for pgsql is as follows :. /configure -- prefix =/usr/local/sphinx -- with-mysql =/usr/local/mysql compilation: $ make in this step, you may encounter a problem, that is, report Sphsf-undefined reference to 'libiconv' error. the solution is to modify/src/MakeFile (note that Makefile under src is not Makefile under csft ), edit LIBS =-lm-lexpat and add-liconv to the end of the line: LIBS =-lm-lexpat-liconv-L/usr/local/lib 4. install $ make install. If no errors are generated during compilation, this step will not cause any problems. If the installation is not correct after completion, you need to go back to the errors encountered during the make process. 5. run the test $ cd/usr/local/sphinx/etc $ cp sphinx. conf. dist sphworkflow. conf $ vi sphinx. in conf, sphinx provides a simple example. The basic step is to first set the sphinx in/sphinx/etc. conf. rename dist to sphexample. conf, and then modify the sphexample. the configuration in conf mainly involves modifying the mysql User name, password, and database on your server. The modified location is the lines below source src1 of sphsf-. conf. $ Mysql-u test </usr/local/sphple/etc/example. SQL: import the test data prepared by sphinx and import the data to the mysql test database. Of course, the database here should be the same as the SQL _db value specified in the configuration file above (sphsf-. conf. Note: To run this command, if your mysql command is not added to the environment variable, you must use the complete path and enter the password. For example, if your mysql is installed in the/usr/local/mysql directory and the root account password is xxxxxx, the command should be adjusted: $/usr/local/mysql/bin/mysql-uroot-pxxxxxx test </usr/local/sphple/etc/example. SQL $ cd/usr/local/sphinx/etc $/usr/local/sphinx/bin/indexer -- all is used to create an index. of course, the data base is the just-imported example. if an error occurs in SQL data, the biggest possible cause is your sphworkflow. the database configuration in conf is incorrect. you need to go back and check and correct it. However, the library files required by sphenders cannot be found. for example, the following two errors are displayed:/usr/local/sphinx/bin/indexer: error while loading shared libraries: libmysqlclient. so.15: cannot open shared object file: No such file or directory/usr/local/sphinx/bin/indexer: error while loading shared libraries: libiconv. so.2: cannot open shared object file: No such file or directory this is mainly because you have not been able to configure the corresponding environment variables after installing some libraries. You can solve this problem by establishing a connection and running the following command: ln-s/usr/local/mysql/lib/libmysqlclient. so.15/usr/lib/libmysqlclient. so.15 ln-s/usr/local/lib/libiconv. so.2/usr/lib/libiconv. so.2 here I suppose your corresponding software package is installed in the/usr/local/xxx Directory. if you are not installed in the corresponding directory, you need to use your own path. If you have not installed the libiconv package, you need to install it. this installation is simple and I will not talk about it. If a similar error occurs, correct it according to the above method. $ Cd/usr/local/sphinx/etc $/usr/local/sphinx/bin/search test the command above is a search test. the test keyword is test. if the test succeeds, you should see the search result. the string "index 'test1': query 'test': returned 3 matches of 3 total in 0.000 sec" appears. $ Cd/usr/local/sphinx/etc $/usr/local/sphinx/bin/searchd run the above command and you start the sphinx process. if there is no error, you can use ps-aux | grep '000000' to find the sphworker process. Haha, you're done! Author boymylove

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.