CentOS 操做系統下搭建tsung性能測試環境_Part 2html
--------------------接CentOS 操做系統下搭建tsung性能測試環境_Part 1---------------------
python
#如上,提示錯誤,解決方法:安裝perl-Test-Podlinux
[root@localhost otp_src_17.1]# yum install perl-Test-Podshell
#繼續安裝Template Toolkitbash
[root@localhost Template-Toolkit-2.25]# make test網絡
[root@localhost Template-Toolkit-2.25]# make installsocket
步驟5、#安裝perl的gnuplot分佈式
[root@localhost software]# tar -xvf gnuplot-4.0.0.tar.gz工具
[root@localhost software]# cd gnuplot-4.0.0性能
[root@localhost gnuplot-4.0.0]# ./configure --prefix=/usr/local/gnuplot
[root@localhost gnuplot-4.0.0]# make && make install
...
touch: missing file operand
Try `touch --help' for more information.
../mkinstalldirs /usr/local/gnuplot/info
mkdir -p -- /usr/local/gnuplot/info
/usr/bin/install -c -m 644 gnuplot.info /usr/local/gnuplot/info/gnuplot.info
/usr/bin/install: cannot stat `gnuplot.info': No such file or directory
make[1]: *** [install-info] Error 1
make[1]: Leaving directory `/root/software/gnuplot-4.0.0/docs'
make: *** [install-recursive] Error 1
#如上,提示錯誤,解決方法:安裝texinfo
[root@localhost otp_src_17.1]# yum install texinfo
#繼續安裝perl的gnuplot
[root@localhost gnuplot-4.0.0]# make && make install
步驟6、安裝mathplotlib
[root@localhost otp_src_17.1]# yum list | grep matplotlib
[root@localhost otp_src_17.1]# yum install python-matplotlib
#配置環境變量
[root@localhost otp_src_17.1]vi /etc/profile
[root@localhost otp_src_17.1]source /etc/profile
#驗證tsplot是否安裝成功
[root@localhost otp_src_17.1]# tsplot
Traceback (most recent call last):
File "/usr/local/tsung/bin/tsplot", line 45, in
from pylab import *
...
from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, FigureCanvasGTK,\
File "/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_gtk.py", line 11, in
raise ImportError("Gtk* backend requires pygtk to be installed.")
ImportError: Gtk* backend requires pygtk to be installed.
#如上,提示錯誤,解決方法:安裝pygtk
[root@localhost otp_src_17.1]# yum install pygtk2
#再次驗證tsplot是否安裝成功
[root@localhost gnuplot-4.0.0]# tsplot
Traceback (most recent call last):
File "/usr/local/tsung/bin/tsplot", line 45, in
from pylab import *
File "/usr/lib64/python2.6/site-packages/pylab.py", line 1, in
....
File "/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_gtk.py", line 8, in
import gtk; gdk = gtk.gdk
File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 64, in
_init()
File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 52, in _init
_gtk.init_check()
RuntimeError: could not open display
#如上,提示錯誤,緣由再遠tsplot只能在中斷terminal中運行,解決方法:安裝桌面
[root@localhost otp_src_17.1]# yum grouplist | grep X
Legacy UNIX compatibility
Legacy X Window System compatibility
TeX support
X Window System
Xhosa Support
[root@localhost otp_src_17.1]# yum groupinstall "X Window System"
#注意這裏還得再安裝Desktop,不然startx報錯
[root@localhost otp_src_17.1]# yum groupinstall Desktop
startx,桌面下使用,,見後文
步驟7、#關閉selinux(不關閉的話可能會話鏈接數等會被限制,上不去)
#查看selinux狀態
[root@localhost ~]# /usr/sbin/sestatus -v
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
……….
#關閉(修改/etc/selinux/config,將SELINUX=enforcing改成SELINUX=disabled)
[root@localhost ~]# vi /etc/selinux/config
...
#SELINUX=enforcing
#modified by laiyu
SELINUX = disabled
# SELINUXTYPE= can take one of these two values:
...
[root@localhost ~]# reboot
步驟8、#修改ulimit
說明:tsung.xml配置文件中,有個maxusers參數,用於突破由單一進程打開的socket最大數限制(缺省的,任意OS上爲1024)和select系統調用可擴展性的不足。當用戶數更限制更高時,將開啓新的erlang虛擬機來處理新用戶。默認的maxusers屬性值爲800.如今,有了內核輪詢的容許,能夠且應該爲maxusers使用一個更大的值,好比300000,且不會有性能損失。可是須要提搞os的limit值
[root@localhost ~]# ulimit –n
1024
[root@localhost ~]# vi /etc/security/limits.conf
...
#ftp hard nproc 0
#@student - maxlogins 4
#added by laiyu#添加如下兩行
* soft nofile 65535
* hard nofile 65535
# End of file
步驟9、#實現免SSH密碼登陸(用於分佈式集羣,可暫時不設置)
步驟10、#配置文件
#建立默認的配置文件目錄、日誌文件目錄
[root@localhost examples]# mkdir -p ~/.tsung/log
#設置報告生成工具的路徑(將日誌分析程序複製到tsung/bin下,方便使用)
[root@localhost ~]# find / -name tsung_stats.pl
/usr/local/tsung/lib/tsung/bin/tsung_stats.pl
/root/software/tsung-1.5.1/src/tsung_stats.pl
[root@localhost ~]# cp /usr/local/tsung/lib/tsung/bin/tsung_stats.pl /usr/local/tsung/bin/
#複製自帶的例子到配置文件目錄
[root@localhost examples]# cp -rp /usr/local/tsung/share/doc/tsung/examples ~/.tsung/
#拿註冊功能爲例進行測試,配置tsung.xml文件
[root@localhost .tsung]# cp examples/jabber_register.xml ~/.tsung/tsung.xml
步驟11、#啓動測試
[root@localhost ~]# tsung -f ~/.tsung/tsung.xml -l ~/.tsung/log/ start
Starting Tsung
"Log directory is: /root/.tsung/log/20140903-1531"
"Maximum number of concurrent users in a single VM reached and 'use_controller_vm' is true, can't start new beam !!! Check 'maxusers' value in configuration.~n"
^C
BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
(v)ersion (k)ill (D)b-tables (d)istribution
a
說明:
tsung –f 指定運行時使用的配置文件( 默認 ~/.tsung/tsung.xml)
tsung –l 指定日誌路徑( 默認~/.tsung/log/ )
#如上,報錯了,解決方法,修改配置文件,以下,打開配置文件,增長maxusers屬性
[root@localhost ~]# vi ~/.tsung/tsung.xml
修改以下
[root@localhost ~]# tsung -f ~/.tsung/tsung.xml -l ~/.tsung/log/ start
Starting Tsung
"Log directory is: /root/.tsung/log/20140903-1544"
。。。好了
步驟12、#生成測試報告
[root@localhost ~]# cd ~/.tsung/log/20140903-1544 #進入日誌文件目錄
[root@localhost 20140903-1544]# tsung_stats.pl
creating subdirectory data
creating subdirectory gnuplot_scripts
creating subdirectory images
warn, last interval (4) not equal to the first, use the first one (10)
No data for Bosh
No data for Perfs
No data for Transactions
No data for Match
No data for Event
No data for Async
No data for Size
size_rcv is equal to 0 !
size_sent is equal to 0 !
#注意,這裏沒數據...彷佛是由於公司網絡限制引發的
#獲取報告
[root@localhost 20140903-1544]# cd ..
[root@localhost log]# tar -cvf test.tar 20140903-1544
把test.tar下載到本地,解壓,而後打開html文件便可
日誌錯誤:Could not find/open font when opening font "arial"解決方法
問題描述
如圖,查看生成日誌文件gnuplot.log,發現有錯誤提示提示
Could not find/open font when opening font "arial", using internal non-scalable
解決方法
在linux中添加arial字體
widonws下載字體文件到Linux
步驟1、打開C:\WINDOWS\Fonts,找到Arial,右鍵,複製到指定文件夾下
步驟2、
[root@localhost ~]# mkdir/usr/share/fonts/arial
用相似xshell等工具,把剛纔複製的字體上傳到指定新建的arial目錄下。
步驟3、設置環境變量
[root@localhost ~]# vi ~/.bash_profile
以下,添加以下紅色的部分的字體
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export GDFONTPATH=/usr/share/fonts/arial
export GNUPLOT_DEFAULT_GDFONT="arial"
PATH=$PATH:$HOME/bin
export PATH
保存,而後執行source命令
[root@localhost ~]# source .bash_profile
#也能夠以下方式生成圖形
tsplot 「name」 log_path –d output_dir
#獲取圖形報告
[root@localhost log]# ls
20140903-1531 connected.png finish_tn.png page_count.png page_mean_tn.png request_mean.png size_rcv_tn.png test.tar
20140903-1541 connected_tn.png http.png page_count_tn.png request_count.png request_mean_tn.png size_sent.png users.png
20140903-1544 finish.png http_tn.png page_mean.png request_count_tn.png size_rcv.png size_sent_tn.png users_tn.png
[root@localhost log]# mkdir output
[root@localhost log]# mv *.png output
[root@localhost log]# tar -cvf output.tar output
下載output.tar,而後解壓,而後查看.png圖片
注意:更多關於文件配置的信息請訪問官網(若是有時間,我會繼續更新這方面的內容