Solution to error when installing XunSearch engine on CentOS8.0

When I need to use full-text search engines on some small projects, I prefer to use Xunsou because it is easy to deploy and easy to call. When I installed Xunsou on a customer deployment system today, an error was reported (it is rare to encounter an error). After spending some time checking information, I finally solved the problem. Please share your experience.

The first is the location reason, because I have installed Xunsou on at least five or six Centos hosts, and the previous installations have been successfully completed, so there should not be any problem with Xunsou itself, but more likely it is related to the operating environment. After taking a look, this machine is currently installed with Centos 8.0. The systems I installed before were all 7.X, so it is most likely related to the version of the operating system.

After looking at the information on the installation interface, the content is as follows:

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 '/usr/local/src/xunsearch-full-1.4.14/libevent-2.0.21-stable'
make[1]: *** [Makefile:857: install-recursive] Error 1
make[1]: Leaving directory '/usr/local/src/xunsearch-full-1.4.14/libevent-2.0.21-stable'
make: *** [Makefile:1182: install] Error 2

It seems that an error was reported during the compilation process. This is more difficult because this is a code written in C. I can't directly change its source code, so I can only start with what problem caused the compilation error. After various inquiries, I found that a netizen had encountered this problem. The following is a quote from this netizen:

这个问题的原因及解决思路如下:
原因在于libevent 2.0.x需要openssl < 1.1.0
常用的几个Linux发行版已经把系统的openssl升级到了1.1.0+
即对应需要libevent 2.1.x+
而libevent 2.1.x改了头文件.. 如果不更换系统openssl版本.
那就可以去手动下载一个 libevent-2.1.11-stable.tar.gz
自己换成bz压缩格式(libevent-2.1.11-stable.tar.bz2)
放进 packages,记得删掉原来的libevent

作者:一件小毛衣
链接:https://www.jianshu.com/p/2bd166d48f42
来源:简书

I didn’t refer to his for the specific steps later because the Xunsou versions he and I used were different, and the specific solution methods were different from his, so let’s continue with my solution process: First, download 2.1
. For version Download it on your own browser and upload it through winscp, which is faster.
The version I downloaded is libevent2.1.12, and the download link is: https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz

After downloading, upload it to the directory where xunsearch is placed on the server. My directory is /usr/local/src/. Then decompress the file and recompress it into bz2 format. The reference code is as follows:

//先将libevent解压(以便压缩成所需格式)
tar -zxvf libevent-2.1.12-stable.tar.gz
//压缩成bz2格式,这是迅搜安装包的支持的格式
tar -cjf libevent-2.1.12-stable.tar.bz2 libevent-2.1.12-stable
//复制到xunsearch下的packages文件夹内
cp libevent-2.1.12-stable.tar.bz2 xunsearch-full-1.4.15/packages/
//进入安装包的目录并将原来自带的libevent安装包删除(xunsearch1.4.15自带的是2.0.X)
cd xunsearch-full-1.4.15/packages/
rm -f libevent-2.0.X
//返回上一步的文件夹(即迅搜安装包的根目录),然后执行setup.sh就可以了,
//迅搜会自动检查安装包文件内的libevent开头的安装包,如果没找到会报错,如果找到了就会自动解压并编译安装
cd ..
./setup.sh

Then the installation process is completed happily

Guess you like

Origin blog.csdn.net/one_and_only4711/article/details/110926096