swarm节点间通信问题-关闭checksum校验和

现场还原

客户有n台redhat虚拟机,构建了一个swarm集群,服务起来后,发现不同节点间的服务,无法互相访问。经运维大佬排查是服务器的checksum校验是开启状态,关闭即可~

查看checksum状态

ethtool -k 内网网卡名称 | grep checksum

bash 复制代码
rx-checksumming: on
tx-checksumming: on				#  当前为 on   关闭后为 off
tx-checksum-ipv4: off [fixed]
tx-checksum-ip-generic: on 		#  当前为 on   关闭后为 off
tx-checksum-ipv6: off [fixed]
tx-checksum-fcoe-crc: off [fixed]
tx-checksum-sctp: off [fixed]

临时关闭

bash 复制代码
ethtool -K 内网网卡名称 tx-checksum-ip-generic off 

设置开机自动关闭(永久关闭)

bash 复制代码
vim /etc/systemd/system/docker-tx-checksum-off.service

填充以下内容[可以直接将提供的文件,复制到 /etc/systemd/system/ 下]

bash 复制代码
[Unit]
Description=Turn off checksum offload on eth0
After=network-online.target # 备注①
[Install]
WantedBy=network-online.target # 备注②
[Service]
Type=oneshot
ExecStart=/sbin/ethtool -K eth0 tx-checksum-ip-generic off

备注:上面的 备注① 和备注② 很重要,是这个脚本的开机启动顺序,如果配置的比network-online早,则该脚本先执行,就没意义了~

开机自启动,并启动服务

systemctl enable docker-tx-checksum-off.service

systemctl start docker-tx-checksum-off.service

相关推荐
招财猫_Martin9 个月前
【解决问题】Win11下如何进行文件的checksum校验(CertUtil)
windows·checksum·file hash