pipelineDB安装
1 apt方式安装
pipelineDB在ubuntu16.04下的安装步骤, 具体见pipelineDB官方文档
安装pg和扩展
```shell
curl -s http://download.pipelinedb.com/apt.sh | sudo bash
sudo apt-get install pipelinedb-postgresql-11
```
修改配置
vim /etc/postgresql/11/main/postgresql.conf
# 在文件末尾添加如下配置
listen_addresses='*' # 开放连接
shared_preload_libraries = 'pipelinedb' # 载入插件
max_worker_processes = 128 # 调大工作线程数, 充分利用多核性能
pipelinedb.matrels_writable = true # 设置pipelineDB的物化视图为可删除
pipelinedb.stream_insert_level = async # 设置为异步插入
pipelinedb.ttl_expiration_batch_size = 0 # 默认只能删除10000条过期数据, 在此改为无限大
pipelinedb.ttl_expiration_threshold = 0 # 设置数据超过ttl后立马被删除, 否则delay为周期的5%
解除数据库自身网络连接限制, 在运维层面进行配置
vim /etc/postgresql/11/main/pg_hba.conf
# IPv4 local connections:
#host all all 127.0.0.1/32 trust
host all all 0.0.0.0/0 md5
重启postgres
service postgresql restart
创建扩展
sudo -u postgres -i psql -c "CREATE EXTENSION pipelinedb"
2 docker方式安装
docker run -d -p 5432:5432 --rm --name pipelinedb pipelinedb/pipelinedb-postgresql-11