在Ubuntu 20.04上安装和配置NXLog CE

NXLog 是一个跨平台的日志收集和集中化工具。它从各种类型的日志源,格式和平台收集日志,并将其安全可靠地转发到中央日志服务器。在本指南中,我们将学习如何在Ubuntu 20.04上安装和配置NXLog CE。

NXLog社区版功能齐全。在其上阅读有关这些功能的信息

在Ubuntu 20.04上安装和配置NXLog CE

注意截至撰写本文时,尚未提供适用于Ubuntu 20.04的NXLog,因此,本教程不是用于安装NXLog的官方指南,而是我为使NXLog在Ubuntu 20.04上运行而采取的一系列步骤。

下载NXLog Debian Binary软件包

NXLog在默认的Ubuntu 20.04存储库上不可用。但是,它可以作为debian二进制软件包使用。要在Ubuntu 20.04上安装NXLog,您需要下载此debian二进制软件包。

因此,导航到 NXLog社区版下载 页并获取Ubuntu 18.04安装程序。抓住链接并使用wget命令将其拉出。

wget https://nxlog.co/system/files/products/files/348/nxlog-ce_2.10.2150_ubuntu_bionic_amd64.deb

安装NXLog

下载完成后,您现在可以在Ubuntu 20.04上安装NXLog CE。

apt install ./nxlog-ce_2.10.2150_ubuntu_bionic_amd64.deb

在安装过程中,您将遇到依赖关系未满足的问题。

...
The following packages have unmet dependencies:
 nxlog-ce : Depends: libperl5.26 (>= 5.26.0~rc1) but it is not installable
            Depends: libssl1.0.0 (>= 1.0.0) but it is not installable
E: Unable to correct problems, you have held broken packages.

安装必需的依赖项

因此,要在Ubuntu 20.04上成功安装NXLog,您需要安装缺少的依赖项。您可以按以下方式下载并安装这些软件包。否则,这些软件包可以从Ubuntu 20.04存储库中安装,但不能满足使用Ubuntu 18.04二进制软件包安装NXLog的要求。

下载并安装Perl模块;

wget http://archive.ubuntu.com/ubuntu/pool/main/p/perl/perl-modules-5.26_5.26.1-6_all.deb
apt install ./perl-modules-5.26_5.26.1-6_all.deb

下载并安装Openssl库。

wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.3_amd64.deb
apt install ./libssl1.0.0_1.0.2n-1ubuntu5.3_amd64.deb

下载并安装GNU dbm库;

wget http://archive.ubuntu.com/ubuntu/pool/main/g/gdbm/libgdbm5_1.14.1-6_amd64.deb
apt install ./libgdbm5_1.14.1-6_amd64.deb

下载并安装Perl库;

wget http://archive.ubuntu.com/ubuntu/pool/main/p/perl/libperl5.26_5.26.1-6_amd64.deb
apt install ./libperl5.26_5.26.1-6_amd64.deb

安装NXLog

然后,您可以尝试重新安装NXLog。

apt install ./nxlog-ce_2.10.2150_ubuntu_bionic_amd64.deb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'nxlog-ce' instead of './nxlog-ce_2.10.2150_ubuntu_bionic_amd64.deb'
The following additional packages will be installed:
  libapr1 libdbi1
Suggested packages:
  libdbd-mysql libdbd-pgsql libdbd-sqlite3 libdbd-freetds
The following NEW packages will be installed:
  libapr1 libdbi1 nxlog-ce
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 119 kB/1,325 kB of archives.
After this operation, 4,353 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 /root/nxlog-ce_2.10.2150_ubuntu_bionic_amd64.deb nxlog-ce amd64 2.10.2150 [1,207 kB]
Get:2 http://ke.archive.ubuntu.com/ubuntu focal/main amd64 libapr1 amd64 1.6.5-1ubuntu1 [91.4 kB]
Get:3 http://ke.archive.ubuntu.com/ubuntu focal/main amd64 libdbi1 amd64 0.9.0-5 [27.3 kB]
Fetched 119 kB in 1s (115 kB/s)   
Selecting previously unselected package libapr1:amd64.
(Reading database ... 73723 files and directories currently installed.)
Preparing to unpack .../libapr1_1.6.5-1ubuntu1_amd64.deb ...
Unpacking libapr1:amd64 (1.6.5-1ubuntu1) ...
Selecting previously unselected package libdbi1:amd64.
Preparing to unpack .../libdbi1_0.9.0-5_amd64.deb ...
Unpacking libdbi1:amd64 (0.9.0-5) ...
Selecting previously unselected package nxlog-ce.
Preparing to unpack .../nxlog-ce_2.10.2150_ubuntu_bionic_amd64.deb ...
Unpacking nxlog-ce (2.10.2150) ...
Setting up libdbi1:amd64 (0.9.0-5) ...
Setting up libapr1:amd64 (1.6.5-1ubuntu1) ...
Setting up nxlog-ce (2.10.2150) ...
Adding user nxlog to group nxlog
Processing triggers for systemd (245.4-4ubuntu3.1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...

NXLog现在已安装在Ubuntu 20.04上。按照以下指南进行配置;

如何配置NXLog将系统日志转发到中央日志服务器

这标志着我们关于如何在Ubuntu 20.04上安装和配置NXLog CE的指南的结尾。

进一步阅读

NXLog社区版参考手册

Sidebar