美文网首页
PipelineDB安装(centos7,pg11)

PipelineDB安装(centos7,pg11)

作者: 遥想公瑾当年 | 来源:发表于2018-12-04 10:35 被阅读239次

    一 前言

    PipelineDB在1.0之后,正式改成了Postgresql的一个插件,我们可以在一个pg中做一些有意思的事情了。本文先简述下安装。

    二 安装步骤

    2.1 zeromq

    wget https://github.com/zeromq/libzmq/releases/download/v4.2.5/zeromq-4.2.5.tar.gz  
    tar -zxvf zeromq-4.2.5.tar.gz  
    cd zeromq-4.2.5  
    #安装到默认路径,免的麻烦
    ./configure  
    # 如果之后安装pipelinedb报错,使用如下语句重新编译
    ./configure CPPFLAGS=-DPIC CFLAGS=-fPIC CXXFLAGS=-fPIC LDFLAGS=-fPIC
    make  
    make install  
    

    2.2 pipelinedb

    wget https://github.com/pipelinedb/pipelinedb/archive/1.0.0-6.tar.gz
    tar -zxvf   1.0.0-6.tar.gz
    cd pipelinedb-1.0.0-6 
      
    vi Makefile  
     #编辑下libzmq.so位置
    SHLIB_LINK += /usr/local/lib/libzmq.so -lstdc++  
    #保存退出
    #启用postgres用户环境变量(配置了很多pg的各种环境配置)
    source /home/postgres/.bashrc
    USE_PGXS=1 make  
    USE_PGXS=1 make install  
    

    在USE_PGXS=1 make可能报错如下:

    libzmq.a(src_libzmq_la-zmq.o): relocation R_X86_64_32 against _ZSt7nothrow can not be used when making a shared object; recompile with -fPIC
    libzmq.a: error adding symbols: Bad value
    

    解决方案,重新编译zeromq:

    ./configure CPPFLAGS=-DPIC CFLAGS=-fPIC CXXFLAGS=-fPIC LDFLAGS=-fPIC
    make  
    make install  
    

    2.3 配置postgresql.conf

    vi $PGDATA/postgresql.conf
    #编辑内如如下:
    # 这个pipelinedb最低要求317,我们这设置512
    max_worker_processes = 512
    shared_preload_libraries = 'pipelinedb'  
    pipelinedb.stream_insert_level=async
    pipelinedb.num_combiners=8
    pipelinedb.num_workers=16
    pipelinedb.num_queues=16
    pipelinedb.fillfactor=75
    pipelinedb.continuous_queries_enabled=true  
    

    重启pg,创建扩展

    [postgres@ ~]$ pg_ctl restart
    psql (11.1)
    Type "help" for help.
    
    test=# create extension pipelinedb;
    
    CREATE EXTENSION
    
    

    使用简介

    待补充

    相关文章

      网友评论

          本文标题:PipelineDB安装(centos7,pg11)

          本文链接:https://www.haomeiwen.com/subject/woxmcqtx.html