在没有连接的情况下调用Jupyterhub内的Web服务器失败 [英] Calling a web server inside Jupyterhub without connection failed

查看:210
本文介绍了在没有连接的情况下调用Jupyterhub内的Web服务器失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是:JupyterHub中的Shiny R代码迷你Web服务器如何在该服务器之外(即<> localhost)工作?

My question is : How this Shiny R code mini web server in JupyterHub could work outside this server (i.e. <> localhost) ?

ui <- fluidPage(
    textInput("caption", "Caption", "Data Summary"),
    verbatimTextOutput("value")
)

server <- function(input, output) {
    output$value <- renderText({ input$caption })
}

shinyApp(ui, server)
Listening on http://127.0.0.1:4844

它可以在本地服务器(127.0.0.1:4844)上运行,但是我不能在 http://上运行192.168.xx:4844

It works on the local server (127.0.0.1:4844) , but I doesn't work on http://192.168.x.x:4844

有关信息.我已经在Ubuntu 16.04 xenial上安装了带有R内核的Jupyter和Jupyter Hub.我还安装了Shiny Server和RStudio Server.一切正常.我的防火墙关闭并且我有Apache2.

For information. I've installed Jupyter and Jupyter Hub, with R Kernel, on Ubuntu 16.04 xenial. I've also installed Shiny Server and RStudio Server. Everything works fine. My firewall is off and I have Apache2.

我已经在另一台从Jupyterhub调用的小型Web服务器上看到此错误,这意味着Shiny.相同的代码可在Rstudio Server IDE中使用.

I've seen this error on an other mini web server called from Jupyterhub in other mean that Shiny. The same code works in Rstudio Server IDE.

问题出在Jupyter Hub或Shiny Server的配置中,还是在Apache 2或其他地方?

The problem is in the configuration of Jupyter Hub or Shiny Server or in Apache 2 or elsewhere ?

您正在使用Jupyter笔记本.笔记本服务器的版本为:5.4.0 服务器正在以下版本的Python上运行:Python 3.6.4 | Anaconda,Inc. | (默认值,2018年1月16日,18:10:19)[GCC 7.2.0])".

"You are using Jupyter notebook. The version of the notebook server is: 5.4.0 The server is running on this version of Python: Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19) [GCC 7.2.0])".

谢谢.

推荐答案

默认情况下,发光的应用程序在127.0.0.1(localhost)上侦听,只有本地计算机可以访问.要使其他机器可以访问应用程序,可以将host选项设置为0.0.0.0:

Shiny apps listen on 127.0.0.1 (localhost) by default, which only the local machine can access. To make an app accessible to other machines, you can set the host option to 0.0.0.0:

options(shiny.host = "0.0.0.0")

runApp(host = "0.0.0.0")

请参见 https://shiny.rstudio.com/reference/shiny/最新的/runApp.html 以获取更多详细信息.

See https://shiny.rstudio.com/reference/shiny/latest/runApp.html for more details.

这篇关于在没有连接的情况下调用Jupyterhub内的Web服务器失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