安裝
https://launchpad.net/sysbench
trunk的版本是 0.4
虛擬機為ubuntu 14.04,檢查apt-get可以安裝的sysbench版本
# apt-cache madison sysbench
sysbench | 0.4.12-1.1 | http://tw.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
或由 http://tw.archive.ubuntu.com/ubuntu/pool/universe/s/sysbench/ 得知我設的倉庫只提供到sysbench 0.4.12
Universe - Community-maintained, i.e. not officially supported software.
universe是社群維護的套件. 如:非官方支援的軟體
註:CentOS 7 用yum裝的可以直接裝0.5
# yum info sysbench
...
Version : 0.5
在網上的一些範例中,sysbench的 --test會設為 /usr/share/doc/sysbench/tests/db/select.lua ,但是我的 /usr/share/doc/sysbench/ 下沒有tests/db/select.lua
原因,我用apt-get安裝了 0.4.12版,在 github上
https://github.com/akopytov/sysbench/tree/0.4/sysbench/tests
0.4版本沒有db 資料夾
https://github.com/akopytov/sysbench/tree/0.5/sysbench/tests/db
0.5版本有db資料夾
安裝 0.4.12 版
# apt-get install sysbench
移除 0.4.12 版
# aptitude purge sysbench
安裝 0.5版
# cd ~# git clone https://github.com/akopytov/sysbench.git
# cd sysbench/
這時候如果想直接安裝,通常會失敗
# ./autogen.sh
automake 1.10.x (aclocal) wasn't found, exiting
1. 先安裝一些相依套件
# apt-get install -y gcc autoconf automake make libtool libssl-dev libcrypto++9
2. 安裝mysql_config(在 Percona repository 中可用)
安裝 Percona apt repository
# wget https://repo.percona.com/apt/percona-release_0.1-3.$(lsb_release -sc)_all.deb安裝percona庫
# dpkg -i percona-release_0.1-3.$(lsb_release -sc)_all.deb
檢查 /etc/apt/sources.list.d/percona-release.list ,有多這隻檔案代表安裝成功
記得更新本地緩存
# apt-get update
最後安裝mysql_config
# apt-get install -y libperconaserverclient18-dev
3. 編譯和安裝sysbench
# ./autogen.sh
# ./configure
# make
安裝
# make install
4. 產生LUA資料夾(當初就是因為0.4版本沒有這個,直接拿0.5的LUA跑0.4的sysbench怕有問題,才手動編譯安裝)
# mkdir /usr/share/sysbench/tests/db -p
# cp sysbench/tests/db/* /usr/share/sysbench/tests/db
5. 檢查sysbench 0.5是否安裝成功
# sysbench --version
sysbench 0.5
移除sysbench
先看 Makefile 怎麼寫的,有看到 uninstall: uninstall-recursive ,所以嘗試移除sysbench
# make uninstall
檢查... 移除成功
# sysbench --version
-su: /usr/local/bin/sysbench: No such file or directory
vim /usr/local/bin/sysbench 是二進位檔,應該是c寫的,或用 file /usr/local/bin/sysbench去看,有些會告訴你那是什麼檔案。ex. python, shell... etc.
Benchmark
測試的benchmark是:你每次調試my.cnf後,重啟mysql,然後用sysbench測,看qps參考資料:
http://askubuntu.com/questions/447/how-can-i-see-all-versions-of-a-package-that-are-available-in-the-archive How can I see all versions of a package that are available in the archive?
http://blog.secaserver.com/2014/07/sysbench-0-5-ubuntu-14-04-trusty-percona-server-xtradb-cluster/ SYSBENCH 0.5 + UBUNTU 14.04 (TRUSTY) + PERCONA SERVER OR XTRADB CLUSTER
https://www.percona.com/doc/percona-server/5.5/installation/apt_repo.html Installing Percona Server on Debian and Ubuntu
Rellik
沒有留言:
張貼留言