rsylog 保存到 sqlite

rsylog 保存到 sqlite

一、编译 rsylog

由于系统自带的 rsylog 默认是没有启用保存到数据库的模块的,因此我们需要手动编译安装 rsylog:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# 1. 下载 rsylog 源码
wget https://www.rsyslog.com/download/files/download/rsyslog/rsyslog-8.2208.0.tar.gz

# 2. 解压
tar xvf rsyslog-8.2208.0.tar.gz

# 3. 配置
cd rsyslog-8.2208.0/
./configure --enable-libdbi --enable-mysql

# 4. 编译安装
make && make install

编译过程中可能会遇到环境缺失错误,下面列举一下自己编译过程中遇到的错误:

  • 1
    2
    3
    4
    5
    6
    7
    
    error: 
    configure: error: The pkg-config script could not be found or is too old.  Make sure it
    is in your PATH or set the PKG_CONFIG environment variable to the full
    path to pkg-config.
    
    solution:
    apt install pkg-config
    
  • 1
    2
    3
    4
    5
    6
    
    error:
    configure: error: Package requirements (libestr >= 0.1.9) were not met:
    No package 'libestr' found
    
    solution:
    apt install libestr-dev
    
  • 1
    2
    3
    4
    5
    6
    
    error:
    configure: error: Package requirements (libfastjson >= 0.99.8) were not met:
    No package 'libfastjson' found
    
    solution:
    apt install libfastjson-dev
    
  • 1
    2
    3
    4
    5
    
    error:
    configure: error: libdbi is missing
    
    solution:
    apt install libdbi-dev
    
  • 1
    2
    3
    4
    5
    6
    
    error:
    configure: error: Package requirements (uuid) were not met:
    No package 'uuid' found
    
    solution:
    apt install uuid-dev
    
  • 1
    2
    3
    4
    5
    
    error:
    configure: error: libgcrypt-config not found in PATH
    
    solution:
    apt install libgcrypt20-dev
    
  • 1
    2
    3
    4
    5
    6
    
    error:
    configure: error: Package requirements (libcurl) were not met:
    No package 'libcurl' found
    
    solution:
    apt install libcurl4-openssl-dev
    
  • 1
    2
    3
    4
    5
    
    error:
    configure: error: zlib library and headers not found
    
    solution:
    apt install zlib1g-dev
    
  • 1
    2
    3
    4
    5
    6
    7
    8
    
    error:
    config.status: error: Something went wrong bootstrapping makefile fragments
        for automatic dependency tracking.  Try re-running configure with the
        '--disable-dependency-tracking' option to at least be able to build
        the package (albeit without support for automatic dependency tracking).
    
    solution:
    apt install make
    
  • 
    apt-get install libmysqlclient-dev
    
apt install libdbd-sqlite3
Licensed under CC BY-NC-SA 4.0
使用 Hugo 构建
主题 StackJimmy 设计