Why I can't access remote Jupyter Notebook server?

前端 未结 15 850
清酒与你
清酒与你 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:17

    In RedHat 7, we need to allow the specific port before running the Jupiter command. Say the port is 8080.

    iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT
    

    Then we can run it normally. For instance, using:

    jupyter notebook --ip 0.0.0.0 --no-browser --port=8080 --allow-root
    

    or whatever you like.

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

    Alternatively you can just create a tunnel to the server:

    ssh -i <your_key> <user@server-instance> -L 8888:127.0.0.1:8888
    

    Then just open 127.0.0.1:8888 in your browser.

    You also omit the -i <your_key> if you don't have an identity_file.

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

    edit the following on jupyter_notebook_config file
    enter actual computer IP address
    c.NotebookApp.ip = '192.168.x.x'
    c.NotebookApp.allow_origin = '*'

    on the client side launch jupyter notebook with login password
    jupyter notebook password

    after setting password login on browser and then type the remote server ip address followed by the port. example 192.168.1.56:8889

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

    From your command line, we can see your jupyter server is running normally.The reason you can't access your remote jupyter server is that your remote centos6.5 server's firewall rules block the incoming request from your local browser,i.e. block your tcp:8045 port.
    sudo ufw allow 80 # enable http server
    sudo ufw allow 443 # enable https server
    sudo ufw allow 8045 # enable your tcp:8045 port
    then try to access your jupyter again.


    Maybe you also need to uncomment and edit that place in your jupyter_notebook_config.py file:

    c.NotebookApp.allow_remote_access = True
    

    and even shut down your VPN if you have one.

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

    Is that your private IP address? If so you'll need to use your public one. Go to ipchicken to find out what it is. I know you are in the same LAN, but try this to see if it resolves any issues.

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

    I managed to get the access my local server by ip using the command shown below:

    jupyter notebook --ip xx.xx.xx.xx --port 8888
    

    replace the xx.xx.xx.xx by your local ip of the jupyter server.

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