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

安装错误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
分析:

查看系统的openssl的安装版本是否1.1.0+
如果是就是下面原因造成的:

原因在于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

然后修改 xunsearch-1.4.13/configure


具体步骤:

1.下载libevent-2.1.11-stable.tar.gz;
并将libevent-2.1.11-stable.tar.gz格式换成libevent-2.1.11-stable.tar.bz2;
复制libevent-2.1.11-stable.tar.bz2 至xunsearch-full-1.4.14/packages

#下载
wget https://github.com/libevent/libevent/releases/download/release-2.1.11-stable/libevent-2.1.11-stable.tar.gz
#先解压
tar -zxvf libevent-2.1.11-stable.tar.gz
#压缩成bz2
tar -cjf libevent-2.1.11-stable.tar.bz2 libevent-2.1.11-stable
#复制
cp libevent-2.1.11-stable.tar.bz2 xunsearch-full-1.4.14/packages/
  1. 进入packages/目录下编辑xunsearch-1.4.14/configure文件
cd xunsearch-full-1.4.14/packages/
#解压xunsearch-1.4.14.tar.bz2
tar -jxvf xunsearch-1.4.14.tar.bz2
#进入xunsearch-1.4.14编辑configure文件
cd xunsearch-1.4.14
vi configure
#做如下修改(line5390):

#if _EVENT_NUMERIC_VERSION >= 0x02000000
#改为:
#if EVENT__NUMERIC_VERSION >= 0x02000000

#删除旧的xunsearch-1.4.14.tar.bz2,并压缩刚才修改过的文件为:xunsearch-1.4.14.tar.bz2
rm -rf xunsearch-1.4.14.tar.bz2
tar -cjf xunsearch-1.4.14.tar.bz2 xunsearch-1.4.14

#这是重新有了修改过configure的包,xunsearch-1.4.14.tar.bz2
#现在重新安装xunsearch,就可解决刚才的问题

启动xunsearch

./xs-ctl.sh start

启动错误:

WARNING: server[xs-indexd] is running (BIND:127.0.0.1:8383, PID:11417)
bin/xs-searchd: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by bin/xs-searchd)
bin/xs-searchd: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by bin/xs-searchd)
bin/xs-searchd: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by bin/xs-searchd)
bin/xs-searchd: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/dev/local/libs/xunsearch/lib/libxapian.so.30)
bin/xs-searchd: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by /home/dev/local/libs/xunsearch/lib/libxapian.so.30)
bin/xs-searchd: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /home/dev/local/libs/xunsearch/lib/libxapian.so.30)
bin/xs-searchd: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.5' not found (required by /home/dev/local/libs/xunsearch/lib/libxapian.so.30)
bin/xs-searchd: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /home/dev/local/libs/xunsearch/lib/libxapian.so.30)
bin/xs-searchd: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.23' not found (required by /home/dev/local/libs/xunsearch/lib/libxapian.so.30)
bin/xs-searchd: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /home/dev/local/libs/xunsearch/lib/libxapian.so.30)

可能原因是因为升级了Gcc的原因。
解决:

find / -name libstdc*
...
/usr/lib64/libstdc++.so.6.0.13
/usr/lib64/libstdc++.so.6
...
/usr/local/lib64/libstdc++.so.6.0.27
...
/usr/local/lib64/libstdc++.so
...
/usr/local/lib64/libstdc++.so.6

##复制/usr/local/lib64/libstdc++.so.6.0.27至目录/usr/lib64/下
cp /usr/local/lib64/libstdc++.so.6.0.27 /usr/lib64/
cd /usr/lib64
ln -s libstdc++.so.6.0.27 libstdc++.so.6
#既可解决

你可能感兴趣的:(xunsearch 安装错误Makefile:793: bufferevent_openssl.lo)