Solutions to errors in installing xunsearch engine in centos8.0

When I need to apply full-text search engine to some small projects, I prefer to use xunsu because it is convenient to deploy and easy to call. Today, when I install xunsu for the customer’s deployment system, I reported an error (rarely encountered an error). I spent some time looking up the information, finally solved it, and shared my experience

The first reason is positioning. I have installed xunsu on at least five or six CentOS hosts, and the previous installation has been completed smoothly. Therefore, it should be because there is something wrong with xunsu itself, which is more likely related to the running environment. After a look, this machine is currently installed with CentOS 8.0, and the systems I installed before are all 7. X, so it is most likely related to the operating system It has something to do with the version of the system.

The information in the installation interface 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 there should be an error in the compilation process, which is more difficult. Because this is the code written in C, I can’t directly change its source code, so I can only start from what causes the compilation error. After various queries, I found that a netizen once encountered this problem. The following is the content quoted from this netizen:

The cause of this problem and the solution ideas are as follows.
The reason is that libevent 2.0.x requires openssl < 1.1.0
Several common Linux distributions have upgraded their openssl systems to 1.1.0+
That is, libevent 2.1.x+ is required
And libevent 2.1.x has changed the header file... If you do not change the system openssl version.
Then you can manually download a libevent-2.1.11-stable.tar.gz
convert to bz compressed format (libevent-2.1.11-stable.tar.bz2)
Put it into packages, remembering to delete the original libevent

I didn’t refer to him for the following specific steps, because the xunsu version I used is different from his, and the specific solution is different from his, so let’s continue with my solution process: First of all, download the 2.1. X version of libevent installation package. You can search libevent directly, and then download it on the official website. Most of the time, the official link is on GitHub. If you download it with WGet directly on Linux system, it’s a bit slow. In this case, you can download it on our own browser first, and then upload it through winscp, which is faster. The version I downloaded is libevent2.1.12. The download link is:

After downloading, upload it to the server and put it in the xunsearch directory. My directory is/usr/local/SRC /, then decompress the file and recompress it into bz2 format. The reference code is as follows:

//Unpack libevent first (in order to compress it into the desired format)
tar -zxvf libevent-2.1.12-stable.tar.gz
//compress to bz2 format, which is the format supported by the XunSuo installer
tar -cjf libevent-2.1.12-stable.tar.bz2 libevent-2.1.12-stable
// copy to the packages folder under xunsearch
cp libevent-2.1.12-stable.tar.bz2 xunsearch-full-1.4.15/packages/
// go to the package installation directory and remove the libevent package that comes with it (xunsearch1.4.15 comes with 2.0.X)
cd xunsearch-full-1.4.15/packages/
rm -f libevent-2.0.X
//return to the previous folder (i.e. the root directory of the Xunsearch installation package), then execute and you're done.
// XunSoo will automatically check for the libevent package in the installer file, if it doesn't find it, it will report an error, if it finds it, it will automatically unpack and compile it.
cd ..

Then the installation process is happily completed

Read More: