Sphinx部署
1、最新下载地址:
2、http://sphinxsearch.com/downloads/accept.php?file=sphinx-2.1.1-beta.tar.gz
3、tar �Czxvf sphinx-2.0.3-release.tar.gz
4、cd sphinx-2.0.3-release.tar.gz
5、在/etc/ld.so.conf.d 目录下新建mysql5-x86_64.conf写入/data/program/mysql5/lib 、/data/program/mysql5/include,执行ldconfig 目的是将mysql的模块调入内存中,处理速度快
./configure --prefix=/data/program/sphinx2.0.3 --with-mysql=/data/program/mysql5
make -j 4
make install
生成索引文件
/data/program/sphinx2.0.3/bin/indexer �C-all
执行报错WARNING: sql_query_post_index: The MySQL server is running with the --read-only option so it cannot execute this statement (DSN=mysql://twitter:***@localhost:3306/twitter)
处理修改mysql readonly 为false即可
Show variables like ‘%read_only%’
值为on
Set GLOBAL read_only = false;
索引创建成功则在/data/program/sphinx2.0.3/var/data下有数据生成
创建indexer时若出现如下错误:
/data/program/sphinx2.0.1/bin/indexer: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory
32位系统下:
ln -s /data/program/mysql5/lib/mysql/libmysqlclient.so.16.0.0 /usr/lib/libmysqlclient.so.16
64位系统下
ln -s /data/program/mysql5/lib/mysql/libmysqlclient.so.16.0.0 /usr/lib64/libmysqlclient.so.16
启动服务
/data/program/sphinx2.0.3/bin/searchd (此为启动服务)
/data/program/sphinx2.0.3/bin/indexer --rotate main
/data/program/sphinx2.0.3/bin/indexer --rotate delta
停止服务
/data/program/sphinx2.0.3/bin/searchd --stop
coresseek部署
最新下载地址:http://www.coreseek.cn/uploads/csft/4.0/coreseek-4.1-beta.tar.gz
安装coreseek开发的mmseg,为coreseek提供中文分词功能
cd mmseg-3.2.14
./bootstrap
./configure --prefix=/data/program/mmseg3
make
make install
安装mmseg依赖的系统环境
m4 、autoconf 、automake 、libtool
yum �Cy install m4 autoconf automake libtool
安装coreseek4.1
cd csft-4.1
sh buildconf.sh
./configure --prefix=/data/program/coreseek --without-python --without-unixodbc --with-mmseg --with-mmseg-includes=/data/program/mmseg3/include/mmseg/ --with-mmseg-libs=/data/program/mmseg3/lib/ --with-mysql
make -j 4
make install
测试安装
/data/program/coreseek/bin/indexer -c /data/program/coreseek/etc/sphinx-min.conf.dist
若出现/data/program/coreseek/bin/indexer: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory 错误
执行ln -s /data/program/mysql5/lib/libmysqlclient.so.18.0.0 /usr/lib64/libmysqlclient.so.18
修改配置文件
配置文件命名为csft.conf
创建索引
/data/program/coreseek/bin/indexer --all
启动searched进程
/data/program/coreseek/bin/searchd -c /data/program/coreseek/etc/csft.conf 启动命令
/data/program/coreseek/bin/indexer --rotate user_main
/data/program/coreseek/bin/indexer --rotate user_delta
/data/program/coreseek/bin/searchd -c /data/program/coreseek/etc/csft.conf --stop