首页 > 代码库 > HP Vertica Analytics Platform 评测
HP Vertica Analytics Platform 评测
1.vertica概念
面向数据分析的数据仓库系统解决方案
2.vertica关键特性
? 标准的SQL接口:可以利用已有的BI、ETL、Hadoop/MapReduce和OLTP环境
? 高可用:内置的冗余也提升了查询速度
? 自动化数据库设计:数据库自动安装、优化、管理
? 高级压缩:十多种压缩算法最多可节省90%的空间
? 大规模并行处理:运行于低成本的x86型Linux节点上的原生DB感知集群
? 列式存储、混合模型:无磁盘I/O瓶颈,载入和查询同时进行
? 灵活部署:普通硬件、虚拟环境、云平台
3.vertica安装使用
使用社区版的vertica:免费、无功能和时间限制,最多允许1TB的数据、最多允许三个节点的集群。在A、B、C三台Linux服务器上(CentOS5系统)安装配置包含三个节点的可保证高可用的最基本的vertica cluster。
3.1安装
下载特定于平台的vertica安装包,这里下载的是
vertica-7.0.1-0.x86_64.RHEL5.rpm
创建专门用于vertica管理的用户和组
sudo groupadd verticaAdmin
sudo useradd -g verticaAdmin verticaAdmin
sudo passwd verticaAdmin
在其中一台主机,比如A主机先安装vertica
sudo rpm -ivh vertica-7.0.1-0.x86_64.RHEL5.rpm
安装完成后可在A主机运行/opt/vertica/sbin/install_vertica命令与其他主机搭建vertica cluster
sudo /opt/vertica/sbin/install_vertica –hosts B,C - -rpm /pathto/vertica-7.0.1-0.x86_64.RHEL5.rpm--dba-user verticaAdmin --dba-group verticaAdmin --dba-user-password password--dba-user-home /home/ verticaAdmin --data-dir /data/vertica
3.2几个问题
首先要保证root用户可以通过SSH登录到集群内的所有主机
另外应允许vertica管理员用户,例如上述步骤创建的verticaAdmin,无密码SSH至集群内其他主机(该步骤会在安装过程中自动进行(之所以要保证root用户能SSH到集群内所有主机正是为了此目的),我们只需保证系统设置允许无密码登录即可)
vertica对I/O调度策略、vertica管理员用户的时区设置、磁盘Readahead的值、文件系统、CPU主频扩展策略等方面有特殊要求。如果你不确定你的系统是否符合这些要求也没关系,只要运行一下上述配置cluster的命令便会自动检测并给出提示,只需按提示一步步解决掉问题重新就可以了。
3.3此次安装过程遇到的问题及解决办法
(涉及的文件名、路径、磁盘名称等视你的具体情况而定)
设置I/O调度策略:
sudo sh -c ‘echo deadline >/sys/block/sda/queue/scheduler‘
并将echo deadline > /sys/block/sda/queue/scheduler写进/etc/rc.local
更新tzdata包,设置时区:
sudo yum update tzdata
在 .profile 或.bashrc /etc/profile中添加export TZ="Asia/Shanghai"
安装pstack、mcelog、sysstat:
yum install pstack
yum install mcelog
yum install sysstat
设置Readahead
sudo blockdev --setra 2048 /dev/sda
sudo blockdev --setra 2048/dev/mapper/VolGroup00-LogVol00
并将命令写进/etc/rc.local
查看和设置CPU频率扩展:
sudo yum install cpufreq-utils
cpufreq-info
sudo cpufreq-set -c CPU序号1,CPU序号2,…… -g performance
配置/etc/ssh/sshd_config中PermitRootLogin为yes并重启(一定要重启)sshd服务:
sudo vim /etc/ssh/sshd_config
/etc/init.d/sshd restart
安装成功后便可以用admintools来管理vertica了,可以使用admintools命令行模式也可以使用图形界面模式。也可以使用vsql客户端来连接、查询数据库。若想卸载vertica也很简单,逐台服务器运行sudo rpm -e vertica-7.0.1-0即可。
3.4一些基本命令:
? admintools: 运行图形界面,根据界面上的内容和提示进行操作。
? admintools –help: 显示可用的命令
? admintools –help_all: 显示更详尽的可用命令帮助
? admintools –t +具体可用的命名: 使用特定的命令
? vsql:连接到vertica
? vsql db:连接到具体数据库
? 使用vsql创建好连接至vertica的回话后\h用户显示帮助。
4.vertica评测
4.1单节点模式下测试环境准备
数据库、schema、table
最初只启用了一个节点A(也即没有搭建cluster),使用admintools在该节点创建不使用密码的数据库 testVertica,使用vsql连接至testVertica数据库,在public这个schema下创建表trace_htlorder、sbtest。
CREATE TABLE trace_htlorder (
TextDataLONG VARCHAR,
TransactionID bigint DEFAULT NULL,
HostNamevarchar(256) DEFAULT NULL,
ApplicationName varchar(256) DEFAULT NULL,
LoginNamevarchar(256) DEFAULT NULL,
SPID intDEFAULT NULL,
Durationbigint DEFAULT NULL,
StartTimedatetime DEFAULT NULL,
EndTimedatetime DEFAULT NULL,
Readsbigint DEFAULT NULL,
Writesbigint DEFAULT NULL,
CPU intDEFAULT NULL,
Successint DEFAULT NULL,
ServerName varchar(256) DEFAULT NULL,
EventClass int DEFAULT NULL,
Error intDEFAULT NULL,
ObjectName char(256) DEFAULT NULL,
DatabaseName varchar(256) DEFAULT NULL,
DBUserName varchar(256) DEFAULT NULL,
RowCountsbigint DEFAULT NULL,
XactSequence bigint DEFAULT NULL,
hashcodebigint DEFAULT NULL,
filtertinyint DEFAULT NULL
)
CREATE TABLE sbtest (
idint NOT NULL,
kint NOT NULL DEFAULT ‘0‘,
cchar(120) NOT NULL DEFAULT ‘‘,
padchar(60) NOT NULL DEFAULT ‘‘,
PRIMARYKEY (id)
);
注意:vertica不支持vertica不支持MySQL中的``、int(N)、comment、text类型、unsigned、AUTO_INCREMENT、KEY k(k)
两个测试文本:
sbtest.txt-17G-包含如下格式的数据2亿行(数据来自于sysbench自动创建)
1*2000*"aaaaaaaaaaabbbbbbbbbbccccccccccdddddddddd"*"ddddddddddccccccccccbbbbbbbbbbaaaaaaaaaa"
trace_order_less.txt-20G-包含如下格式的数据3千万行(数据来自与真实的生产环境)
"SELECT costrate FROM FltOrderDB..O_Flight(nolock) WHERE OrderID=1030812255"*0*"VMS01760"*".NetSqlClient DataProvider"*"uws_W_AppleOrder"*172*0*"2014-05-1500:00:00"*"2014-05-1500:00:00"*4*0*0*0*""*0*0*""*"FltOrderDB"*""*1*0*3384460570715180659*1
4.2 单节点vertica与infobright数据载入测试
单点的社区版vertica
copy public.sbtest from ‘/tmp/sbtest.txt‘DELIMITER ‘*‘ ENCLOSED BY ‘"‘DIRECT;
Time: First fetch (1 row): 438790.789 ms. Allrows formatted: 438790.838 ms
数据被压缩为3.8G
copy public.trace_htlorder from‘/data/tmp/trace_order_less.txt‘ DELIMITER ‘*‘ ENCLOSED BY ‘"‘ DIRECT;
Time: First fetch (1 row): 3926331.365 ms. All rowsformatted: 3926331.419 ms
数据被压缩为1.4G
数据载入过程中vertica会使用到比原始数据文件大得多的磁盘空间, 20G的数据文件LOAD过程中最多的时候会占用到40G的空间
copy 命令三个参数
? AUTO 将数据载入WOS,WOS满后直接载入到ROS。适用于<100MB的文件
? DIRECT 将数据直接载入到ROS。适用于100MB以上的数据
? TRICKLE 适用于增量式的批量插入数据,直接把数据载入到WOS,WOS满后报错,整个载入过程回滚。
社区版infobright
创建数据库和表
create database testInfobright;
use testInfobright;
CREATE TABLE `trace_htlorder` (
`TextData` text,
`TransactionID` bigint(20) DEFAULT NULL,
`HostName` varchar(256) DEFAULT NULL COMMENT ‘lookup‘,
`ApplicationName` varchar(256) DEFAULT NULL,
`LoginName` varchar(256) DEFAULT NULL COMMENT ‘lookup‘,
`SPID`int(11) DEFAULT NULL,
`Duration` bigint(20) DEFAULT NULL,
`StartTime` datetime DEFAULT NULL,
`EndTime`datetime DEFAULT NULL,
`Reads`bigint(20) DEFAULT NULL,
`Writes`bigint(20) DEFAULT NULL,
`CPU`int(11) DEFAULT NULL,
`Success`int(11) DEFAULT NULL,
`ServerName` varchar(256) DEFAULT NULL COMMENT ‘lookup‘,
`EventClass` int(11) DEFAULT NULL,
`Error`int(11) DEFAULT NULL,
`ObjectName` varchar(256) DEFAULT NULL COMMENT ‘lookup‘,
`DatabaseName` varchar(256) DEFAULT NULL COMMENT ‘lookup‘,
`DBUserName` varchar(256) DEFAULT NULL,
`RowCounts` bigint(20) DEFAULT NULL,
`XactSequence` bigint(20) DEFAULT NULL,
`hashcode`bigint(20) DEFAULT NULL,
`filter`tinyint(4) DEFAULT NULL
) ENGINE=BRIGHTHOUSE DEFAULT CHARSET=utf8
CREATE TABLE `sbtest` (
`id`bigint(10) NOT NULL,
`k`int(10) NOT NULL DEFAULT ‘0‘,
`c`char(120) NOT NULL DEFAULT ‘‘,
`pad`char(60) NOT NULL DEFAULT ‘‘
)
同样的两个数据文件sbtest.txt、trace_order_less.txt
load data infile ‘/data/tmp/sbtest.txt‘ intotable testInfobright.sbtest FIELDS TERMINATED BY ‘*‘ OPTIONALLY ENCLOSED BY‘"‘ ;
Query OK, 200000000 rows affected (40 min 38.89sec)
数据被压缩为2.8G
load data infile ‘/data/tmp/trace_order_less.txt‘into table testInfobright.trace_htlorder FIELDS TERMINATED BY ‘*‘ OPTIONALLYENCLOSED BY ‘"‘ ;
Query OK, 30000000 rows affected (11 min 13.68sec)
数据被压缩为0.45G
结论:
| Infobright | Vertica | Infobright | Vertica |
导入文件类型 | sysbench压测工具生成的格式化数据,每行的文本内容具有基本相同的长度和内容 | 生产环境DB实际产生的trace信息,包含各种不同的调用语句,文本长度和内容都各异 | ||
原始文件大小(GB) | 17 | 20 | ||
导入后大小(GB) | 2.8 | 3.8 | 0.45 | 1.4 |
压缩比 | 83% | 77% | 97% | 93% |
导入时间(sec) | 2440 | 438 | 673 | 3926 |
导入速度(MB/sec) | 7.13 | 39.74 | 30.43 | 5.21 |
4.3单点的vertica与infobright数据查询测试
trace_htlorder表6千万行数据
#常用查询 WHERE BETWEEN AND LIKE ORDER BY
sql01 = "SELECTTextData,StartTime,EndTime,DatabaseName,ObjectName,HostName,ApplicationName,LoginName,Duration,Reads,Writes,CPU,RowCounts,Error,HashCodeFROM trace_htlorder WHERE StartTime >= ‘2014-05-15 00:00:00 ‘ AND StartTime< ‘2014-05-15 02:00:00 ‘ AND TextData LIKE ‘%GROUP BY%‘ ORDER BY StartTime"
total: 457.178461075
total: 2516.28422379
#常用查询 WHERE BETWEEN AND LIKE GROUP BY
sql02 = "SELECTTextData,StartTime,EndTime,DatabaseName ,ObjectName,HostName,ApplicationName,LoginName,Duration,Reads,Writes,CPU,RowCounts,Error,HashCodeFROM trace_htlorder WHERE StartTime >= ‘2014-05-15 00:00:00 ‘ AND StartTime< ‘2014-05-15 02:00:00 ‘ AND TextData LIKE ‘%GROUP BY%‘ GROUP BY TextData,StartTime,EndTime,DatabaseName,ObjectName,HostName,ApplicationName,LoginName,Duration,Reads,Writes,CPU,RowCounts,Error,HashCode"
total: 278.15408802
total: 3426.65513086
#全字段,无条件 一千万行
sql03 = "SELECT TextData,TransactionID,HostName ,ApplicationName,LoginName,SPID,Duration,StartTime,EndTime,Reads,Writes,CPU ,Success,ServerName,EventClass,Error,ObjectName,DatabaseName,DBUserName,RowCoun
ts,XactSequence,hashcode,filter FROMtrace_htlorder limit 100000"
total: 60.5239160061
total: 26.4451019764
#个别字段,无条件 一千万行
sql04= "SELECT HostName,ApplicationName,ServerName,DatabaseName,DBUserName FROM trace_htlorder limit100000"
total: 3.23667478561
total: 3.97934985161
#全字段,WHERE BETWEEN AND LIKE GROUP BY
sql05 = "SELECT TextData,TransactionID,HostName ,ApplicationName,LoginName,SPID,Duration,StartTime,EndTime,Reads,Writes,CPU ,Success,ServerName,EventClass,Error,ObjectName,DatabaseName,DBUserName,RowCoun
ts,XactSequence,hashcode,filter FROMtrace_htlorder WHERE StartTime >= ‘2014-05-15 00:00:00 ‘ AND StartTime <‘2014-05-15 02:00:00 ‘ AND TextData LIKE ‘%GRUOP BY%‘ GROUP BY TextData,TransactionID ,HostName
,ApplicationName,LoginName,SPID,Duration,StartTime,EndTime,Reads,Writes,CPU ,Success,ServerName,EventClass,Error,ObjectName,DatabaseName,DBUserName,RowCounts,XactSequence,hashcode,filter"
total: 58.3177318573
total: 1042.12857699
#个别字段,WHERE BETWEEN AND LIKE GROUP BY
sql06 = "SELECT HostName,ApplicationName,ServerName,DatabaseName,DBUserName FROM trace_htlorder WHEREStartTime >= ‘2014-05-15 00:00:00 ‘ AND StartTime < ‘2014-05-15 02:00:00‘ AND TextData LIKE ‘%GRUOP BY%‘ GROUPBY HostName ,ApplicationName,ServerName,DatabaseName,DBUserName"
total: 53.3943109512
total: 987.122587919
#全字段,WHERE BETWEEN AND LIKE ORDER BY 分别按不同字段排序DESC/ASC
sql07 = "SELECT TextData,TransactionID,HostName,ApplicationName,LoginName,SPID,Duration,StartTime,EndTime,Reads,Writes ,CPU,Success,ServerName,EventClass,Error,ObjectName,DatabaseName,DBUserName,RowCoun
ts,XactSequence,hashcode,filter FROMtrace_htlorder WHERE StartTime >= ‘2014-05-15 00:00:00 ‘ AND StartTime <‘2014-05-15 02:00:00 ‘ AND TextData LIKE ‘%GRUOP BY%‘ ORDER BY Duration DESC"
total: 39.8180880547
total: 984.204402924
sql08 = "SELECT TextData,TransactionID,HostName ,ApplicationName,LoginName,SPID,Duration,StartTime,EndTime,Reads,Writes,CPU ,Success,ServerName,EventClass,Error,ObjectName,DatabaseName,DBUserName,RowCoun
ts,XactSequence,hashcode,filter FROMtrace_htlorder WHERE StartTime >= ‘2014-05-15 00:00:00 ‘ AND StartTime <‘2014-05-15 02:00:00 ‘ AND TextData LIKE ‘%GRUOP BY%‘ ORDER BY Duration ASC"
total: 40.1778831482
total: 984.4428339
sql09 = "SELECT TextData,TransactionID,HostName,ApplicationName,LoginName,SPID,Duration,StartTime,EndTime,Reads,Writes ,CPU,Success,ServerName,EventClass,Error,ObjectName, DatabaseName,DBUserName,RowCoun
ts,XactSequence,hashcode,filter FROMtrace_htlorder WHERE StartTime >= ‘2014-05-15 00:00:00 ‘ AND StartTime <‘2014-05-15 02:00:00 ‘ AND TextData LIKE ‘%GRUOP BY%‘ ORDER BY SPID DESC"
total: 39.5487890244
total: 984.184374094
sql10 = "SELECT TextData,TransactionID,HostName,ApplicationName,LoginName,SPID,Duration,StartTime,EndTime,Reads,Writes ,CPU,Success,ServerName,EventClass,Error,ObjectName,DatabaseName,DBUserName,RowCoun
ts,XactSequence,hashcode,filter FROM trace_htlorderWHERE StartTime >= ‘2014-05-15 00:00:00 ‘ AND StartTime < ‘2014-05-1502:00:00 ‘ AND TextData LIKE ‘%GRUOP BY%‘ ORDER BY SPID ASC"
total: 39.7879989147
total: 984.206639051
#个别字段,WHERE BETWEEN AND LIKE ORDER BY 分别按不同字段排序DESC/ASC
sql11 = "SELECTHostName,ApplicationName,ServerName,DatabaseName,DBUserName FROM trace_htlorderWHERE StartTime >= ‘2014-05-15 00:00:00 ‘ AND StartTime < ‘2014-05-1502:00:00 ‘ AND TextData LIKE ‘%GRUOP BY%‘ ORDER BY Duration DESC;"
total: 48.5239658356
total: 990.392697096
sql12 = "SELECT HostName,ApplicationName,ServerName,DatabaseName,DBUserName FROM trace_htlorder WHEREStartTime >= ‘2014-05-15 00:00:00 ‘ AND StartTime < ‘2014-05-15 02:00:00‘ AND TextData LIKE ‘%GRUOP BY%‘ ORDERBY Duration ASC"
total: 48.5928411484
total: 990.359231949
sql13 = "SELECT HostName,ApplicationName,ServerName,DatabaseName,DBUserName FROM trace_htlorder WHEREStartTime >= ‘2014-05-15 00:00:00 ‘ AND StartTime < ‘2014-05-15 02:00:00‘ AND TextData LIKE ‘%GRUOP BY%‘ ORDERBY SPID DESC"
total: 48.5275650024
total: 990.474725962
sql14 = "SELECT HostName,ApplicationName,ServerName,DatabaseName,DBUserName FROM trace_htlorder WHEREStartTime >= ‘2014-05-15 00:00:00 ‘ AND StartTime < ‘2014-05-15 02:00:00‘ AND TextData LIKE ‘%GRUOP BY%‘ ORDERBY SPID ASC"
total: 48.8557629585
total: 990.433614969
total为无间断连续运行十次的总时间,上边为vertica的值,下边为infobright的值
14条语句各运行十遍的总时间:
vertica:1264.63847303
infobright:15901.3139489
结论
对于包含like、groupby、order by等条件的数据 ,vertica查询速度明显快于infobright。最快可达20倍以上。对于没有查询条件的语句两者相当,查询列为全部字段时vertica劣于infobright。查询列为部分字段时vertica略优于infobright。
注意事项
vertica中 longvarchar 不支持 LIKE操作,只有char,varchar,binary,varbinary支持,所以需先将原long varchar改为varchar
alter table trace_htlorder alter column TextDataset data type varchar(65000);
infobright SQL 中不能包含关键字 如 database,host,writes,reads等,关键字需用反引号括起来,若是在linux shell里直接以命令方式执行还需对反引号转义,否则会被解析为命令。
4.4测试包含三个节点的verticacluster(k-safety设置为1)导入数据
查看cluster状态
dmintools -t view_cluster
DB | Host | State
-------------+------+-------
testVertica | ALL | UP
查看cluster中的节点
admintools -t list_allnodes;
Node | Host | State | Version | DB
------------------------+---------------+-------+-------------------+-------------
v_testvertica_node0001 | 192.X.X.A | UP | vertica-7.0.1.000 | testVertica
v_testvertica_node0003 | 192.X.X.B | UP | vertica-7.0.1.000 | testVertica
v_testvertica_node0004 | 192.X.X.C | UP | vertica-7.0.1.000 | testVertica
测试用的数据库表
databases:testVertica
schema:public
table:sbtest、trace_htlorder
测试只在v_testvertica_node0001节点导入数据后的数据分布情况
数据:sbtest.txt -17G-2亿行
copy public.sbtest from ‘/data/tmp/sbtest.txt‘ onv_testvertica_node0001 DELIMITER‘*‘ ENCLOSED BY ‘"‘ DIRECT;
Time: First fetch (1 row): 233226.446 ms. Allrows formatted: 233226.528 ms
原来单节点时时间的一般左右,数据被压缩后各节点上大约有2.5G总共2.5*3=7.5G刚好是原来3.8G的两倍左右,证明vertica在cluster内存储了两个副本以保证值为1的k-safety
数据:trace_order_less.txt -20G-3千万行
copy public.trace_htlorder from ‘/data/tmp/trace_order_less.txt‘on v_testvertica_node0001 DELIMITER‘*‘ ENCLOSED BY ‘"‘ DIRECT;
Time: First fetch (1 row): 1927267.476 ms. Allrows formatted: 1927267.623 ms
原来单节点时时间的一般左右,数据被压缩后各节点上大约有1G总共1*3=3G刚好是原来1.4G的两倍左右,证明vertica在cluster内存储了两个副本以保证值为1的k-safety
测试在v_testvertica_node0001、 v_testvertica_node0003、 v_testvertica_node0004多节点并行导入
数据:sbtest.txt -17G-2亿行,分别存在于A、B、C三个节点中
copy public.sbtest from ‘/data/tmp/sbtest.txt‘ onv_testvertica_node0001,‘/tmp/sbtest.txt‘ on v_testvertica_node0003,‘/tmp/sbtest.txt‘on v_testvertica_node0004 DELIMITER ‘*‘ ENCLOSED BY ‘"‘ DIRECT;
Time: First fetch (1 row): 364039.015 ms. Allrows formatted: 364039.062 ms
6亿行数据被导入cluster用时6.3分钟
数据:trace_order_less.txt -20G-3千万行,别存在于A、B、C三个节点中
copy public.trace_htlorder from‘/data/tmp/trace_order_less.txt‘ onv_testvertica_node0001,‘/tmp/trace_order_less.txt‘ onv_testvertica_node0003,‘/tmp/trace_order_less.txt‘ on v_testvertica_node0004DELIMITER ‘*‘ ENCLOSED BY ‘"‘DIRECT;
Time: First fetch (1 row): 6336117.459 ms. Allrows formatted: 6336117.554 ms
9千万行数据被导入cluster用时105分钟
vertica cluster故障恢复测试
先检查数据
select count(*) from sbtest;
select count(*) from trace_htlorder;
查看cluster状态
dmintools -t view_cluster
DB | Host | State
-------------+------+-------
testVertica | ALL | UP
关闭B上的vertica,并查看状态
admintools -t stop_node -s 192.X.X.B
admintools -t view_cluster
DB | Host | State
-------------+---------------+-------
testVertica | 192.X.X.A | UP
testVertica| 192.X.X.B | DOWN
testVertica | 192.X.X.C | UP
重新检查数据发现数据并未丢失,还是原来的数目
select count(*) from sbtest;
select count(*) from trace_htlorder;
重启B上的vertica,并查看状态
admintools -t restart_node -d testVertica -s 192.X.X.B
admintools -t view_cluster
DB | Host | State
-------------+------+-------
testVertica | ALL | UP
整个集群恢复原状
逐次关闭B、C上的vertica,并查看状态
admintools -t stop_node -s 192.X.X.B
admintools -t stop_node -s 192.X.X.C
admintools -t view_cluster
DB | Host | State
-------------+------+-------
testVertica | ALL | DOWN
发现我们虽然只关闭了两个节点,还有一个节点没有手工关闭,但vertica已经非常智能的关闭了整个cluster,因为这时一个node已经不能保证高可用了,该node一旦异常down掉数据便会损失,所以vertica干脆关掉整个cluster。
重启整个cluster
admintools –t start_db –d testVertica
参考:
https://my.vertica.com/docs/7.0.x/HTML/index.htm
https://www.infobright.com/
http://ftp.gnu.org/gnu/time/
附件:
vertica的python连接器:vertica-python-0.2.0的安装
require:Python2.7、zlib-devel、openssl-devel、pytz、python-dateutil、pip、psycopg2
python-dateutil
require:six
psycopg2
require: postgresql-devel
yum install zlib-devel
yum install openssl-devel
yum install postgresql-devel
cd Python2.7->./configure --with-zlib ->make -> sudo make install
cd pytz ->sudo python2.7 setup.py install
cd six ->sudo python2.7 setup.py install
cd python-dateutil ->sudo python2.7 setup.pyinstall
cd pip ->sudo python2.7 setup.py install
cd psycopg ->sudo python2.7 setup.py install
cdvertica-python ->sudo python2.7 setup.py install#encoding:utf-8
使用SQL命令运行DBD(DatabaseDesigner)
selectDESIGNER_CREATE_DESIGN(‘testVerticaDesigner‘);
select DESIGNER_SET_DESIGN_KSAFETY(‘testVerticaDesigner‘,1);
SELECTDESIGNER_SET_OPTIMIZATION_OBJECTIVE(‘testVerticaDesigner‘,‘QUERY‘);
SELECTDESIGNER_SET_DESIGN_TYPE(‘testVerticaDesigner‘,‘INCREMENTAL‘);
SELECTDESIGNER_ADD_DESIGN_QUERIES(‘testVerticaDesigner‘,‘/home/op1/testVertia/querys.sql‘,‘true‘);
SELECTDESIGNER_ADD_DESIGN_TABLES(‘testVerticaDesigner‘,‘public.trace_htlorder‘,‘true‘);
SELECTDESIGNER_RUN_POPULATE_DESIGN_AND_DEPLOY(‘testVerticaDesigner‘,‘/home/op1/testVertia/vertica_design_files/vertica_design_DDL‘,‘/home/op1/testVertia/vertica_design_files/vertica_design_deployment_scripts‘);
SELECTDESIGNER_WAIT_FOR_DESIGN(‘testVerticaDesigner‘);
SELECTDESIGNER_OUTPUT_ALL_DESIGN_PROJECTIONS(‘testVerticaDesigner‘);
SELECTDESIGNER_OUTPUT_DEPLOYMENT_SCRIPT(‘testVerticaDesigner‘)
SELECTDESIGNER_CANCEL_POPULATE_DESIGN(‘testVerticaDesigner‘)
SELECTDESIGNER_DROP_DESIGN(‘testVerticaDesigner‘)