CentOS7.6 Tsung1.7安裝與配置,Erlang 22.0安裝與配置

安裝軟件:
erlang(運行tsung需要的必備環境)
perl5 (生成報表的腳本支持環境)
gnuplot (報表統計圖片生成工具)
tsung
Template(perl需要安裝Template擴展)
https://blog.csdn.net/u010481688/article/details/80989162 linux(CentOS7.2)安裝 Tsung

按以下順序安裝,避免出現不必要的錯誤

一、 安裝Erlang/OTP 22.0

Tsung 依賴 Erlang(d當前最新版本22.0)語言,且不同的Tsung對Erlang的版本有要求,所以需要先安裝Erlang
http://www.erlang.org/ erlang官網
http://erlang.org/download/ erlang下載地址
http://www.erlang.org/downloads
https://www.erlang-solutions.com/resources/download.html
注意:
yum方式 安裝erlang 不能安裝最新的版本

yum -y install erlang

這裏選擇源碼安裝方式,下載所要安裝版本的源碼

wget http://erlang.org/download/otp_src_22.0.tar    執行命令,地址可根據實際情況修改
tar -xf otp_src_22.0.tar
yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel unixODBC-devel libtool libtool-ltdl-devel     Erlang依賴安裝
cd otp_src_22.0
./otp_build autoconf    重新編譯的時候執行這條命令,如果是首次執行編譯,可以不用執行這條命令
./configure
make
make install

Erlang 默認安裝路徑爲 /usr/local/lib/erlang

vim /etc/profile
將如下代碼粘貼至文件末尾

export ERLANG_HOME=/usr/local/lib/erlang

export PATH=$PATH:$ERLANG_HOME/bin   如果已經有PATH 則  將   :$ERLANG_HOME/bin  拼接到PATH 後面

在這裏插入圖片描述

重新加載環境變量

source /etc/profile

測試安裝結果,執行命令

erl

退出erl

ctrl+g  進入命令模式
q

安裝 Perl

http://www.perl.org/ perl官網
1、卸載系統自帶的perl

yum remove perl

2、安裝perl依賴包

yum -y install gcc cpan

注:cpan這個包是用來編譯安裝perl的,gcc是依賴包!
3、下載perl源碼包

wget https://www.cpan.org/src/5.0/perl-5.28.1.tar.gz   或 
wget http://search.cpan.org/CPAN/authors/id/S/SH/SHAY/perl-5.26.1.tar.gz
tar -xzf perl-5.28.1.tar.gz
cd perl-5.28.1
./Configure
make
make test
或  make && make test
make install
重新打開一個 終端
perl -v

https://blog.csdn.net/fxbin123/article/details/80719621 CentOS7.4 安裝 perl 環境
https://blog.51cto.com/13043516/2308250 Centos7 安裝perl依賴環境庫
https://www.cnblogs.com/sea-stream/p/10387992.html CentOS7 安裝Perl 28.1

編寫第一個Perl程序
創建Perl腳本;

touch test.pl
編寫Hello World程序;

#!/usr/bin/perl
print "Hello World!\n"

執行程序;
[root@controller ~]# perl test.pl
Hello World!

https://blog.csdn.net/weixin_33895516/article/details/87211172

安裝Tsung1.7.0

Tsung官網 http://tsung.erlang-projects.org/
http://tsung.erlang-projects.org/dist/ Tsung版本 鼠標右鍵複製你要安裝的鏈接地址

wget http://tsung.erlang-projects.org/dist/tsung-1.7.0.tar.gz   執行命令,地址可根據實際情況修改
tar -zxf tsung-1.7.0.tar.gz   解壓文件
cd tsung-1.7.0
./configure
make
make install

安裝完成執行命令

tsung

進入目錄

cd /usr/local/share/doc/tsung/examples

用示例文件進行測試

tsung -f http_simple.xml start

測試進行期間可使用瀏覽器查看測試信息,訪問地址爲 http://服務器地址:8091,如不能訪問請檢查阿里雲安全組及防火牆,此處訪問與否不影響最終結果,而且服務會隨測試結束而終止,沒什麼需要可以不用查看。測試時間根據情況通常十分鐘內完成
本例以默認配置文件舉例安裝步驟,具體參數設置參見官網或博客給出的講解
https://www.awaimai.com/628.html

編輯環境變量

vim /etc/profile
添加 TSUNG_HOME
export TSUNG_HOME=/usr/local/lib/tsung

並在PATH(放到文件最後一行),後面追加

:$TSUNG_HOME/bin

保存退出後重新加載環境變量

source /etc/profile

生成report.html

安裝報告生成需要的依賴

yum -y install gnuplot  perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker

安裝perl需要的Template
官網 http://www.template-toolkit.org/
http://www.template-toolkit.org/download/index.html#source

wget http://cpan.org/modules/by-module/Template/Template-Toolkit-2.26.tar.gz
tar -zxf Template-Toolkit-2.26.tar.gz
cd Template-Toolkit-2.26
perl Makefile.PL
make
make test
sudo make install

安裝完成後進入tsung報告存放路徑
cd ~/.tsung/log
找到最新的測試結果文件夾 2019xx
進入目錄
cd 2019xx
執行命令
tsung_stats.pl
如果報錯:tsung執行時報Can’t locate Template.pm的解決
yum -y install perl-Template-Toolkit
在這裏插入圖片描述
錯誤解決
https://blog.51cto.com/ovcer/1579272
已經生成report.html文件
將2019xxx 導入到windows ,打開report.html 即可查看
參照
https://blog.csdn.net/medeuz/article/details/79571395

卸載:
yum方式安裝的erlang卸載
1.查找要卸載的erlang軟件

rpm -qa | grep erlang
yum list | grep erlang

2 . 卸載查找到的軟件

rpm -e --nodeps erlang-xxx
yum -y remove erlang-* 
yum remove esl-erlang.x86_64 

https://blog.csdn.net/qq_35464063/article/details/83382324 centos7 卸載軟件
https://www.jianshu.com/p/f54dc259a9ed/ CentOS安裝新版RabbitMQ解決Erlang 19.3版本依賴
https://www.jianshu.com/p/2187e03ad126 centos7下源碼安裝最新erlang環境
https://www.cnblogs.com/liaojie970/p/9198548.html CentOS卸載通過yum安裝的軟件
https://blog.csdn.net/zhangh_0/article/details/78164278 卸載erlang-使用yum install命令安裝
https://blog.csdn.net/l359389556/article/details/82838783 linux centos6.5 卸載otp 卸載編譯安裝的erlang
https://www.cnblogs.com/citta/p/9735448.html Centos7下vim最新版本安裝
https://www.cnblogs.com/Tsai_Quinn/p/3942289.html LINUX 安裝tsung 對OPENFIRE 進行壓力測試

2019年6月7日 11:38 工藝美家屬院 端午節 下午準備回家

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章