Building SphinxSE on Ubuntu 9.04
I pulled some of this information from: http://www.v-nessa.net/2007/07/21/installing-sphinx-for-mysql-51
First of all, you need mysql-server-5.1, so install it:
# sudo apt-get install mysql-server-5.1
And it’s sources:
# apt-get source mysql-server-5.1
Then you need to get the sphinx tarball, extract it and then copy the mysqlse directory into the storage/ directory within the mysql source directory.
# wget http://www.sphinxsearch.com/downloads/sphinx-0.9.8.1.tar.gz # tar xzf sphinx-0.9.8.1.tar.gz # cd mysql-dfsg-5.1-5.1.31/ # cp -R ../../sphinx-0.9.8.1/mysqlse storage/sphinx
For some reason, I could not configure mysql, it was missing the Docs/ directory, so I nabbed the tarball from MySQL and extracted Docs into my debian MySQL source tree.
# wget http://mysql.he.net/Downloads/MySQL-5.1/mysql-5.1.37.tar.gz # tar xzvf mysql-5.1.48.tar.gz --wildcards '*/Docs/*' --strip=1 -C mysql-dfsg-5.1-5.1.41/
Now configure and make it, do NOT use the –with-plugins=sphinx switch for configure, I found a tutorial online that said to, but reading the help for ./configure –help reveals that this option will statically link the plugin into the mysqld executable. We want the plugin to be built dynamically. Also, you can do a simple make if you like, but I like to redirect the make output to a log file so I have record of any errors that may occur. I pulled most of the configure flags from the debian/rules file in the sources. These must match what the original mysqld was built with for the plugin to align correctly with the mysqld we installed above. You may also need to install some pre-requisites.
# sudo apt-get install automake autoconf libtool
# BUILD/autorun.sh
# ./configure --prefix=/usr \
--exec-prefix=/usr \
--libexecdir=/usr/sbin \
--datadir=/usr/share \
--localstatedir=/var/lib/mysql \
--includedir=/usr/include \
--infodir=/usr/share/info \
--mandir=/usr/share/man \
--enable-thread-safe-client \
--enable-local-infile \
--with-pstack \
--with-fast-mutexes \
--with-big-tables \
--with-unix-socket-path=/var/run/mysqld/mysqld.sock \
--with-mysqld-user=mysql \
--with-libwrap \
--with-ssl \
--without-docs \
--with-extra-charsets=all \
--with-embedded-server \
--with-embedded-privilege-control
# make >&1 | tee build.log
You can optionally view sphinx specific build output by opening another terminal and tailing build.log
# tail -f build.log | grep sphinx
*snore*
Then install the plugin into your mysqld installed via apt.
# sudo mkdir /var/lib/mysql/plugins # sudo cp storage/sphinx/libs/ha_sphinx.so* /var/lib/mysql/plugins/ # sudo chown -R mysql:mysql /var/lib/mysql/plugins # sudo vi /etc/mysql/my.cnf -- plugin_dir = /var/lib/mysql/plugins --
Ubuntu Intrepid uses apparmor to limit what binaries can be executed/loaded, so we have to tell apparmor about our new plugins directory:
# sudo vi /etc/apparmor.d/usr.sbin.mysqld -- /var/lib/mysql/plugins/* mr, -- # sudo /etc/init.d/apparmor restart # sudo /etc/init.d/mysql restart
Now install the plugin into mysql.
# mysql -u root -p INSTALL PLUGIN sphinx SONAME 'ha_sphinx.so'; Query OK, 0 rows affected (0.00 sec)








1 Comment
Jump to comment form | comments rss [?] | trackback uri [?]