编程

在 RedHat 和 CentOS 上安装 Manticore

357 2024-02-16 04:50:00

支持的发行版:

  • CentOS 7, RHEL 7, Oracle Linux 7
  • CentOS 8, RHEL 8, Oracle Linux 8, CentOS Stream 8
  • Amazon Linux 2
  • CentOS 9, RHEL 9, AlmaLinux 9

YUM 仓库

在 RedHat/CentOS 上安装 Manticore 的最简单方法是使用 YUM 仓库:

安装仓库:

sudo yum install https://repo.manticoresearch.com/manticore-repo.noarch.rpm

然后安装 Manticore Search:

sudo yum install manticore manticore-extra

如果你要从旧版本升级到 Manticore 6,建议先删除旧软件包,以避免更新后的软件包结构引起冲突:

sudo yum remove manticore*

这不会移除数据和配置文件。

开发包

如果你想要使用 "Nightly" (开发) 版本:

sudo yum -y install https://repo.manticoresearch.com/manticore-repo.noarch.rpm && \
sudo yum -y --enablerepo manticore-dev install manticore manticore-extra manticore-common manticore-server manticore-server-core manticore-tools manticore-executor manticore-buddy manticore-backup manticore-columnar-lib manticore-server-core-debuginfo manticore-tools-debuginfo manticore-columnar-lib-debuginfo  manticore-icudata

独立的 RPM 包

要从 Manticore 存储库下载独立的 RPM 文件,请按照 https://manticoresearch.com/install/ 上的说明进行操作。

更多你可能需要的包

对于 indexer

如果计划使用索引器(indexer)从外部源创建表,则需要确保已安装相应的客户端库,以便提供所需的索引源。下行代码将同时安装所有这些设备;请随意使用它,或者将其简化为只安装您需要的库(只使用 mysql 源 —则只需 mysql-libs 就足够了,而不需要 unixODBC)。

sudo yum install mysql-libs postgresql-libs expat unixODBC

在 CentOS Stream 8 你可能需要运行:

dnf install mariadb-connector-c

如果出现错误: sql_connect: MySQL source wasn't initialized. Wrong name in dlopen? 请尝试从 MySQL 中创建普通表。

Ukrainian lemmatizer

这个 lemmatizer 需要 Python 3.9+。请确保已安装 Python 3.9+ 并使用 --enable-shared 配置。

以下为如何在 CentOS 7/8 中安装 Python 3.9 和 Ukrainian lemmatizer:

# install Manticore Search and UK lemmatizer from YUM repository
yum -y install https://repo.manticoresearch.com/manticore-repo.noarch.rpm
yum -y install manticore manticore-lemmatizer-uk

# install packages needed for building Python
yum groupinstall "Development Tools" -y
yum install openssl-devel libffi-devel bzip2-devel wget -y

# download, build and install Python 3.9
cd ~
wget https://www.python.org/ftp/python/3.9.2/Python-3.9.2.tgz
tar xvf Python-3.9.2.tgz
cd Python-3.9*/
./configure --enable-optimizations --enable-shared
make -j8 altinstall

# update linker cache
ldconfig

# install pymorphy2 and UK dictionary
pip3.9 install pymorphy2[fast]
pip3.9 install pymorphy2-dicts-uk