简体   繁体   English

如何从 Google Colab Notebook 中杀死 Ngrok 隧道

[英]How to kill Ngrok tunnel from Google Colab Notebook

I am running Streamlit app from Google Colab Notebook .我正在从Google Colab Notebook运行Streamlit应用程序。 Due to some limitations of sending out the URL of Streamlit app to outside, I follow the tutorial of using Ngrok for sending URL via tunnel.由于将Streamlit应用程序的URL向外发送的一些限制,我按照使用Ngrok通过隧道发送URL的教程进行操作。 I know that with a single ngrok client session , I can't run more than one tunnel.我知道使用单个 ngrok 客户端 session ,我不能运行多个隧道。 But in my case, I want to rerun and reconnect my Streamlit app to ngrok again.但就我而言,我想重新运行我的 Streamlit 应用程序并将其重新连接到 ngrok。 So in order to do so, I want to kill the running Ngrok tunnel first.所以为了做到这一点,我想先杀死正在运行的 Ngrok 隧道

So please anyone, could you tell me how to kill ngrok from Colab Notebook ?所以请任何人,你能告诉我如何从Colab Notebook杀死 ngrok吗?

It's likely you have an orphaned Colab.您可能有一个孤儿 Colab。 Go to Runtime -> Manage Sessions, and terminate all of them and then try again.转到运行时 -> 管理会话,并终止所有会话,然后重试。

You need to find the processes on which ngrok tunnel is running and kill it.您需要找到正在运行 ngrok 隧道的进程并将其杀死。

command to find the processes ids查找进程ID的命令

ps -eaf | grep {{port on which ngrok is running}}

This will result in a list of processes that has a text match with the port number.这将产生一个与端口号文本匹配的进程列表。 Identify the ngrok tunnel processes and kill those processes running the following command识别 ngrok 隧道进程并终止运行以下命令的那些进程

sudo kill -9 {{process id}}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM