- When I connect to EC2 instance via Mobaxterm, after some period of time my jupyter notebook's kernel loses connection.
- And some highly time-consuming operations /(Currently running tasks) are required to be re-performed again and again and are never-ending (This repeats each and every time).
- I'm closing the notebook and restarting, so I can gain a connection to the kernel because it doesn't reconnect and I had to go through the process again and again when it dies eventually.
- It also shows SSL error, wrong version number sometimes before disconnecting.
Asked
Active
Viewed 2,767 times
5

explorer
- 61
- 1
- 4
2 Answers
1
I have also faced a similar problem. I solved it with the help of 'tmux'. I followed these steps:
- I installed 'tmux' in my machine in the AWS instance.
[Actually, it came preinstalled with the AMI I had been using on the EC2 instance.]
- I created a 'tmux' session simply by entering the command:
tmux
- Then I ran necessary commands to run the
Jupyter server
orJupyter notebook
- To close the terminal, I used this command: (i)
ctrl + b
, (ii)d
[Please notice, the session will continue running on the EC2 instance until you close the instance or close the jupyter server
or the jupyter notebook
].
- To connect to the session again, I used the command:
tmux attach
- To finally kill the 'tmux' session when I am done, I used the command:
tmux kill-session

Amit Hasan
- 11
- 3
1
Just use nohup
. This should be the builtin tool in all Linux machines.
So you should do: nohup jupyter notebook > output.txt
And then you can safely terminate the console session without worrying about killing the notebook.

Dwa
- 593
- 4
- 13
-
1this actually helped a lot, thanks – Mehdi LAMRANI Nov 18 '21 at 15:15