Linux
RTNETLINK 答案:使用帶有 tc 的 netem 時文件存在
因此,當我在主 VM 中輸入此命令時,我只會收到此錯誤:
sudo tc qdisc add dev eth0 root netem delay 97ms RTNETLINK answers: File exists
知道如何解決嗎?
我在 Ubuntu 中執行這個命令:
uname -a Linux anmol-vm1-new 3.13.0-46-generic #79-Ubuntu SMP Tue Mar 10 20:06:50 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux ubuntu@anmol-vm1-new:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.2 LTS Release: 14.04 Codename: trusty
這是
/etc/network/interfaces
文件的內容:auto lo iface lo inet loopback source /etc/network/interfaces.d/*.cfg ls /etc/network/interfaces.d/ eth0.cfg
這就是我所擁有的
/etc/network/interfaces.d/eth0.cfg
# The primary network interface auto eth0 iface eth0 inet dhcp
另外我得到這些錯誤:
ubuntu@anmol-vm1-new:/home/hadoop/yarnpp/workloads/RESULTS$ tc qdisc change dev eth0 root netem delay 100ms RTNETLINK answers: Operation not permitted ubuntu@anmol-vm1-new:/home/hadoop/yarnpp/workloads/RESULTS$ sudo tc qdisc change dev eth0 root netem delay 100ms RTNETLINK answers: Invalid argument
作為參考,您可能還想查看我要求限制頻寬的這個StackOverflow 問題。
ifconfig -a eth0 Link encap:Ethernet HWaddr fa:16:3e:b4:22:7c inet addr:10.0.1.190 Bcast:10.0.1.255 Mask:255.255.255.0 inet6 addr: fe80::f816:3eff:feb4:227c/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1454 Metric:1 RX packets:603022138 errors:0 dropped:0 overruns:0 frame:0 TX packets:132788011 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:633486216278 (633.4 GB) TX bytes:798520828666 (798.5 GB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:367293839 errors:0 dropped:0 overruns:0 frame:0 TX packets:367293839 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:547056723183 (547.0 GB) TX bytes:547056723183 (547.0 GB)
解決方案如下:
sudo tc qdisc del dev eth0 root sudo tc qdisc add dev eth0 root netem delay 100ms
更短的解決方案:
sudo tc qdisc replace dev eth0 root netem delay 100ms