我是root用户,环境是CentOS-7-x86_64-Everything-1611.iso。

查看系统版本

cat /proc/version

Linux系统分为两种:

1.RedHat系列:Redhat、Centos、Fedora等

2.Debian系列:Debian、Ubuntu等

RedHat系列的包管理工具是yum

Debian系列的包管理工具是apt-get

我这里是yum

首先安装R服务。

(1)安装依赖
yum -y install gcc glibc-headers gcc-c++ gcc-gfortran readline-devel libXt-devel bzip2-devel xz-devel perl* pcre* zlib-devel libcurl-devel

(2)安装R
http://cran.rstudio.com/src/base/R-3/R-3.4.2.tar.gz
tar -zxvf R-3.4.2.tar.gz
cd R-3.4.2
mkdir /usr/local/R
./configure --enable-R-shlib=yes --with-tcltk --prefix=/usr/local/R
make
make install
(3)配置环境变量 全局配置:
vi /etc/profile
#add R env
R_HOME=/usr/local/R
PATH= P A T H : PATH: PATH:R_HOME/bin
export PATH
source /etc/profile
(4)安装R运算依赖的包
rpm依赖包:
yum -y install ./*.rpm
运算依赖包:
chmod u+x ./install.sh
./install.sh

(5)安装好以后查看R版本
sudo -i R
Linux安装,卸载R服务及Rstudio。 表示安装成功。

安装Rstudio-Serve

下载版本:
wget http://download2.rstudio.org/rstudio-server-rhel-0.99.903-x86_64.rpm
安装:
sudo yum install --nogpgcheck rstudio-server-rhel-0.99.903-x86_64.rpm
查看是否安装正确
sudo rstudio-server verify-installation

如果找不到R服务:
Unable to find an installation of R on the system (which R didn’t return valid output); Unable to locate R binary by scanning standard locations

执行 which R 找到你的R的安装目录

需要配置一下:
cd 到/etc/rstudio/rserver.conf
www-port=8787

rsession-which-r=R语言的安装目录/bin/R

重启即可。

通过浏览器访问Rstudio
IP为:http://<服务器ip>:8787
Linux安装,卸载R服务及Rstudio。
这里需要我们输入用户名和密码。关于用户名有2点注意事项:
(1).不允许使用system 用户登陆,即用户ids小于100的用户。只能用普通用户登录
(2).用户的认证可以使用RSA。
如果没有普通用户,可以添加:
useradd newname # 添加一个名为newname的用户
passwd newname ###给新用户newname 设置密码,密码需是复杂密码,否则可能通不过。
usermod -G happy newname ####将新用户newname添加到happy 用户组中

一些命令

完成安装后,RStudio Server会自动启动运行
ps -aux|grep rstudio
8787端口被打开

启动Rstudio-server
rstudio-server start #启动
rstudio-server stop #停止
rstudio-server restart #重启

查看运行中R进程
rstudio-server active-sessions

指定PID,停止运行中的R进程
rstudio-server suspend-session

停止所有运行中的R进程
rstudio-server suspend-all

强制停止运行中的R进程,优先级最高,立刻执行
rstudio-server force-suspend-session
rstudio-server force-suspend-all
RStudio Server临时下线,不允许web访问,并给用户友好提示
rstudio-server offline
RStudio Server临时上线
rstudio-server online

卸载rstudio

//名称和简介匹配 only,使用“search all”试试。
yum list |grep ‘rstudio’

//卸载
yum remove rstudio-server.x86_64 -y

相关文章:

  • 2021-11-13
  • 2022-12-23
  • 2021-04-08
  • 2021-12-10
  • 2021-11-29
  • 2021-12-27
  • 2021-09-09
猜你喜欢
  • 2022-12-23
  • 2021-12-30
  • 2021-12-09
  • 2021-05-23
  • 2022-12-23
  • 2022-01-13
  • 2021-12-13
相关资源
相似解决方案