-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathinstall_rsyslog_with_omkafka.sh
68 lines (55 loc) · 2.08 KB
/
install_rsyslog_with_omkafka.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
## Install rsyslog with omkafka.
## omkafka enables rsyslog to push logs to kafka, a distributed message system.
## see http://www.rsyslog.com/doc/master/configuration/modules/omkafka.html
## This installation use yum to manage packages.
## add rsyslog repo
WORK_DIR=$(pwd)
cd /etc/yum.repos.d
wget http://rpms.adiscon.com/v8-stable/rsyslog.repo -O rsyslog.repo
cd $WORK_DIR
mkdir rsyslog-install
cd rsyslog-install
# check rsyslog version
# rsyslog supports kafka from v8.7.0
old_rsyslog_ver=$(rsyslogd -version |head -n 1 | awk '{print $2}')
## install rsyslog dependency: libestr
yum install -y libestr-devel
## install rsyslog dependency: libee
yum install -y libee-devel
## install rsyslog dependency: json-c
yum install -y json-c-devel
## install rsyslog denpendency: uuid
yum install -y libuuid-devel
## install rsyslog denpendency: liblogging-stdlog
yum install -y liblogging-devel
## install rsyslog denpendency: rst2man
yum install -y python-docutils
## install librdkafka for omkafka
wget https://github.com/edenhill/librdkafka/archive/0.8.5.tar.gz -O librdkafka-0.8.5.tar.gz
tar zxvf librdkafka-0.8.5.tar.gz
cd librdkafka-0.8.5
./configure
make
make install
cd ..
## install rsyslog
wget http://www.rsyslog.com/files/download/rsyslog/rsyslog-8.8.0.tar.gz -O rsyslog-8.8.0.tar.gz
tar zxvf rsyslog-8.8.0.tar.gz
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/lib64/pkgconfig/
old_executable_path=$(which rsyslogd)
executable_dir=$(dirname "$old_executable_path")
cd rsyslog-8.8.0
./configure --sbindir=$executable_dir --libdir=/usr/lib64 --enable-omkafka
make
make install
## show installation result:
new_rsyslog_ver=$(rsyslogd -version |head -n 1 | awk '{print $2}')
echo "Old rsyslogd version: "$old_rsyslog_ver
echo "New rsyslogd version: "$new_rsyslog_ver
echo "Executable: " $(which rsyslogd)
## References:
## http://www.rsyslog.com/doc/master/installation/install_from_source.html
## http://bigbo.github.io/pages/2015/01/21/syslog_kafka/
## http://blog.oldzee.com/?tag=rsyslog
## http://www.rsyslog.com/newbie-guide-to-rsyslog/
## http://www.rsyslog.com/doc/master/configuration/modules/omkafka.html