基于PostgreSQL的流式计算数据库PipelineDB--安装

浏览: 3981

PipelineDB是基于PostgreSQL的一个流式计算数据库,

看一下官方文档的定义:

PipelineDB is built to run SQL queries continuously on streaming data. The output of these continuous queries is stored in regular tables which can be queried like any other table or view. Thus continuous queries can be thought of as very high-throughput, incrementally updated materialized views. As with any data processing system, PipelineDB is built to shine under particular workloads, and simply not intended for others.

我的理解就是row base 的trigger,数据可以不停的增量更新,而不用批量去跑。而且传统的流处理都需要写程序,PipelineDB的方便之处是流的处理可以使用SQL语句,这个对我这种传统的BI人员很方便。

更多的具体示例可以看看德哥的介绍:

用PostgreSQL支持含有更新,删除,插入的实时流式计算


今天先介绍一下具体的安装准备工作:

操作系统准备:

CentOS 7.1  with basic development

关闭防火墙,使用seng的用户安装。

需要增加seng用户的sudo权限。

pipelinedb安装:

程序地址:https://github.com/pipelinedb/pipelinedb/releases

安装介绍:http://docs.pipelinedb.com/installation.html

安装命令:

mkdir /postgre/pipelinedb/v096/ 
cd /postgre/installfiles
sudo rpm -ivh --prefix=/postgre/pipelinedb/v096/ pipelinedb-0.9.6-centos7-x86_64.rpm


数据库初始化:

mkdir /postgre/pipelinedb/v096/testpipe
mkdir /postgre/pipelinedb/v096/logs/testpipe/
pipeline-init -D /postgre/pipelinedb/v096/testpipe


启动/关闭命令:

pipeline-ctl -D /postgre/pipelinedb/v096/testpipe -l /postgre/pipelinedb/v096/logs/testpipe/pipelinedb.log start

pipeline-ctl -D /postgre/pipelinedb/v096/testpipe  stop

修改配置:

由于需要远程访问,测试也不需要太多权限控制

修改pg_hba.conf

加一行

host    all             all             ip(如192.168.1.1)/24           password

host    all             all             10.8.29.1/24           password

修改pipelinedb.conf

#listen_addresses = 'localhost'        # what IP address(es) to listen on;

listen_addresses = '*'  

访问pipeline :

就是普通的postgre 的数据库,但是提供了一个pipeline的简化命令。

pipeline pipeline

psql -p 5432 -h localhost pipeline

通过\l命令可以看到就是一个pg的数据库^-^

创建测试用户:

CREATE USER pgtest PASSWORD 'abc123' ;

alter role pgtest superuser;


PS.

今年继续看<白说>,看了道德经和新闻标题2段,都很有感触。里面谈了一下新闻如何讲故事,这个对所有人都适用啊,是人的基本技能。这句话叶恒有意思,细节才会感动人。

还在听猫腻<择天记>,喜马拉雅上有姜维说的,说得不错。猫腻大大的书整个架构偏向于黑暗的,但是具体的故事还是很正的。这几天听到周园那段,细节写的不错。

推荐 3
本文由 seng 创作,采用 知识共享署名-相同方式共享 3.0 中国大陆许可协议 进行许可。
转载、引用前需联系作者,并署名作者且注明文章出处。
本站文章版权归原作者及原出处所有 。内容为作者个人观点, 并不代表本站赞同其观点和对其真实性负责。本站是一个个人学习交流的平台,并不用于任何商业目的,如果有任何问题,请及时联系我们,我们将根据著作权人的要求,立即更正或者删除有关内容。本站拥有对此声明的最终解释权。

2 个评论

PostgreSQL 这个数据库目前用的好像不多。
是啊,不过MySQl不适合olap应用,也不一定适合企业应用。很多面向分析的数据库很多都是在Postgre上修改的,如greenplum。
具体的案例,平安好像把PG用到他们业务系统上了,日本用PG做业务系统的很多。

要回复文章请先登录注册