通过openresty和嵌入式的lua脚本,来搭建高并发的日志采集服务器,openrestylua


通过openresty和嵌入式的lua脚本,来搭建高并发的日志采集服务器,现在主要采集pc端和app端的日志,数据存储在kafka

openresty 服务搭建步骤(mac,linux)

wget https://www.openssl.org/source/openssl-1.0.2f.tar.gz

tar -zvxf openssl-1.0.2f.tar.gz

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz

tar -xvf pcre-8.38.tar.gz

wget https://openresty.org/download/ngx_openresty-1.9.7.2.tar.gz

tar -zxvf ngx_openresty-1.9.7.2.tar.gz

cd ngx_openresty-1.9.7.2/

./configure --with-openssl=../openssl-1.0.2f \ --with-pcre=../pcre-8.38 make

sudo make install

openresty 安装kafka插件

#下载lua-resty-kafka: wget https://github.com/doujiang24/lua-resty-kafka/archive/master.zip unzip lua-resty-kafka-master.zip -d ~

#拷贝lua-resty-kafka到openrestysudo mkdir /usr/local/openresty/lualib/resty/kafka cp -rf ~/lua-resty-kafka-master/lib/resty /usr/local/openresty/lualib/resty/kafka

#通过git下载代码~这个目录下

cd /usr/local/openresty/nginx

ln -s ~/logadash/src/udf udf

ln -s ~/logadash/conf/mac_nginx.conf nginx.conf

相关内容