AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

    • 主页
    • 系统&网络
    • Ubuntu
    • Unix
    • DBA
    • Computer
    • Coding
    • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-280708

TylerDurden's questions

Martin Hope
TylerDurden
Asked: 2019-10-02 05:22:53 +0800 CST

Linux:rsync 将 SMB 镜像挂载到本地磁盘非常慢

  • 2

我尝试将通过 SMB 挂载的共享镜像到本地目录。该共享托管在 Windows 2016 服务器上,我无权访问,也无法安装任何工具。因此,我所拥有的只是一个 SMB 共享。

该共享包含大约 350GB 的数据,主要是小文件 (4MB)。每天晚上,rsync作业都会运行并将所有更新传输到本地目录。这需要很长时间才能完成。发送增量文件列表大约需要 10 到 15 分钟(我需要验证这一点),但是 rsync 需要在 12 小时内传输几 MB(每晚大约更改 20 个文件)。

也许我对如何rsync工作有误解。但我的印象是,在收到增量文件列表后rsync,能够找出需要传输的文件。所以剩下的就是选择更改的文件并传输它们,这应该不超过几分钟到最多一小时。

actimeo=600通过安装带有选项的 SMB 共享,我能够将传输时间从 12 小时缩短到 9 小时。但它仍然需要比预期更长的时间。

所以这是安装(在 Synology NAS 上):

mount -t cifs //remote.server/share /volume1/sysadmin/share -o vers=3.0,username=john,password='***',domain=EXAMPLE,ro,soft,uid=1026,forceuid,gid=100,forcegid,addr=remote.server,file_mode=0777,dir_mode=0777,iocharset=utf8,nocase,cache=none,noserverino,actimeo=600

这是 rsync 工作:

rsyncOptions=(
    --delete
    --human-readable
    --itemize-changes
    "--modify-window=1"
    --partial
    --protect-args
    --recursive
    --stats
    --times
    --verbose
)
rsyncExclusions=(
    --exclude=.DS_Store
    --exclude=.Trash
    --exclude=.TemporaryItems
    --exclude=._*
    --exclude=.AppleDB
    --exclude=.AppleDouble
    --exclude=__MACOSX
    --exclude=.AppleDesktop
    --exclude=.~lock*
    --exclude=.fseventsd
    --exclude=.lock
    --exclude=.afpDeleted*
    --exclude=.smbdelete*
    --exclude=.TEMP_*
    --exclude=@eaDir
    --exclude=Thumbs.db
    --exclude='* '
    --exclude='*.'
)
/usr/bin/rsync "${rsyncOptions[@]}" "${rsyncExclusions[@]}" "/volume1/sysadmin/share/" "/volume1/share/

这是上次同步的统计信息:

Number of files: 571170
Number of files transferred: 279
Total file size: 351.95G bytes
Total transferred file size: 387.34M bytes
Literal data: 387.34M bytes
Matched data: 0 bytes
File list size: 25.95M
File list generation time: 0.526 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 413.57M
Total bytes received: 223.89K

sent 413.57M bytes  received 223.89K bytes  13.11K bytes/sec
total size is 351.95G  speedup is 850.56

我怎样才能加快传输速度?也许其他工具lftp更适合完成此任务......任何指针表示赞赏。

更新 1

  • lftp带mirror --dry-run --no-perms --exclude-glob="*." --exclude-glob="* " --parallel --only-newer选项也需要大约 9 到 12 小时才能完成。所以这是没有办法的。

  • 在 GUI 中或通过cp4.7MB 文件的简单复制大约需要 2-3 秒才能完成。

  • 我从rsync选项--dry-run开始。我一有结果就会更新这篇文章。

更新 2

  • rsyncwith--dry-run现在运行了 6 个多小时。我想假设它也需要 9 个小时以上是节省的。日志中唯一且唯一的条目是sending incremental file list. 今天是这里的公共假期(因此没有更改文件/目录)所以我不确定完成这部分过程需要多长时间。

更新 3

启用更多日志记录后,结果如下所示:

