• nginx1.18.0 安装vts


    wget https://codeload.github.com/yaoweibin/nginx_upstream_check_module/zip/master

    nginx-module-vts-master.zip # prometheus监控组件
    nginx_upstream_check_module-master.zip

    安装依赖的包
    yum -y install gcc gcc-c++ make automake autoconf libtool zlib zlib-devel openssl openssl-devel pcre pcre-devel libxslt-devel libxml2-devel gd-devel perl-devel perl-ExtUtils-Embed gperftools unzip

    yum install -y GeoIP-devel.x86_64

    #解压nginx安装包,并进入解压目录
    tar xf nginx-1.18.0.tar.gz
    cd nginx-1.18.0
    patch -p1 < /usr/local/nginx_upstream_check_module-master/check_1.16.1+.patch
    #编译nginx,指定启动用户为nginx,安装路径为/usr/local/nginx,编译参数下面有详解
    ./configure --prefix=/apps/nginx --with-http_stub_status_module --without-http-cache --with-http_ssl_module --with-http_realip_module --with-stream --with-http_sub_module --add-module=/usr/local/nginx_upstream_check_module-master --add-module=/usr/local/nginx-module-vts-master --with-http_realip_module --with-http_geoip_module --with-http_gzip_static_module --with-http_v2_module --with-stream_ssl_module

    #安装nginx
    make && make install
    #给目录授权
    chown -R nginx:nginx /usr/local/nginx
    #设置nginx启动命令为系统命令
    echo “PATH=$PATH:/usr/local/nginx/sbin/” >> /etc/profile
    #使命令生效
    source /etc/profile
    #启动nginx

    报错解决

       -o objs/addon/src/ngx_http_vhost_traffic_status_display_json.o \
        /usr/local/nginx-module-vts-master/src/ngx_http_vhost_traffic_status_display_json.c
    
    • 1
    • 2

    /usr/local/nginx-module-vts-master/src/ngx_http_vhost_traffic_status_display_json.c: In function ‘ngx_http_vhost_traffic_status_display_set_upstream_group’:
    /usr/local/nginx-module-vts-master/src/ngx_http_vhost_traffic_status_display_json.c:604:59: error: ‘ngx_http_upstream_rr_peer_t’ has no member named ‘check_index’
    if (ngx_http_upstream_check_peer_down(peer->check_index)) {
    ^
    make[1]: *** [objs/addon/src/ngx_http_vhost_traffic_status_display_json.o] Error 1
    make[1]: Leaving directory `/usr/local/src/nginx-1.18.0’
    make: *** [build] Error 2

    patch -p1 < /root/nginx_upstream_check_module/check_1.17.1+.patch

  • 相关阅读:
    机器学习(十五):异常检测之隔离森林算法(IsolationForest)
    云对象 - 重新定义前后端交互
    Jupyter Notebook的使用
    golang 定时器timer实用记录
    猿创征文|风起YuKon(禹贡)-空间数据库结缘数字孪生和实景三维建设
    任务九 深度学习 K近邻学习
    [python] Python类型提示总结
    项目管理(如何进行项目质量管理)
    dask读取sql数据:MySQL
    非科班毕业生,五面阿里:四轮技术面 +HR 一面已拿 offer
  • 原文地址:https://blog.csdn.net/tongzidane/article/details/127810731