分类目录归档:系统运维

icinga2 执行check_ipmi_sensor 报错


报错: ./check_ipmi_sensor Can't locate IPC/Run.pm in @INC (you may need to install the IPC::Run module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/shar

Read more

redis info 详解


1、client

connected_clients:2053  #当前客户端连接数
client_longest_output_list:0    #当前连接的客户端当中,最长的输出列表
client_biggest_input_buf:0      # 当前连接的客户端当中,最大输入缓存
blocked_clients:0               #被阻塞的客户端数

因为Redis是单线程模型(只能使用单核),来处理所有客户端的请求,且Redis默认允许客户端连接的最大数量是10000。若是看到连接数超过5000以上,那可能会影响Redis的性能。因此监控客户端连接数是非常重要的,因

Read more

ansible 基础


1、安装ansible

yum -y install ansible

2、添加受控主机

ssh-keygen 生成公钥并拷贝至受控端主机的 /root/.ssh/authorized_keys 在/etc/ansible/hosts

# Ex 1: Ungrouped hosts, specify before any group headers.

## green.example.com
## blue.example.com
## 192.168.100.1
192.168.100.10

3、简单使用

[root@my-hz-server ansible]# ansible all

Read more

记一次流量异常排查


nginx 负载均衡出现间歇性网络流量增高,但未报出访问异常的IP。 通过以下工具进行排查: 1、nload -u m -m 每隔5分钟服务器出口的流量都会达到150M以上,已经超出租用的物理带宽100M

2、iftop 按n 可以看到流量比较高的服务器IP,以及请求的客户IP。

3、拿着上面定位到的客户IP,过滤nginx的access日志,找到对应的Web站点,并进行日志分析 先分析是否有明显频繁请求的IP,再分析请求的URI,最终定位到有人间接性的刷一个落地页面 里面包含了很多图片和静态文件,而且这些静态文件和图片都没有走CDN或者OSS,所以会到导致 流量增高。

4、还用到了netho

Read more

简单的压力测试工具WebBench


Webbench是一个在linux下使用的非常简单的网站压测工具。它使用fork()模拟多个客户端同时访问我们设定的URL,测试网站在压力下工作的性能,最多可以模拟3万个并发连接去测试网站的负载能力。

1、WebBench安装

cd /data/tool
git clone https://github.com/EZLippi/WebBench.git
cd /data/tool/WebBench
sudo make && sudo make install PREFIX=/usr/local/webbench
[root@my-host local]# tree webben

Read more

nginx 有关超时时间的配置


proxy_connect_timeout :后端服务器连接的超时时间_发起握手等候响应超时时间 proxy_read_timeout:连接成功后_等候后端服务器响应时间_其实已经进入后端的排队之中等候处理(也可以说是后端服务器处理请求的时间) proxy_send_timeout :后端服务器数据回传时间_就是在规定时间之内后端服务器必须传完所有的数据 nginx使用proxy模块时,默认的读取超时时间是60s。 1、请求超时

http {
    include       mime.types;
    server_names_hash_bucket_size 

Read more

ps 命令使用技巧


1、ps -ylC php-fpm --sort:rss

[root@linunx-php ~]# ps -ylC php-fpm  --sort:rss
S   UID   PID  PPID  C PRI  NI   RSS    SZ WCHAN  TTY          TIME CMD
S     0 10966     1  0  80   0  9312 126961 ep_pol ?       00:00:32 php-fpm
S   993 14195 10966  0  80   0 30040 148996 inet_c ?       00:00:01 php-f

Read more

pmap 工具使用


1、参数说明

名称:
       pmap - report memory map of a process(查看进程的内存映像信息)pmap命令用于报告进程的内存映射关系,是Linux调试及运维一个很好的工具。
用法
       pmap [ -x | -d ] [ -q ] pids...
       pmap -V
选项含义
       -x   extended       Show the extended format. 显示扩展格式
       -d   device         Show the device format.   显示设备格式
       -q 

Read more