打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
loadrunner 场景设计

 场景设计-添加UnixLinuxResources计数器

by:授客QQ1033553122

A.  目的

监控要测试的UnixLinux服务器的资源使用情况

 

Linux CentOS为例(LinuxUnix虽说大同小异,但是具体落实到配置等实际执行还是有差别的,以下仅供参考

注:关于Unix的配置,可以参见官方文档“Howto Set up the UNIX Monitoring Environment

 

B.  步骤

1、确认服务器是否配置并开启了rstatd守护进程 

如果已经配置rstatd守护进程,当服务器收到rstatd请求时,inetd进程会自动激活rstatd进程

可以利用下文的方法在不进行配置的情况下,添加UnixRescources监视器,查看是否返回相关数据,Scenariostatus返回错误则说明服务器未配置rstatd

 

2、安装rpc.rstatd

配置本第yum()

[root@localhost ~]# mount /dev/cdrom /mnt

[root@localhost ~]# yum grouplist | grep rusers

[root@localhost ~]# yum list | grep rusers

rusers.x86_64                          0.17-59.el6                     centos

rusers-server.x86_64                   0.17-59.el6                     centos

[root@localhost ~]# yum install rusers-server

……


3.启动rstatd进程

[root@localhost ~]# /etc/init.d/rstatd start

Starting rstat services:                                  OK ]

 

[root@localhost ~]# service rstatd status

rpc.rstatd dead but pid file exists

说明rstartd启动后并不能保持运行状态

[root@localhost ~]# rpcinfo -p localhost

rpcinfo: can't contact portmapper: RPC: Remote system error -Connection refused

原因分析:如下,未启动portmap服务/很多linux发行版已经用rpcbind代替portmap服务了

 

[root@localhost ~]# service rpcbind status

rpcbind is stopped

 

[root@localhost ~]# service rpcbind start

Starting rpcbind:                                         OK ]

 

[root@localhost ~]# rpcinfo -p localhost

  program vers proto  port service

   100000    tcp   111 portmapper

   100000    tcp   111 portmapper

   100000    tcp   111 portmapper

   100000    udp   111 portmapper

   100000    udp   111 portmapper

100000    udp   111 portmapper

说明:

rpcinfo -p ,如果是远程连接必须指定IP地址,

比如#rpcinfo -p 172.25.75.14

 

4、添加视图,方法双击、拖动左侧的UnixRescources到右边图形区,或右键右侧已有视图,Opena New Graph,找到UnixRescource,添加


 

5.右键已经添加的UnixResource, 选择AddMeasurements...


 

6.弹出窗口中,点击Add,弹出AddMachine中添加要监控系统((通常是压测目标服务器)IP


 


 

保存

 

结果提示错误消息:

Monitor name :UNIX Resources. Cannot initialize the monitoring on172.25.75.14. Error while creating the RPC client. Ensure that themachine can be connected and that it runs the rstat daemon (userpcinfo utility for this verification). Detailed error: RPC: Failed to create RPCclient.

RPC-TCP: Failed to establish RPC server address.

RPC-TCP: Failed to communicate with the portmapper on host'172.25.75.14'.

RPC: RPC call failed.

RPC-TCP: recv()/recvfrom() failed.

RPC-TCP: Timeout reached. (entry point:CFactory::Initialize).  [MsgId:MMSG-47190]

 

解决方法

1)安装xinetd服务

[root@localhost ~]# yum list | grep xinetd

xinetd.x86_64                          2:2.3.14-29.el6                 centos

[root@localhost ~]# yum install inetd

……

[root@localhost ~]# service xinetd status

xinetd is stopped

[root@localhost ~]# service xinetd start

Starting xinetd:                                          OK ]

 

2)关闭防火墙

[root@localhost ~]# service iptables stop

 

3)重启服务

[root@localhost ~]# /etc/init.d/xinetd restart #service xinetdrestart应该也可以

Stopping xinetd:                                          OK ]

Starting xinetd:                                          OK ]

[root@localhost ~]# service rstatd restart

Stopping rstat services:                                  [FAILED]

Starting rstat services:                                  OK ]

[root@localhost ~]# service rstatd restart

Stopping rstat services:                                  OK ]

Starting rstat services:                                  OK ]

[root@localhost ~]# service rstatd restart

 

说明:具体是否一定要按这个顺序重启服务就不清楚了,测试中,开放防火墙tcp\udp111端口,重启过xinetd服务后添加再重新Unixrescource发现还是不行,接着,关闭防火墙->重启xinetd->重启rstatd服务,再次添加就可以了,这里根据上述执行情况,估计是之前启动rstatd后“rpc.rstatddead but pid file exists”造成的(注意:后面测试发现,一开启防火墙就没数据了……

 

4)重复上述的5-6操作步骤,OK


本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
LoadRunner监控Linux
LoadRunner监视服务器LINUX的方法
Loadrunner11监控LINUX服务器
LoadRunner监控Linux资源
Centos下telnet的安装和配置
telnet: connect to address 127.0.0.1: Connection refused问题
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服