![데비안과 Truenas 간의 rsync의 이상한 동작](https://rvso.com/image/770118/%EB%8D%B0%EB%B9%84%EC%95%88%EA%B3%BC%20Truenas%20%EA%B0%84%EC%9D%98%20rsync%EC%9D%98%20%EC%9D%B4%EC%83%81%ED%95%9C%20%EB%8F%99%EC%9E%91.png)
rsync를 사용하여 웹 서버에서 Truenas로 데이터를 백업하고 싶습니다. 웹 서버는 Debian 11을 실행하고 Truenas는 12.0-U5에 있습니다. 백업은 Restic을 사용하여 암호화된 형식으로 웹 서버에 저장됩니다. 이미 암호화되어 있으므로 SSH 오버헤드를 피하기 위해 rsync를 직접 사용하고 싶습니다.
Debian에서 rsync는 버전 3.2.3이고 Truenas 3.1.3에서는 현재 사용 중입니다.
rsync -rdt rsync://rsync@truenas
가끔 피어에 의해 연결이 재설정되는 경우가 있습니다.
rsync: [Receiver] safe_read failed to read 1 bytes: Connection reset by peer (104)
rsync error: error in rsync protocol data stream (code 12) at io.c(276) [Receiver=3.2.3]
이런 일이 3, 4, 5번 정도 발생한 다음 전송이 작동합니다.
rsync -rdt rsync://rsync@truenas
web_backup
db_backup
무슨 일이 일어나는지 보기 위해 tcpdump를 실행했습니다. 클라이언트는 항상 동일한 문자열을 보내지만 truenas의 rsync는 때때로 응답하고 때로는 연결을 재설정합니다([R]-플래그).
성공적인 전송:
12:26:44.035035 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 66)
truenas.873 > webserver.58482: Flags [P.], cksum 0x2e81 (correct), seq 1:15, ack 15, win 1027, options [nop,nop,TS val 2820912976 ecr 2728215840], length 14
E..B..@[email protected]...:.c...........
.#.P..E @RSYNCD: 31.0
12:26:44.035098 IP (tos 0x0, ttl 63, id 53872, offset 0, flags [DF], proto TCP (6), length 52)
webserver.58482 > truenas.873: Flags [.], cksum 0xd829 (correct), ack 15, win 502, options [nop,nop,TS val 2728215841 ecr 2820912976], length 0
E..4.p@.?.....n......r.i.:.c.y.......).....
..E!.#.P
12:26:44.035127 IP (tos 0x0, ttl 63, id 53873, offset 0, flags [DF], proto TCP (6), length 53)
webserver.58482 > truenas.873: Flags [P.], cksum 0xce20 (correct), seq 15:16, ack 15, win 502, options [nop,nop,TS val 2728215841 ecr 2820912976], length 1
E..5.q@.?.....n......r.i.:.c.y....... .....
..E!.#.P
12:26:44.035218 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 69)
truenas.873 > webserver.58482: Flags [P.], cksum 0x56b7 (correct), seq 15:32, ack 16, win 1027, options [nop,nop,TS val 2820912976 ecr 2728215841], length 17
E..E..@[email protected]...:.d....V......
.#.P..E!web_backup
12:26:44.035226 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 83)
truenas.873 > webserver.58482: Flags [FP.], cksum 0xa8e8 (correct), seq 32:63, ack 16, win 1027, options [nop,nop,TS val 2820912976 ecr 2728215841], length 31
E..S..@.@..?......n..i.r.y.!.:.d...........
.#.P..E!db_backup
@RSYNCD: EXIT
전송 실패:
12:26:50.724628 IP (tos 0x0, ttl 63, id 469, offset 0, flags [DF], proto TCP (6), length 66)
webserver.58532 > truenas.873: Flags [P.], cksum 0x98eb (correct), seq 1:15, ack 1, win 502, options [nop,nop,TS val 2728222530 ecr 633812564], length 14
E..B..@.?..{..n........iB.'.M..............
.._B%.6T@RSYNCD: 31.0
12:26:50.724972 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 40)
truenas.873 > webserver.58532: Flags [R], cksum 0x43ae (correct), seq 1292349879, win 0, length 0
E..(..@[email protected].........
12:26:50.725398 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 66)
truenas.873 > webserver.58532: Flags [P.], cksum 0x96d0 (correct), seq 1:15, ack 15, win 1027, options [nop,nop,TS val 633812564 ecr 2728222530], length 14
E..B..@[email protected].'............
%.6T.._B@RSYNCD: 31.0
12:26:50.725470 IP (tos 0x0, ttl 63, id 0, offset 0, flags [DF], proto TCP (6), length 40)
webserver.58532 > truenas.873: Flags [R], cksum 0xd85b (correct), seq 1123821333, win 0, length 0
E..(..@.?..j..n........iB.'.....P....[..
Truenas 로그에는 다른 내용이 표시되지 않습니다.
Sep 3 12:26:44 truenas 1 2021-09-03T12:26:44.030844+02:00 truenas.local rsyncd 10028 - - connect from UNDETERMINED (webserver)
Sep 3 12:26:44 truenas 1 2021-09-03T12:26:44.031075+02:00 truenas.local rsyncd 10028 - - module-list request from UNDETERMINED (webserver)
Sep 3 12:26:50 truenas 1 2021-09-03T12:26:50.721209+02:00 truenas.local rsyncd 10032 - - connect from UNDETERMINED (webserver)
Sep 3 12:26:50 truenas 1 2021-09-03T12:26:50.721447+02:00 truenas.local rsyncd 10032 - - rsync: safe_read failed to read 1 bytes [Receiver]: Connection reset by peer (54)
Sep 3 12:26:50 truenas 1 2021-09-03T12:26:50.721476+02:00 truenas.local rsyncd 10032 - - rsync error: error in rsync protocol data stream (code 12) at io.c(276) [Receiver=3.1.3]
여기서 무슨 일이 일어나고 있는 걸까요?
답변1
데비안에서 이전과 동일한 버전의 rsync를 사용해 보십시오(오래된 안정). TrueNAS-13.1-RELEASE는 rsync 버전 3.1.3 프로토콜 버전 31을 사용하기 때문입니다.것 같다FreeBSD ACL을 지원하는 최신 버전(202112). 또한rsync 현재 문제 및 디버깅.