May 02 13:29:44 test systemd[1]: Starting Remote desktop service (VNC)... May 02 13:29:44 test systemd[1]: Started Remote desktop service (VNC). May 02 13:29:44 test vncserver_wrapper[28040]: You will require a password to access your desktops. May 02 13:29:44 test vncserver_wrapper[28040]: getpassword error: Inappropriate ioctl for device May 02 13:29:44 test vncserver_wrapper[28040]: Password:FATAL: 'runuser -l root' failed! May 02 13:29:44 test systemd[1]: vncserver@:1.service: main process exited, code=exited, status=2/INVALIDARGUMENT May 02 13:29:44 test systemd[1]: Unit vncserver@:1.service entered failed state. May 02 13:29:44 test systemd[1]: vncserver@:1.service failed.
$ /etc/rc.d/init.d/vmware start Starting vmware (via systemctl): Job for vmware.service failed because the control process exited with error code. See "systemctl status vmware.service" and "journalctl -xe" for details. [FAILED] $ journalctl -xe -u vmware -- -- Unit vmware.service has failed. -- -- The result is failed. May 02 11:13:39 k8s-uat-xhy-mysql-new systemd[1]: Unit vmware.service entered failed state. May 02 11:13:39 k8s-uat-xhy-mysql-new systemd[1]: vmware.service failed. May 02 11:19:37 k8s-uat-xhy-mysql-new systemd[1]: Starting SYSV: This service starts and stops VMware services... -- Subject: Unit vmware.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit vmware.service has begun starting up. May 02 11:19:37 k8s-uat-xhy-mysql-new vmware[22226]: Starting VMware services: May 02 11:19:37 k8s-uat-xhy-mysql-new vmware[22226]: Virtual machine monitor[FAILED] May 02 11:19:37 k8s-uat-xhy-mysql-new vmware[22226]: Virtual machine communication interface[ OK ] May 02 11:19:37 k8s-uat-xhy-mysql-new vmware[22226]: VM communication interface socket family[ OK ] May 02 11:19:37 k8s-uat-xhy-mysql-new vmware[22226]: Virtual ethernet[FAILED] May 02 11:19:37 k8s-uat-xhy-mysql-new vmware[22226]: VMware Authentication Daemon[ OK ] May 02 11:19:37 k8s-uat-xhy-mysql-new systemd[1]: vmware.service: control process exited, code=exited status=1 May 02 11:19:37 k8s-uat-xhy-mysql-new systemd[1]: Failed to start SYSV: This service starts and stops VMware services. -- Subject: Unit vmware.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit vmware.service has failed. -- -- The result is failed. May 02 11:19:37 k8s-uat-xhy-mysql-new systemd[1]: Unit vmware.service entered failed state. May 02 11:19:37 k8s-uat-xhy-mysql-new systemd[1]: vmware.service failed.
$ curl -v 127.0.0.1:4369 * About to connect() to 127.0.0.1 port 4369 (#0) * Trying 127.0.0.1... * No route to host * Failed connect to 127.0.0.1:4369; No route to host * Closing connection 0 curl: (7) Failed connect to 127.0.0.1:4369; No route to host
$ curl -v 127.0.0.1:4369 * About to connect() to 127.0.0.1 port 4369 (#0) * Trying 127.0.0.1... * Connected to 127.0.0.1 (127.0.0.1) port 4369 (#0) > GET / HTTP/1.1 > User-Agent: curl/7.29.0 > Host: 127.0.0.1:4369 > Accept: */* > * Empty reply from server * Connection #0 to host 127.0.0.1 left intact curl: (52) Empty reply from server
Macvlan 接口是物理以太网接口的虚拟子接口,Macvlan 允许用户在一个物理网络接口上面配置多个虚拟的网络接口,每个 Macvlan 接口都有自己的区别与父接口的 MAC 地址,并且可以像普通的物理网络接口一样分配 IP 地址。使用 Macvlan 技术实现的效果是一块物理网卡可以绑定多个 IP 地址,并且每个 IP 地址有自己独立的 MAC 地址。
network namespace 的增删改查功能已经集成到了 Linux 的 ip 工具集的 netns 子命令中,因此在 Linux 系统中,对 network namespace 的操作主要使用 ip netns 命令
$ ip netns help Usage: ip netns list ip netns add NAME ip netns set NAME NETNSID ip [-all] netns delete [NAME] ip netns identify [PID] ip netns pids NAME ip [-all] netns exec [NAME] cmd ... ip netns monitor ip netns list-id
新的 network namespace 创建后,可以使用 ip netns exec 命令进入 namespace,做网络配置或者查询的工作。
ip netns exec 命令只能根据 network namespace 的名称进入 namespace
以下命令查询 netns1 的 network namespace 的 IP 地址信息
$ ip netns exec netns1 ip add 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
默认的 network namespace 除了附带一个 lo 网卡外,没有任何其他网络设备,并且此 lo 接口还处于 DOWN 的状态,因此此回环网卡也是不可访问的。
$ ip netns exec netns1 ping 127.0.0.1 connect: Network is unreachable
在此示例中,如果想启用本地回环地址,首先需要进入 namespace,将本地回环网卡的状态修改为 UP
$ ip netns exec netns1 ip linkset dev lo up $ ip netns exec netns1 ip add 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever $ ip netns exec netns1 ping 127.0.0.1 PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.021 ms ^C --- 127.0.0.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.021/0.021/0.021/0.000 ms
Feb 10 12:21:40 k8s-work1 kernel: nfs: server 172.31.88.9 not responding, timed out Feb 10 12:21:40 k8s-work1 kernel: nfs: server 172.31.88.9 not responding, still trying Feb 10 12:21:40 k8s-work1 kernel: nfs: server 172.31.88.9 not responding, timed out Feb 10 12:21:40 k8s-work1 kernel: nfs: server 172.31.88.9 not responding, still trying Feb 10 12:21:40 k8s-work1 kernel: nfs: server 172.31.88.9 not responding, timed out