当前位置: 首页 > 工具软件 > PipelineDB > 使用案例 >

postgresql 11.3上安装pipelineDB插件

羊舌昆杰
2023-12-01

以前pipelineDB是单独使用的,1.0版本作为postgresql插件使用
和以下版本兼容
PostgreSQL 10: 10.1, 10.2, 10.3, 10.4, 10.5
PostgreSQL 11: 11.0

root执行

下载,编译安装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  
postgres 用户执行

从github下载所需pipelineDB

https://github.com/pipelinedb/pipelinedb
下载后解压
unzip pipelinedb-master.zip
编译安装
cd pipelinedb-master/
 vi Makefile  
修改libzmq.so位置
SHLIB_LINK += /usr/local/lib/libzmq.so -lstdc++  
保存退出
USE_PGXS=1 make  
USE_PGXS=1 make install  

修改配置文件

vi $PGDATA/postgresql.conf
加入以下内容
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  

安装插件:

postgres@db-192-168-173-69-> psql
psql (11.3)
Type "help" for help.

hank=> create extension pipelinedb ;
ERROR:  permission denied to create extension "pipelinedb"
HINT:  Must be superuser to create this extension.
hank=> \c  hank postgres
You are now connected to database "hank" as user "postgres".
hank=# create extension pipelinedb ;
WARNING:  pipelinedb must be loaded via shared_preload_libraries
CREATE EXTENSION

重启pg,可见已经加载插件

 pg_ctl restart
waiting for server to shut down.... done
server stopped
waiting for server to start....    ____  _            ___            ____  ____
   / __ \(_)___  ___  / (_)___  ___  / __ \/ __ )
  / /_/ / / __ \/ _ \/ / / __ \/ _ \/ / / / __  |
 / ____/ / /_/ /  __/ / / / / /  __/ /_/ / /_/ /
/_/   /_/ .___/\___/_/_/_/ /_/\___/_____/_____/
       /_/

2019-06-25 17:33:52.019 CST [3206] LOG:  listening on IPv4 address "0.0.0.0", port 1921
2019-06-25 17:33:52.019 CST [3206] LOG:  listening on IPv6 address "::", port 1921
2019-06-25 17:33:52.078 CST [3206] LOG:  listening on Unix socket "/tmp/.s.PGSQL.1921"
2019-06-25 17:33:52.204 CST [3206] LOG:  redirecting log output to logging collector process
2019-06-25 17:33:52.204 CST [3206] HINT:  Future log output will appear in directory "pg_log".
 done
server started
 类似资料: