1.解压
unzip sysbench-1.0.zip
mv sysbench-1.0 /opt/
2.执行脚本
[root@localhost sysbench-1.0]# ./autogen.sh
3.编译
yum install automake
yum install libtool.x86_64
yum -y install postgresql-devel
./autogen.sh
./configure --prefix=/usr/local/pg/sysbencd_1.0 --without-mysql --with-pgsql
make
make install
pg测试
--测试postgresql
/usr/local/pg/sysbencd_1.0/bin/sysbench --test=/opt/sysbench-1.0/tests/include/oltp_legacy/oltp.lua --oltp-table-size=10000 --pgsql-host=127.0.0.1 --pgsql-port=5432 --pgsql-user=hxl --pgsql-password=postgres --pgsql-db=db_test --db-driver=pgsql prepare
/usr/local/pg/sysbencd_1.0/bin/sysbench --test=/opt/sysbench-1.0/tests/include/oltp_legacy/oltp.lua --max-requests=0 --max-time=60 --num-threads=16 --db-driver=pgsql --pgsql-host=127.0.0.1 --pgsql-port=5432 --pgsql-user=hxl --pgsql-password=postgres --pgsql-db=db_test --oltp-test-mode=simple --oltp-reconnect-mode=session run
/usr/local/pg/sysbencd_1.0/bin/sysbench --test=/opt/sysbench-1.0/tests/include/oltp_legacy/oltp.lua --db-driver=pgsql --pgsql-host=127.0.0.1 --pgsql-port=5432 --pgsql-user=postgres --pgsql-password=postgres --pgsql-db=db_test cleanup