重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

linuxCentos下搭建性能监控Spotlighto-创新互联

公司要做压力测试,有Linux服务器一台,系统Centos6.5,为了直观的展示系统性能,更好的去分析服务器,故要搭建一个监控。闲言休讲,直奔主题。

成都创新互联公司长期为1000多家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为丰宁企业提供专业的做网站、成都网站制作丰宁网站改版等技术服务。拥有十年丰富建站经验和众多成功案例,为您定制开发。

首先,Linux服务器一台:系统Centos6.5

其次,在我的笔记本上安装监控软件客户端

软件下载地址链接:

链接:http://pan.baidu.com/s/14Vwlw    密码:tmw4

配置spotlight登陆用户,注意spotlight默认不能使用root用户进行连接,需要用户自己创建一个具有root权限的用户。具体方法新建账号分配权限的问题就自己百度吧,这里重点说的是linux Centos下搭建性能监控Spotlight on Unix

(1)useradd spotlight

(2)passwd spotlight;

(3)vim /etc/passwd

(4)将spotlight的UID和GID改成0:0

下面,我们开始在服务器上安装sysstat。

使用iostat、mpstat、sar

yum install sysstat -y

sysstat的安装包是:sysstat-9.0.4-20.el6.x86_64.rpm,装完了后 就会有iostat、mpstat、sar、sa的功能
启动sysstat
/etc/init.d/sysstat start
设置sysstat自启动
chkconfig sysstat on

---------------------

sysstat工具包提供的主要命令:iostat mpstat sar

mpstat是Multiprocessor Statistics的缩写,是实时系统监控工具。其报告与CPU的一些统计信息,这些信息存放在/proc/stat文件中。在多CPUs系统里,其不 但能查看所有CPU的平均状况信息,而且能够查看特定CPU的信息。下面只介绍 mpstat与CPU相关的参数,mpstat的语法如下:

mpstat [-P {|ALL}] [internal [count]]

mpstat -P 0 1 5

mpstat -P ALL 1 5

网卡流量查看方法

sar –n DEV 1 5

命令后面 1 4 意思是:每一秒钟取一次值,取5次。 IFACE:LAN接口
rxpck/s:每秒钟接收的数据包
txpck/s:每秒钟发送的数据包
rxbyt/s:每秒钟接收的字节数
txbyt/s:每秒钟发送的字节数
rxcmp/s:每秒钟接收的压缩数据包
txcmp/s:每秒钟发送的压缩数据包
rxmcst/s:每秒钟接收的多播数据包

  1. 16时35分25秒     IFACE   rxpck/s   txpck/s   rxbyt/s   txbyt/s   rxcmp/s   txcmp/s  rxmcst/s

  2. 16时35分26秒        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00

  3. 16时35分26秒      eth0      3.00      2.00    258.00    284.00      0.00      0.00      0.00

  4. 16时35分26秒      eth2     51.00     89.00   5680.00 122874.00      0.00      0.00      0.00

  5. 16时35分26秒      sit0      0.00      0.00      0.00      0.00      0.00      0.00      0.00

  6. 16时35分26秒     IFACE   rxpck/s   txpck/s   rxbyt/s   txbyt/s   rxcmp/s   txcmp/s  rxmcst/s

  7. 16时35分27秒        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00

  8. 16时35分27秒      eth0      4.00      3.00    274.00    834.00      0.00      0.00      0.00

  9. 16时35分27秒      eth2     81.00    106.00  11816.00 138982.00      0.00      0.00      0.00

  10. 16时35分27秒      sit0      0.00      0.00      0.00      0.00      0.00      0.00      0.00

  11. 16时35分27秒     IFACE   rxpck/s   txpck/s   rxbyt/s   txbyt/s   rxcmp/s   txcmp/s  rxmcst/s

  12. 16时35分28秒        lo      4.00      4.00    422.00    422.00      0.00      0.00      0.00

  13. 16时35分28秒      eth0      1.00      1.00     70.00    598.00      0.00      0.00      0.00

  14. 16时35分28秒      eth2      9.00     20.00   1811.00  25787.00      0.00      0.00      0.00

  15. 16时35分28秒      sit0      0.00      0.00      0.00      0.00      0.00      0.00      0.00

  16. 16时35分28秒     IFACE   rxpck/s   txpck/s   rxbyt/s   txbyt/s   rxcmp/s   txcmp/s  rxmcst/s

  17. 16时35分29秒        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00

  18. 16时35分29秒      eth0      8.91      7.92    629.70   7144.55      0.00      0.00      0.00

  19. 16时35分29秒      eth2     20.79     22.77   1927.72  32144.55      0.00      0.00      0.00

  20. 16时35分29秒      sit0      0.00      0.00      0.00      0.00      0.00      0.00      0.00

  21. 16时35分29秒     IFACE   rxpck/s   txpck/s   rxbyt/s   txbyt/s   rxcmp/s   txcmp/s  rxmcst/s

  22. 16时35分30秒        lo      8.08      8.08    607.07    607.07      0.00      0.00      0.00

  23. 16时35分30秒      eth0      6.06      5.05    418.18   1969.70      0.00      0.00      0.00

  24. 16时35分30秒      eth2      2.02      2.02    153.54    177.78      0.00      0.00      0.00

  25. 16时35分30秒      sit0      0.00      0.00      0.00      0.00      0.00      0.00      0.00

  26.   Average:        IFACE   rxpck/s   txpck/s   rxbyt/s   txbyt/s   rxcmp/s   txcmp/s  rxmcst/s

  27. Average:           lo      2.40      2.40    204.60    204.60      0.00      0.00      0.00

  28. Average:         eth0      4.60      3.80    330.40   2176.40      0.00      0.00      0.00

  29. Average:         eth2     32.80     48.00   4281.20  64057.00      0.00      0.00      0.00

  30. Average:         sit0      0.00      0.00      0.00      0.00      0.00      0.00      0.00

iostat  1 2

  1. [root@localhost home]# iostat  1 2

  2. Linux 2.6.32-358.el6.x86_64 (localhost.localdomain)     2013年07月11日  _x86_64_        (1 CPU)

  3. avg-cpu:  %user   %nice %system %iowait  %steal   %idle

  4.            0.07    0.00    0.12    0.07    0.00   99.74

  5. Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn

  6. scd0              0.00         0.00         0.00        288          0

  7. sda               0.23         2.58         5.69     168800     372132

  8. dm-0              0.79         2.44         5.69     159410     372080

  9. dm-1              0.00         0.04         0.00       2376          0

  10. avg-cpu:  %user   %nice %system %iowait  %steal   %idle

  11.            0.00    0.00    0.00    0.00    0.00  100.00

  12. Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn

  13. scd0              0.00         0.00         0.00          0          0

  14. sda               0.00         0.00         0.00          0          0

  15. dm-0              0.00         0.00         0.00          0          0

  16. dm-1              0.00         0.00         0.00          0          0

注意,以上安装确保成功后,要设置服务自动启动。

第二,

本机安装SpotlightonUnix_70.exe

这个地方安装就是下一步下一步,就不啰嗦了。

完成后在软件里面配置你的数据库环境。

如图

linux Centos下搭建性能监控Spotlight o

linux Centos下搭建性能监控Spotlight o

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网站题目:linuxCentos下搭建性能监控Spotlighto-创新互联
链接分享:http://cqcxhl.cn/article/cececs.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP