centos 7.9.2009中安装 R、Rstudio-server
1、查看系统
[root@centos7pc1 software]# lsb_release -a LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch Distributor ID: CentOS Description: CentOS Linux release 7.9.2009 (Core) Release: 7.9.2009 Codename: Core
2、测试R
[root@centos7pc1 software]# R
bash: R: command not found...
3、安装:epel-release
[root@centos7pc1 software]# yum install epel-release
4、安装R
[root@centos7pc1 software]# yum install R
5、测试R
[root@centos7pc1 software]# R
没有问题。
二、安装Rstudio-server
1、下载Rstudio-server安装包
下载地址:https://www.rstudio.com/products/rstudio/download-server/redhat-centos/
[root@centos7pc1 Rstudio]# wget https://download2.rstudio.org/server/centos7/x86_64/rstudio-server-rhel-2022.02.2-485-x86_64.rpm --2022-05-02 11:44:31-- https://download2.rstudio.org/server/centos7/x86_64/rstudio-server-rhel-2022.02.2-485-x86_64.rpm Resolving download2.rstudio.org (download2.rstudio.org)... 54.192.19.114, 54.192.19.79, 54.192.19.5, ... Connecting to download2.rstudio.org (download2.rstudio.org)|54.192.19.114|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 72085156 (69M) [application/x-redhat-package-manager] Saving to: ‘rstudio-server-rhel-2022.02.2-485-x86_64.rpm’ 100%[===========================================================================================>] 72,085,156 26.9MB/s in 2.6s 2022-05-02 11:44:36 (26.9 MB/s) - ‘rstudio-server-rhel-2022.02.2-485-x86_64.rpm’ saved [72085156/72085156] [root@centos7pc1 Rstudio]# ls rstudio-server-rhel-2022.02.2-485-x86_64.rpm
2、安装
[root@centos7pc1 Rstudio]# yum install rstudio-server-rhel-2022.02.2-485-x86_64.rpm
3、查看Rstudio状态
[root@centos7pc1 Rstudio]# systemctl status rstudio-server.service ● rstudio-server.service - RStudio Server Loaded: loaded (/usr/lib/systemd/system/rstudio-server.service; enabled; vendor preset: disabled) Active: active (running) since Mon 2022-05-02 11:45:49 CST; 3min 45s ago Process: 88009 ExecStart=/usr/lib/rstudio-server/bin/rserver (code=exited, status=0/SUCCESS) Main PID: 88010 (rserver) Tasks: 3 CGroup: /system.slice/rstudio-server.service └─88010 /usr/lib/rstudio-server/bin/rserver May 02 11:45:49 centos7pc1 systemd[1]: Starting RStudio Server... May 02 11:45:49 centos7pc1 systemd[1]: Started RStudio Server.
4、查看本机IP
[root@centos7pc1 Rstudio]# ifconfig | head ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.65.152 netmask 255.255.255.0 broadcast 192.168.65.255 inet6 fe80::cf50:d12:760f:c2f1 prefixlen 64 scopeid 0x20<link> ether 00:0c:29:c5:9b:14 txqueuelen 1000 (Ethernet) RX packets 718872 bytes 1045253529 (996.8 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 81629 bytes 10828364 (10.3 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
5、登录测试IP+8787端口:本机IP:8787
报错了:
6 、开启防火墙8787端口
[root@centos7pc1 Rstudio]# firewall-cmd --permanent --zone=public --add-port=8787/tcp success [root@centos7pc1 Rstudio]# firewall-cmd --reload success
7、再次登录测试
输入普通用户及密码:
没有问题。