分享、学习、提高
2008/11/16 22:05
文章作者:Enjoy 转载请注明原文链接。
参考了多篇文章,Sphinx挺好安装的,就是SphinxSE没成功。

安装笔记,虽然没最终成功,但也解决了一些问题,下次有空再试试。

yum install -y python python-devel

wget http://www.sphinxsearch.com/downloads/sphinx-0.9.8.1.tar.gz
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.29-rc.tar.gz/from/http://mysql.easynet.be/

tar zxf mysql-5.1.29-rc.tar.gz
tar zxf sphinx-0.9.8.1.tar.gz
cp -R sphinx-0.9.8.1/mysqlse mysql-5.1.29-rc/storage/sphinx
cd mysql-5.1.29-rc
sh BUILD/autorun.sh
./configure --with-plugins=sphinx --prefix=/usr/local/mysql-search/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile

提示:checking for termcap functions library… configure: error: No curses/termcap library found
查了下要加这句:--with-named-curses-libs=/usr/lib/libncursesw.so.5
有这个文件,继续安装
或者
引用
说明 curses/termcap 库没有安装
apt-cache search curses | grep lib

安装 libncurses5-dev ,然后重新运行配置
apt-get install libncurses5-dev
引用自:http://blog.csdn.net/zubin006/archive/2007/12/24/1964627.aspx

make;make install

漫长的编译过程...

cd /usr/local/mysql-search/
chmod +w ./
chown -R mysql:mysql ./
my-medium.cnf不在以前的support-files目录了
cp share/mysql/my-medium.cnf my.cnf

bin/mysql_install_db --defaults-file=/usr/local/mysql-search/my.cnf --basedir=/usr/local/webserver/mysql --datadir=/usr/local/webserver/mysql/data --user=mysql --pid-file=/usr/local/webserver/mysql/mysql.pid --skip-locking --port=3306 --socket=/tmp/mysql.sock
不对,查了下这里面只支持--user和--basedir了。

bin/mysql_install_db --user=mysql
修改my.cnf,
[mysqld]
port            = 3306
socket          = /tmp/mysql.sock

port            = 3307
socket          = /tmp/mysql-search.sock
主要是服务器上也已经有了一个MYSQL实例在运行,所以这里修改一下端口号和socket。

/bin/mysqld_safe --defaults-file=/usr/local/mysql-search/my.cnf &

启不来。。。

安装下sphinx。

cd /root/soft/sphinx-0.9.8.1
CPPFLAGS=-I/usr/include/python2.4
LDFLAGS=-lpython2.4
./configure --prefix=/usr/local/sphinx --with-mysql=/usr/local/mysql-search
make
make install
sphinx安装完。

cd /usr/local/mysql-search/
/bin/mysqld_safe --defaults-file=/usr/local/mysql-search/my.cnf &

和之前同样错误,081116 21:35:58 mysqld_safe Logging to '/usr/local/mysql-search/data/qy.err'.
看了下错误提示:
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
运行mysql_upgrade会找到以前的mysql,没成功。就没法继续了:(

还是测试 一下sphinx的自身功能吧,配置文件在etc目录下:
cd /usr/local/sphinx/etc
cp sphinx.conf.dist sphinx.conf
vi sphinx.conf,修改了下配置,把前几天在本机测试的配置内容加了进去。
生成的数据目录可以放在var/data下,自带有这个目录。
开始创建索引
[root@qy sphinx]# bin/indexer --config sphinx.conf hxtest
bin/indexer: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory
google了下:
ln -s /usr/local/mysql-search/lib/mysql/libmysqlclient.so.16 /usr/lib/libmysqlclient.so.16
做了个软链接,在我原来的/usr/local/mysql/lib/下倒是没有这个文件。

bin/searchd启动,用api下的test.php测试能够搜索出数据,但中文没法试。
到这里,也就是SphinxSE安装成功,但SphinxSE失败了。
发表评论
表情
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]