2019/10/04 04:00:03 [20771] building file list
2019/10/04 05:42:16 [20771] .d..t...... dir1/
2019/10/04 05:42:17 [20771] >f+++++++++ dir1/file1
2019/10/04 05:42:44 [20771] .d..t...... dir1/subdir1/
2019/10/04 05:42:44 [20771] >f.st...... dir1/subdir1/file1
2019/10/04 05:43:19 [20771] >f..t...... dir1/subdir1/file2
2019/10/04 05:43:20 [20771] >f.st...... dir1/subdir1/file3
2019/10/04 05:43:20 [20771] .d..t...... dir1/subdir2/
2019/10/04 05:43:21 [20771] >f+++++++++ dir1/subdir2/file1
2019/10/04 10:16:38 [20771] .d..t...... dir2/subdir1/

...

请注意 dir1 和 dir2 之间的巨大时间间隔,要么rsync需要大量时间来遍历目录树,要么我正在发生其他事情。

linux
  • 1 个回答
  • 1684 Views
Martin Hope
TylerDurden
Asked: 2016-11-17 10:24:08 +0800 CST

如何使用 MikroTik 路由器在不同子网上设置到网关的路由?

  • 1

我们有以下设置,我需要开始工作:

  • 地点 A:
    • 子网 1:
      • 网络:192.168.1.0
      • 面具:255.255.255.0
      • 默认网关:192.168.1.1
    • 子网 2:
      • 网络:192.168.2.0
      • 面具:255.255.255.0
      • 默认网关:192.168.2.1
  • 位置 B:
    • 子网 3:
      • 网络:192.168.3.0
      • 面具:255.255.255.0
      • 默认网关:192.168.3.1

位置 A 和 B 的默认网关通过 VPN 连接,并且仅路由子网 1 和 3。我无法更改这些网关的配置。我需要实现的是,流向公共子网的流量,例如 193.197.0.0 是通过子网 2 的默认网关路由的。

到目前为止我做了什么:

  • 我在位置 A 和 B 添加了一个 MikroTik 路由器,其配置如下:
    • 地点 A:
      • IP:192.168.1.254、192.168.2.254
      • 路线:193.197.0.0 -> 192.168.2.254
    • 位置 B:
      • IP:192.168.3.254

现在,对于位置 A 和子网 1,这可以正常工作。但是,我无法在位置 3 正确设置 MikroTik。我试过了:

  • 路线:193.197.0.0/12 -> 192.168.1.254(不起作用)
  • 在两个 MikroTik 之间设置 IPIP-tunnel 和路由 193.197.0.0/12 -> (IPIP-tunnel)

背景:子网1和3的客户端需要访问某个网站。但是,只能通过子网 2 中的网关访问该网站(一些高安全性的东西)。

我很确定这些路由器可以解决这种情况,但我需要你的帮助!有任何想法吗?

router routing mikrotik routeros
  • 1 个回答
  • 10974 Views
Martin Hope
TylerDurden
Asked: 2016-09-11 08:05:57 +0800 CST

无法让 iptables 在 SuSE Linux 上正确转发

  • 0

我正在努力通过iptables. 我做了很多谷歌搜索,但我尝试过的所有解决方案都不起作用。

非常简单的设置,在同一个 LAN 上使用三台计算机

192.168.0.1 # destination
192.168.0.2 # redirector (only one interface)
192.168.0.3 # source

我的iptables配置也很简单

# iptables -L -n -t nat
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         
DNAT       tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:80 to:192.168.0.1
DNAT       tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:443 to:192.168.0.1

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         
MASQUERADE  all  --  0.0.0.0/0            0.0.0.0/0

# iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination 

# iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT

根据我阅读的内容,这应该可以。但事实并非如此。我也玩过iptables -t nat -I POSTROUTING 1 -p tcp -d 192.168.0.1 --dport 443 -j SNAT --to-source 192.168.0.1但也不起作用。并且是ip_forward启用的。

浏览到192.168.0.2:80/443应该从 中返回内容192.168.0.1,不是吗?有任何想法吗?

iptables opensuse sles
  • 1 个回答
  • 689 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助
subwaysurfers
my femboy roommate

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve