网页上的闪亮服务器错误:发生错误应用程序无法启动。初始化期间退出应用程序

时间:2017-01-29 14:43:06

标签: r amazon-web-services amazon-ec2 shiny shiny-server

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

发生错误

应用程序无法启动。

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

我做了一个sudo闪亮服务器,看看会发生什么,并看到错误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地址和闪亮服务器端口80的请求,因为我认为这两个服务可能不应该监听相同的端口,但这不起作用。我只是试图部署闪亮服务器附带的示例应用程序。

url:http://34.198.107.126/sample-apps/hello/

1 个答案:

答案 0 :(得分:1)

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