因此,当我在主 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)
解决方案如下:
更短的解决方案: