Rocky Linux 8安装迅搜(Xunsearch)服务

RockyLinux 运维 · systemofdown · 于 1年前 发布 · 789 次阅读

背景

Xunsearch 是一个高性能、全功能的全文检索解决方案

Xunsearch 采用结构化分层设计,包含后端服务、前端开发包两大部分,层次清晰而不交叉。 其中后端是采用 C/C++ 编写的守护进程,而前端采用最为流行的脚本语言 PHP ,对于 web 搜索项目更为方便。

Xunsearch 可以帮助您建立各种行业门户/垂直搜索、BBS 论坛搜索、CMS/Web站内搜索、文档/文献资料检索, 以及各种基于现有数据库系统的全文检索。

Xunsearch 分为后端服务和前端开发包两大部分,这两个部分允许部署在不同服务器中。 架构图如下:

              ==============================
              |   Your Search Application  |
              ==============================
                  /\                /\
................ /||\ ............ /||\ ....................
:                 ||                ||                     :
:             +-----------------------------+              :
:             |  [PHP]  | other lang (TODO) |              :
:             |-----------------------------|              :
:             |   SDK: (xunsearch devkit)   |              :
:             +-----------------------------+              :
:                 /                   \                    :
:                /                     \                   :
:    +-----------------+          +-------------------+    : 
:    |  Index-server   |          |   Search-server   |    :
:    |-----------------|          |-------------------|    : 
:    |   xs-indexd     |          |    xs-searchd     |    :
:    |   xs-import     |          |     1*master      |    :
:    |   xs-logging    |          | N*worker(M*thread)|    :
:    +-----------------+          +-------------------+    :
:                |                       |                 :
:                |                       |                 :
:             +-----------------------------+              :
:             |     Xapian-core + scws      |              :
:             +-----------------------------+              :  
:                |          |            |                 :
:      +------------+  +--------+  +---------------+       :
:      | Local Disk |  | Memory |  | Remote socket |       :
:      +------------+  +--------+  +---------------+       :
:                                                          :
...................... Xun Search ..........................

安装

Xunsearch 目前只提供了编译安装的方式, 官方提供了一个自动化安装脚本简化了安装过程.

安装编译相关工具

欲善其事比利其器, 首先是做一些前置准备工作

yum install glibc-headers gcc gcc-c++

下载Xunsearch安装包

cd /usr/local/src
wget http://www.xunsearch.com/download/xunsearch-full-latest.tar.bz2
tar -xjf xunsearch-full-latest.tar.bz2

填坑, 替换最新的libevent库

下载最新的libevent

wget https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz

并将tar.gz格式换成tar.bz2

tar -zxvf libevent-2.1.12-stable.tar.gz
tar -cjf libevent-2.1.12-stable.tar.bz2 libevent-2.1.12-stable

复制tar.bz2包 至xunsearch-full-1.4.16/packages

rm -f xunsearch-full-1.4.16/packages/libevent-2.0.21-stable.tar.bz2
cp libevent-2.1.12-stable.tar.bz2 xunsearch-full-1.4.16/packages/

⚠️ 如果不替换会有安装错误, 原因在于libevent 2.0.x需要openssl < 1.1.0, 常用的几个Linux发行版已经把系统的openssl升级到了1.1.0+

安装错误1:

bufferevent_openssl.c:237:2: note: (near initialization for 'methods_bufferevent')
bufferevent_openssl.c:228:19: error: storage size of 'methods_bufferevent' isn't known
 static BIO_METHOD methods_bufferevent = {
                   ^~~~~~~~~~~~~~~~~~~
make[2]: *** [Makefile:793: bufferevent_openssl.lo] Error 1
make[2]: Leaving directory '/home/dev/software/xunsearch-full-1.4.14/libevent-2.0.21-stable'
make[1]: *** [Makefile:857: install-recursive] Error 1
make[1]: Leaving directory '/home/dev/software/xunsearch-full-1.4.14/libevent-2.0.21-stable'
make: *** [Makefile:1182: install] Error 2

安装错误2:

checking for correct libevent version... configure: error: libevent 2.0.0 or greater required.
-----
ERROR: failed to configure xunsearch, see 'setup.log' for more detail

安装xunsearch

cd xunsearch-full-1.4.16/
./setup.sh

安装程序开始执行起来了

安装路径(/usr/local/xunsearch)默认就好, 直接回车

接下来就安装成功啦

说明和注意事项

开启/重新开启

xunsearch 服务程序,命令如下:

/usr/local/xunsearch/bin/xs-ctl.sh restart

开机启动设置

/etc/rc.local 中增加一行

echo "/usr/local/xunsearch/bin/xs-ctl.sh start" >> /etc/rc.local

索引数据存储

所有的索引数据将被保存在下面这个目录中:

/usr/local/xunsearch/data

如需要转移到其它目录,请使用软链接。


参考: xunsearch 安装错误Makefile:793: bufferevent_openssl.lo

共收到 0 条回复
没有找到数据。
添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册