Why I can't access remote Jupyter Notebook server?

前端 未结 15 849
清酒与你
清酒与你 2020-12-02 04:53

I have started a Jupyter Notebook server on my centos6.5 server.And jupyter is running like

[I 17:40:59.649 NotebookApp] Serving notebooks from local directo         


        
相关标签:
15条回答
  • 2020-12-02 05:24

    James023 already stated the correct answer. Just formatting it

    if you have not configured jupyter_notebook_config.py file already

    Step1: generate the file by typing this line in console

    jupyter notebook --generate-config
    

    Step2: edit the values

    gedit  /home/koushik/.jupyter/jupyter_notebook_config.py
    

    ( add the following two line anywhere because the default values are commented anyway)

    c.NotebookApp.allow_origin = '*' #allow all origins

    c.NotebookApp.ip = '0.0.0.0' # listen on all IPs

    Step3: once you closed the gedit, in case your port is blocked

    sudo ufw allow 8888 # enable your tcp:8888 port, which is ur default jupyter port

    Step4: set a password

    jupyter notebook password # it will prompt for password

    Step5: start jupyter

    jupyter notebook
    

    and connect like http://xxx.xxx.xxx.xxx:8888/login?

    0 讨论(0)
  • 2020-12-02 05:24

    The other reason can be a firewall. We had same issue even with

    jupyter notebook --ip xx.xx.xx.xxx --port xxxx.

    Then it turns out to be a firewall on our new centOS7.

    0 讨论(0)
  • 2020-12-02 05:27

    I got the same problem but none of workarounds above work for me. But if I setup a docker version jupyter notebook, with the same configuration, it works out for me.

    For my stituation, it might be iptables rule issues. Sometimes you may just using ufw to allow all route to your server. But mine just iptables -F to clear all rule. Then check iptables -L -n to see if its works.

    Problem fixed.

    0 讨论(0)
提交回复
热议问题