How To Use SSL With sysbench To Test MySQL Server
erics, Posted September 7th, 2023 at 11:02:30am
SUMMARY
If sysbench is started with the “–mysql-ssl=on” option, it looks in the current directory for the following files:
1 2 3 |
client-cert.pem client-key.pem cacert.pem (note no dash) |
PROCEDURE
Locate the current MySQL database certificates, usually in /var/lib/mysql
, and make sure that the OS user running sysbench
is able to read the following 3 files:
1 2 3 |
ca.pem client-cert.pem client-key.pem |
Next, cd to the OS user’s home directory and create symbolic links as follows:
1 2 3 4 5 |
export DIR=/var/lib/mysql cd ln -s ${DIR}/ca.pem cacert.pem ln -s ${DIR}/client-cert.pem ln -s ${DIR}/client-key.pem |
Finally, create a simple wrapper to ensure proper location and adding --mysql-ssl=on
to sysbench
command, for example:
1 2 |
#!/bin/sh (cd; sysbench --mysql-ssl=on --mysql-debug=off --db-driver=mysql --mysql-user=app_user --mysql-password=secret --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-db=test --db-ps-mode=disable --range_size=100 --table_size=10000 --tables=2 --threads=$threads --events=0 --time=60 --rand-type=uniform /usr/share/sysbench/oltp_read_write.lua run) |
Leave Your Comment
All fields marked with "*" are required.