percona server 二进制安装下编译tpcc-mysql的坑
出于习惯,percona server的部署都是通过二进制包自动化安装,结果遇到一个硕大无比的坑,编译TPCC-MySQL时出现警告
10:49:36 root@DB-Master:~/tpcc-mysql/src$ make
cc load.o support.o `mysql_config --libs_r` -lrt -L /usr/local/mysql/lib/ -o ../tpcc_load
/usr/bin/ld: warning: libssl.so.6, needed by /usr/local/mysql/lib//libperconaserverclient.so, may conflict with libssl.so.10
/usr/bin/ld: warning: libcrypto.so.6, needed by /usr/local/mysql/lib//libperconaserverclient.so, may conflict with libcrypto.so.10
cc -w -O2 -g -I. `mysql_config --include` -I /usr/local/mysql/include/ -c main.c
cc -w -O2 -g -I. `mysql_config --include` -I /usr/local/mysql/include/ -c spt_proc.c
cc -w -O2 -g -I. `mysql_config --include` -I /usr/local/mysql/include/ -c driver.c
cc -w -O2 -g -I. `mysql_config --include` -I /usr/local/mysql/include/ -c sequence.c
cc -w -O2 -g -I. `mysql_config --include` -I /usr/local/mysql/include/ -c rthist.c
cc -w -O2 -g -I. `mysql_config --include` -I /usr/local/mysql/include/ -c neword.c
cc -w -O2 -g -I. `mysql_config --include` -I /usr/local/mysql/include/ -c payment.c
cc -w -O2 -g -I. `mysql_config --include` -I /usr/local/mysql/include/ -c ordstat.c
cc -w -O2 -g -I. `mysql_config --include` -I /usr/local/mysql/include/ -c delivery.c
cc -w -O2 -g -I. `mysql_config --include` -I /usr/local/mysql/include/ -c slev.c
cc main.o spt_proc.o driver.o support.o sequence.o rthist.o neword.o payment.o ordstat.o delivery.o slev.o `mysql_config --libs_r` -lrt -L /usr/local/mysql/lib/ -o ../tpcc_start
/usr/bin/ld: warning: libssl.so.6, needed by /usr/local/mysql/lib//libperconaserverclient.so, may conflict with libssl.so.10
/usr/bin/ld: warning: libcrypto.so.6, needed by /usr/local/mysql/lib//libperconaserverclient.so, may conflict with libcrypto.so.10
无视警告的后果是能load仓库,但是在tpcc_start测试时报segement fault
tail /var/log/message 如下
Apr 23 10:52:03 DB-Master kernel: tpcc_start[31075]: segfault at 0 ip 00007f723392b345 sp 00007f722fba2130 error 6 in libperconaserverclient.so.18.1.0[7f72338c1000+29d000]
Apr 23 11:14:38 DB-Master kernel: tpcc_start[9636]: segfault at 0 ip 00007fd82f5ba345 sp 00007fd82b831130 error 6 in libperconaserverclient.so.18.1.0[7fd82f550000+29d000]
从官网下载Percona-Server-shared-56-5.6.23-rel72.1.el6.x86_64.rpm
安装完毕,把/usr/lib64/目录下libperconaserverclient.so.18.1.0 文件覆盖到$MYSQL_HOME/lib下
cp /usr/lib64/libperconaserverclient.so.18.1.0 /usr/local/mysql/lib/
重新编译成功!
另外在这个场景下还需要修改Makefile文件,制定对应的-I $MYSQL_HOME/include/ 和 -L $MYSQL_HOME/lib/