官方下载地址:https://posit.co/download/rstudio-server/
root账号安装:
wget https://download2.rstudio.org/server/centos7/x86_64/rstudio-server-rhel-2022.07.2-576-x86_64.rpm sudo yum install rstudio-server-rhel-2022.07.2-576-x86_64.rpm
启动R 服务:
rstudio-server start #启动RStudio
rstudio-server status #查看RStudio状态
设置使用的R版本:
vi /etc/rstudio/rserver.conf
#设置内容如下:
# Server Configuration File
rsession-which-r=/share/work/biosoft/R/R-v4.0.3/bin/R rsession-ld-library-path=/share/work/biosoft/gcc/gcc-v6.4.0/lib64/:/usr/lib:/usr/lib64:/share/work/biosoft/bamtools/bamtools-v2.4.0/lib/:/share/work/biosoft/gcc/gcc-v6.4.0/lib64/:/share/work/biosoft/gcc/gcc-v6.4.0/lib/:/share/work/biosoft/boost/boost.1.64/lib/:/share/work/biosoft/lib/atlas/:/share/work/biosoft/lib:/share/work/biosoft/Root/root/lib/:/share/work/biosoft/gsl/gsl-2.1/lib/:/share/work/biosoft/gcc/gcc-v4.7.3/lib64/:/share/work/biosoft/R/R-v3.5.0/bin/:/share/work/biosoft/gcc/gcc-v6.4.0/lib64/:/share/work/biosoft/mpc/mpc-v1.0.2/lib/:/share/work/biosoft/cufflinks/samtools-0.1.18/htslib-1.3.2/htslib:/share/work/biosoft/samtools/htslib/:/share/work/biosoft/lib/atlas/:/share/work/biosoft/lib:/share/work/biosoft/Root/root/lib/:/share/work/biosoft/gsl/gsl-2.1/lib/:/share/work/biosoft/gcc/gcc-v4.7.3/lib64/:/share/work/biosoft/zlib/lib/:/share/work/biosoft/boost/boost.1.50/lib:/share/work/biosoft/xz/xz-v5.2.3/lib:/opt/gridengine/lib/lx-amd64:/opt/openmpi/lib
#如果启动报错,可能是centos系统selinux防火墙导致;
2022-09-29T02:51:45.397167Z [rserver] ERROR Error reading R script (/share/work/biosoft/R/R-v4.2.1/bin/R), system error 2 (No such file or directory); LOGGED FROM: bool rstudio::core::r_util::{anonymous}::detectRLocationsUsingScript(const rstudio::core::FilePath&, rstudio::core::FilePath*, rstudio::core::FilePath*, rstudio::core::config_utils::Variables*, std::__cxx11::string*, const string&) src/cpp/core/r_util/REnvironmentPosix.cpp:426
设置一下即可解决,端口开通
sudo firewall-cmd --query-port=8787/tcp
sudo firewall-cmd --zone=public --add-port=8787/tcp --permanent
sudo firewall-cmd --reload
sudo firewall-cmd --zone=public --list-ports
#selinux设置
setenforce 0
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!