#RELEASE_2_4_0.tar.gz下载下来就叫这名字 tar -zxf RELEASE_2_4_0.tar.gz cd rpy2-RELEASE_2_4_0 #此处不用参考网上教程,注释extern void Rf_PrintWarnings(void)等内容,那是rpy2 2.3及之前版本的问题,2.4版本已经修复,直接安装即可。 python setup.py build --r-home /usr/local/R3/lib64/R/ install
编译安装dbt5
编译安装
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#加载数据库环境变量 source ~/.bashrc #dbt5使用的cmake,需要事先安装 yum install cmake #下载dbt5源码 git clone https://github.com/osdldbt/dbt5 dbt5 #切换到dbt5目录 cd dbt5 #编译 cmake CMakeLists.txt -DDBMS=pgsql #安装dbt5,DESTDIR后指定安装路径:/opt/dbt-5,此处可能会报错,报错解决方法见下面注意部分 make install DESTDIR=/opt/dbt-5 #编译EGen cd dbt5/egen/prj make -f Makefile.pgsql #编译安装存储过程到数据库安装目录 cd dbt5/storedproc/pgsql/c make install
报错处理
注意:如果make install时报如下错误
1 2 3 4 5 6 7 8 9 10 11
[root@k8s4 dbt5]# make install [ 1%] Building CXX object CMakeFiles/bin/BrokerageHouseMain.dir/src/interfaces/TxnHarnessSendToMarket.o In file included from src/include/TxnHarnessSendToMarket.h:17:0, from /opt/dbt5/src/interfaces/TxnHarnessSendToMarket.cpp:11: src/include/CSocket.h: In member function ‘void CSocket::closeListenerSocket()’: src/include/CSocket.h:42:47: error: ‘close’ was not declared in this scope void closeListenerSocket() { close(m_listenfd); } ^ make[2]: *** [CMakeFiles/bin/BrokerageHouseMain.dir/src/interfaces/TxnHarnessSendToMarket.o] Error 1 make[1]: *** [CMakeFiles/bin/BrokerageHouseMain.dir/all] Error 2 make: *** [all] Error 2
#dbt5-pgsql-build-db帮助信息 [root@k8s4 bin]# dbt5-pgsql-build-db -h Usage: ./dbt5-pgsql-build-db [option] ./dbt5-pgsql-build-db -h Options: -b <integer> Beginning customer ordinal position 设置客户起始编号,默认从1开始 -c <integer> Number of customers for this instance 生成的测试数据中有多少个客户账号,默认5000 -d <dbname> PGDATABASE name 数据库名称 -h this help -i <path> Path to EGen EGen的路径,不指定使用环境变量中的设置 -l <port> database port 数据库端口 -p <database_parameters> PostgreSQL database parameters 指定数据库参数 -r Drop existing database before building a new database 创建新库时,如果已经存在,则删掉已存在的数据库 -s <scale fact (customers per 1 trtps) 比例因子,每个客户操作通过是1trtps,具体怎么调节还不明白,默认值500 -t <integer> Number of customers (total) 客户端数量 -u Use tablespaces 表示使用表空间,好像没啥用 -w <days> Initial trade days (business days) to populate 初始化多少天的交易数据,默认300天
#一个简单测试 [root@k8s4 bin]# dbt5-run-workload -a pgsql -c 1000 -t 1000 -d 120 -u 5 -f 1000 -w 100 -p 5457 -n dbt5 -h localhost -o ./results waiting for server to start.... done server started
************************************************************************ * DBT-5 test started * * * ************************************************************************ * * * Test consists of 4 stages: * * * * 1. Start of the Brokerage House server * * 2. Start of the Market Exchange server * * 3. Test (Start of the Customer Emulator) * * 4. Processing of results * * * ************************************************************************ Results can be found in: ./results
1. Starting Brokerage House server Sleeping 1 seconds
2. Starting Market Exchange server
3. Starting Customer driver: 5 user(s) 1 user starting every 1000 milliseconds... Results will be written to: ./results Sleeping 6 seconds Sleeping 120 seconds
4. Run Post processing analyses Killing Servers... waiting for server to shut down........ done server stopped >> Test completed. Results are in: ./results
结果查看,整体内容稍微有点复杂,可以只简单看倒数第三行,即:27.96 trade-result transactions per second (trtps),这里表示性能指标(tpsE, transactions per second E)和性价比(美元/tpsE),分值越大,性能越好。其他根据字面意思理解就好。