Web Projects Consulting

Fast installing Sphinx SE on Fedora 14 Server

The installation under Virtual Box was quite tricky due to lack of requires disk space but, finally, went on OK.

mkdir mysql-sphinx
cd mysql-sphinx

Get the source of mysql software exactly same as installed on your server, I use sourceforge.net for that. Untar it.
You can also use:

yumdownloader --source mysql
rpm2cpio mysql-XXX.rpm  | cpio -idmv
tar xvfz mysql-XXX.tgz

Get latest sphinx and install it:

sudo yum install mysql-devel
wget //sphinxsearch.com/files/sphinx-2.0.6-release.tar.gz
tar xvfz sphinx-2.0.6-release.tar.gz
cd sphinx-2.0.6-release
./configure --prefix=/usr 
make 
sudo make install

Compile sphinx mysql plugin (watch paths):

cd ../mysql-XXX
cp -Rv ../sphinx-2.0.6-release/mysqlse/ ./storage/sphinx
sh BUILD/autorun.sh; ./configure --prefix=/usr; make

Copy and install:

# MySQL 5.1+
sudo cp -v storage/sphinx/.libs/ha_sphinx.so /usr/lib64/mysql/plugin/
# MySQL 5.5+
sudo cp -v storage/sphinx/ha_sphinx.so /usr/lib64/mysql/plugin/

sudo service mysqld restart
mysql -u root -p -e "INSTALL PLUGIN sphinx SONAME 'ha_sphinx.so';
sudo service mysqld restart

Test:

mysql> show engines;
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| Engine     | Support | Comment                                                    | Transactions | XA   | Savepoints |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| MRG_MYISAM | YES     | Collection of identical MyISAM tables                      | NO           | NO   | NO         |
| CSV        | YES     | CSV storage engine                                         | NO           | NO   | NO         |
| MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance     | NO           | NO   | NO         |
| InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys | YES          | YES  | YES        |
| SPHINX     | YES     | Sphinx storage engine 2.0.6-release                        | NO           | NO   | NO         |
| MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables  | NO           | NO   | NO         |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
6 rows in set (0.00 sec)

Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.