shiny server The application failed to start. #問題: #1. 檢查R包的安裝 注:檢查所有安裝的包 #2.修改配置文件

#問題:

An error has occurred\
The application failed to start.

The application exited during initialization.

#1. 檢查R包的安裝

  • 是否調用的所有R包都已安裝

使用root安裝,在個人用戶下安裝是不行的。

$ sudo su - -c "R -e \"install.packages('WGCNA', repos='http://cran.rstudio.com/', dependencies = TRUE)\""

或,下載到本地:

$ su
$ R CMD INSTALL WGCNA_1.69-81.tar.gz

注:檢查所有安裝的包

#2.修改配置文件

  • shiny-server配置
  • shiny-server 配置文件
$ vi  /etc/shiny-server/shiny-server.conf
# Define the user we should use when spawning R Shiny processes
run_as shiny;

# Define a top-level server which will listen on a port
server {
  # Instruct this server to listen on port 3838
  listen 3838;

  # Define the location available at the base URL
  location / {
    #### PRO ONLY ####
    # Only up tp 20 connections per Shiny process and at most 3 Shiny processes
    # per application. Proactively spawn a new process when our processes reach 
    # 90% capacity.
    utilization_scheduler 20 .9 3;
    #### END PRO ONLY ####

    # Run this location in 'site_dir' mode, which hosts the entire directory
    # tree at '/srv/shiny-server'
    site_dir /srv/shiny-server;
    
    # Define where we should put the log files for this location
    log_dir /var/log/shiny-server;
    
    # Should we list the contents of a (non-Shiny-App) directory when the user 
    # visits the corresponding URL?
    directory_index on;
  }
}

# Setup a flat-file authentication system. {.pro}
auth_passwd_file /etc/shiny-server/passwd;

# Define a default admin interface to be run on port 4151. {.pro}
admin 4151 {
  # Only permit the user named `admin` to access the admin interface.
  required_user admin;
}
  • run_as shiny: shiny改爲linux用戶名
  • 檢查app路徑,一般是:/srv/shiny-server;不是這個路徑,就檢查權限,可用chmod修改。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章