如何在 Windows 服务器上托管 Shiny 应用程序? [英] How to host Shiny apps on windows server?

查看:119
本文介绍了如何在 Windows 服务器上托管 Shiny 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一些闪亮的应用程序,我想将这些应用程序提供给一些选定的内部用户,用于测试和持续开发.

I have developed some shiny apps which I want to make available to a few selected internal users for testing purposes and continued development.

在云端或 Shinyapps.io 上部署应用不是一种选择,因为这些应用正在处理敏感的内部数据.

Deploying the apps on the cloud or on shinyapps.io is not an option, as the apps are handling sensitive internal data.

不幸的是,使用 ShinyServer 也不是一种选择,因为我们有严格的仅限 Microsoft 的 IT 架构,因此我只有一台装有 Windows Server 2012 R2 的虚拟机.

Using ShinyServer is unfortunately also not an option, as we have a strict Microsoft only IT architecture and I thus have available only a virtual machine with Windows Server 2012 R2 on it.

我一直在进行一些网络搜索并发现以下内容:

I have been doing some web search and have found out the following:

i.) 我可以在 Windows 机器上托管我的应用程序,如下所述:https://stackoverflow.com/a/44584982/7306540​​.这似乎相当骇人听闻一点也不优雅.它一次只允许托管一个应用程序,我不确定它是否会允许多个并发用户.

i.) I could host my apps on the Windows machine as explained here: https://stackoverflow.com/a/44584982/7306540 . This seems rather hackish and not elegant at all. It would only allow hosting of one app at a time and I am not sure if it would allow several concurrent users at all.

ii.) 我可以使用 Shinyproxy.io,它可能在 Windows 机器上工作,但涉及大量相当复杂的安装以及我不是特别热衷于做的配置工作.

ii.) I could use shinyproxy.io which would possibly work on the Windows machine but involves a fair amount of quite complex installation and configuration work that I am not particularly keen on doing.

iii.) SQLServer 2016 似乎具有某种 R 集成功能.我们目前使用的是 SQLServer2014,有可能升级到 2016原则上.但是,我不知道 SQLServer2016 的R 功能"是否允许托管 Shiny Apps.我找到了这篇博文,https://social.technet.microsoft.com/Forums/windowsserver/en-US/1cf94cbb-c45d-4f8d-8b5e-9d208bfe369a/microsoft-r-server-can-i-host-shiny-apps-yet?forum=MicrosoftR ,但没有答案:

iii.) SQLServer 2016 seems to feature some sort of R integration. We are currently using SQLServer2014 and it would be possible to upgrade to 2016 in principle. However, I don't know if the "R features" of SQLServer2016 would allow hosting of Shiny Apps. I found this blog post, https://social.technet.microsoft.com/Forums/windowsserver/en-US/1cf94cbb-c45d-4f8d-8b5e-9d208bfe369a/microsoft-r-server-can-i-host-shiny-apps-yet?forum=MicrosoftR , but without an answer:

问:有没有人更了解SQLServer2016在这方面的能力?其他选择呢?有没有其他方法可以在 Windows Server 上托管我的应用程序?RStudio 的制造商是否计划添加 Windows 版本的 ShinyServer?还有其他人在做这方面的工作吗?我将不胜感激对此主题的任何见解!

Q: Does anyone know more about the capabilities of SQLServer2016 in this regard? What about other options? Is there any other way to host my apps on the Windows Server? Do the makers of RStudio plan to add a Windows version of ShinyServer? Is anyone else working on this? I would appreciate any insights into this topic!

其他托管选项:

iv.) 我们可以在 Windows Server 上安装 VM,例如Virtual Box 或 VM Player,安装 Linux 和 Shiny Server 并从那里托管.如果 Shiny Apps 需要访问 Windows 机器上的 SQL Server DB,我们可能会在此变体中遇到问题.

iv.) We can install a VM on the Windows Server, e.g. Virtual Box, or VM Player, install Linux and Shiny Server and host from there. We might run into problems in this variant if the Shiny Apps need to access SQL Server DB's on the Windows machine.

i.) 这个变体可以通过使用 (quote @gregL) 来改进:pm2.keymetrics.io,一个通常用于生产中 Node.js 的流程管理器.管道工文档描述了如何将 pm2 与 R 一起使用: rplumber.io/docs/hosting.html#pm2"

i.) This variant could possibly be improved by using (quote @gregL): "pm2.keymetrics.io, a process manager typically used for Node.js in production. The plumber docs describe how you can use pm2 with R: rplumber.io/docs/hosting.html#pm2"

推荐答案

可以在 Windows 上托管 Shiny Apps!

在工作中,我们托管了几个闪亮的生产仪表板,所以这绝对是可能的.您可以通过扩展您提到的 i.) 解决方案并为应用程序使用不同的端口来托管更多 Shiny 应用程序.此处列出了您需要采取的步骤:

At work, we host several production shiny dashboards, so it is definitely possible. You can host more Shiny apps by extending the i.) solution you mentioned, and using different ports for the Apps. The steps that you need to take are listed here:

  • 确保端口在本地(甚至远程)防火墙中为 TCP/IP 连接打开
  • 在启动本地 R 会话的本地机器上运行计划任务",如 i.) 所述,确保任务超时并在需要时重新启动

一旦这些设置到位,您就可以首先在本地测试 Shiny 应用程序,也可以从远程站点测试.编辑闪亮的应用程序也可以在 GUI 中实时完成,但如果您想刷新数据,则必须重新启动 R 命令进程.提示:您还应该有一个索引网页,您可以在其中列出所有正在运行的应用及其端口

Once these settings are in place, you can already test the Shiny App, first locally, and also from the remote station. Editing the shiny app can be done also live, in what the GUI is concerned, but if you want to refresh the data, you will have to restart the R command process. Tip: You should also have an index webpage where you list all running apps with their ports

这篇关于如何在 Windows 服务器上托管 Shiny 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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