美文网首页
rsync性能测试+多节点配置

rsync性能测试+多节点配置

作者: linux_python | 来源:发表于2020-10-29 19:21 被阅读0次

一、参数性能测试

image.png
image.png
image.png
image.png
image.png
image.png
image.png
测试结果 rsync -r -c --progress /rsync/2dir/ 192.168.133.123:/rsync/1dir/
加上需求的参数(不影响性能): rsync -cgroupDt

二、各节点配置同步目录(支持多台)

各节点配置情况(相同操作)
yum -y install rsync 
yum -y install  inotify-tools 


脚本:
#!/bin/bash 


src=/rsync/
#src为inotifywait监控目录/同步目录
/usr/bin/inotifywait -mrq --timefmt '%d/%m/%y %H:%M' --format '%T %w%f%e' -e create,modify,move $src |  while read file
do
      txt=`echo $file | awk '{print $3}'`
      filename=`echo $txt | cut -c1-10` 
      filetype=`echo $txt | cut -c 8 `
      if [ $filetype != '.' ];then
          rsync -cgroupDt      $filename*   192.168.133.123:/rsync/ &>/dev/null  &
          rsync -cgroupDt      $filename*   192.168.133.124:/rsync/ &>/dev/null  &
#以上主机为另外两台同步服务器节点(几台写几个)
      fi
      echo "  ${file} was rsynced" >>/opt/soft/log/rsync.log 2>&1
#同步日志存放在/opt/soft/log/rsync.log
done


运行以上脚本 加 & 放在后台执行即可实现实时同步

三、nginx图床配置

代理端配置nginx.conf
http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
           listen 80;
           server_name localhost;
           proxy_set_header X-Forwarded-Host $host;
           proxy_set_header X-Forwarded-Server $host;
           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
           location / {
               #这里的“bal”应与已存在的某一策略名称一致
               proxy_pass http://bal;
           }
       }
       #配置均衡策略,"bal"为策略名称
       upstream bal {
           #轮询
           server  192.168.133.122;
           server  192.168.133.123;
           server  192.168.133.124;
       }
}
nginx节点配置nginx.conf
    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /rsync;   #nginx工作目录
        #只匹配图片
        location ~ .*\.(gif|jpg|jpeg|png|jfif)$ {
        autoindex    on;

}
        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }

反爬虫配置
#禁止Scrapy等工具的抓取
if ($http_user_agent ~* (Scrapy|Curl|HttpClient)) {
     return 403;
}
 
#禁止指定UA及UA为空的访问
if ($http_user_agent ~ "WinHttp|WebZIP|FetchURL|node-superagent|java/|
FeedDemon|Jullo|JikeSpider|Indy Library|Alexa Toolbar|AskTbFXTV|AhrefsBot|
CrawlDaddy|Java|Feedly|Apache-HttpAsyncClient|UniversalFeedParser|ApacheBench|
Microsoft URL Control|Swiftbot|ZmEu|oBot|jaunty|Python-urllib|
lightDeckReports Bot|YYSpider|DigExt|HttpClient|MJ12bot|heritrix|EasouSpider|Ezooms|BOT/0.1|
YandexBot|FlightDeckReports|Linguee Bot|^$" ) {
     return 403;             
}

相关文章

  • rsync性能测试+多节点配置

    一、参数性能测试 测试结果 rsync -r -c --progress /rsync/2di...

  • Jmeter进行性能测试时多台负载机的配置方法

    Jmeter进行性能测试时多台负载机的配置方法 标签:jmeter配置多机负载测试 2017-01-25 13:5...

  • Rsync 服务器安装配置

    rsync安装 rsync服务端配置 启动配置 选择rsync服务器启动方式rsync服务器负载比较高,则使用独立...

  • rsync多模块配置

    先备份服务端的rsync配置文件cp /etc/rsyncd.conf{,.bak} 编辑配置文件vim /etc...

  • 性能测试的准入、准出准则

    性能测试的准入准则 1、已提供模拟生产环境配置的性能测试环境 2、提交性能测试的功能模块必须已经通过测试 3、提交...

  • 性能测试流程与调优

    性能测试流程与调优 概述 分析性能需求 制定性能测试计划 设计场景 编写脚本和程序初始化配置 执行性能测试 分析结...

  • linux文件同步

    配置rsync 同步数据 rpm包安装rsync及配置 [root@Hammer home]# rpm -qa |...

  • rsync数据同步备份

    测试环境: rsync-server:192.168.1.132 rsync-client:192.168.1.2...

  • 性能测试场景

    提到性能测试,常会提到压力测试、负载测试、稳定性测试、配置测试等等,但说到其各自的定义,实在是晦涩难懂。但若将性能...

  • 2018-04-25性能报告

    性能测试报告书写 环境描述信息:硬件软件配置信息(中间件配置 版本) 性能测试目标:平均每个事务的处理时间、每秒需...

网友评论

      本文标题:rsync性能测试+多节点配置

      本文链接:https://www.haomeiwen.com/subject/mgmsmktx.html