gpt4 book ai didi

r - 网页上的 Shiny 服务器错误 : An error has occurred The application failed to start. 应用程序在初始化期间退出

转载 作者:行者123 更新时间:2023-12-02 01:17:33 25 4
gpt4 key购买 nike

我正在尝试在我的 Amazon Linux AWS EC2 实例上设置 R Shiny Server 并收到以下错误:

发生了错误

应用程序无法启动。

应用程序在初始化期间退出。

我做了一个 sudo Shiny-server 来看看会发生什么并看到错误 EADDRINUSE:

$ sudo shiny-server
[2017-01-29 13:21:22.724] [INFO] shiny-server - Shiny Server v1.5.1.834 (Node.js v6.9.1)
[2017-01-29 13:21:22.728] [INFO] shiny-server - Using config file "/etc/shiny-server/shiny-server.conf"
[2017-01-29 13:21:22.764] [INFO] shiny-server - Starting listener on 0.0.0.0:80
[2017-01-29 13:21:22.771] [ERROR] shiny-server - HTTP server error (0.0.0.0:80): listen EADDRINUSE 0.0.0.0:80
[2017-01-29 13:21:22.771] [INFO] shiny-server - Shutting down worker processes

我已验证 Shiny、rmarkdown 和 Shiny Server 和 R 已正确安装在我的实例上:
R --version
R version 3.2.2 (2015-08-14) -- "Fire Safety"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
http://www.gnu.org/licenses/.

> library(shiny)
> library(rmarkdown)
>

我还检查了我的 ec2 实例上的网络连接:
$ sudo netstat --tcp -nlpa | grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1875/shiny-server

我的 ec2 实例网络安全组:
$ aws ec2 describe-security-groups --group-name launch-wizard-7
{
"SecurityGroups": [
{
"IpPermissionsEgress": [
{
"IpProtocol": "-1",
"PrefixListIds": [],
"IpRanges": [
{
"CidrIp": "0.0.0.0/0"
}
],
"UserIdGroupPairs": [],
"Ipv6Ranges": []
}
],
"Description": "launch-wizard-7 created 2017-01-28T14:22:51.817-05:00",
"IpPermissions": [
{
"PrefixListIds": [],
"FromPort": 80,
"IpRanges": [
{
"CidrIp": "0.0.0.0/0"
}
],
"ToPort": 80,
"IpProtocol": "tcp",
"UserIdGroupPairs": [],
"Ipv6Ranges": []
},

(还有另一个条目,但 ssh 进入我自己的机器,所以我不会把这些信息)

这是来自/etc/shiny-server/shiny-server.conf 的我的 Shiny-server.conf 文件
$ cat /etc/shiny-server/shiny-server.conf
# Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;

# Define a server that listens on port 3838
server {
listen 3838;

# Define a location at the base URL
location / {

# Host the directory of Shiny Apps stored in this directory
site_dir /srv/shiny-server;

# Log all Shiny output to files in this directory
log_dir /var/log/shiny-server;

# When a user visits the base URL rather than a particular application,
# an index of the applications available in this directory will be shown.
directory_index on;
}
}

任何帮助将非常感激。我试图让 AWS 为所有 IP 地址和 Shiny 的服务器监听端口 80 的请求,因为我认为这两种服务不应该监听相同的端口,但这没有用。我只是想部署 Shiny 的服务器附带的示例应用程序。

网址: http://34.198.107.126/sample-apps/hello/

最佳答案

没关系,弄清楚它是什么;一切都设置正确,但我的 r 包不是作为 root 安装的,而是作为 ec2-user 安装的;以 root 身份安装,因为网页/文​​件夹权限主要是 root。

关于r - 网页上的 Shiny 服务器错误 : An error has occurred The application failed to start. 应用程序在初始化期间退出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41922113/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com