我经常在mac上进行端口转发,但当我在终端上点击CMD+C退出端口转发时,进程并没有被终止。我必须杀了它才能做一个新的左舷前锋。你知道如何在mac上解决这个问题吗?
[2] + 43679 suspended kubectl port-forward pod/pod-0 27017:27017
重试
kubectl port-forward pod/pod-2 27017:27017
Unable to listen on port 27017: Listeners failed to create with the following errors: [unable to create listener: Error listen tcp4 127.0.0.1:27017: bind: address already in use unable to create listener: Error listen tcp6 [::1]:27017: bind: address already in use]
error: unable to listen on any of the requested ports: [{27017 27017}]
➜ ~ kill -9 43679
在Mac上,您想要的命令是CTRL+C
以退出/终止进程。只有当kubectl进程启动时,端口转发才会生效。