您的位置:首页 > 大数据

Rstutio黑科技Sparklyr于Ubantu系统的部署安装与调试

2017-07-10 15:13 369 查看

配置镜像源

deb https://<my.favorite.cran.mirror>/bin/linux/ubuntu zesty/
or
deb https://<my.favorite.cran.mirror>/bin/linux/ubuntu yakkety/
or
deb https://<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/
or
deb https://<my.favorite.cran.mirror>/bin/linux/ubuntu trusty/
or
deb https://<my.favorite.cran.mirror>/bin/linux/ubuntu precise/


在 /etc/apt/sources.list 中添加以上条目之一,

<my.favorite.cran.mirror>


要改成连通性最好的镜像源,关于镜像源可以在R官网上找到

例如: https://mirrors.tuna.tsinghua.edu.cn/CRAN/

安装 R

sudo apt-get update

sudo apt-get install r-base

输入 R 测试

成功安装的话会出现如下字样

R version 3.4.1 (2017-06-30) -- "Single Candle"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
......

用'demo()'来看一些示范程序,用'help()'来阅读在线帮助文件,或
用'help.start()'通过HTML浏览器来看帮助文件。
用'q()'退出R.


输入q() 退出R

安装Rstutio

sudo apt-get install gdebi-core
wget https://download2.rstudio.org/rstudio-server-1.0.143-amd64.deb sudo gdebi rstudio-server-1.0.143-amd64.deb

rstutio-server start


安装完成后通过host:8787打开ui页面

账号密码为linux的登陆账号密码,不能为root账号

登陆root

将/usr/local/lib/R/site-library目录的文件主赋给rstutio登陆账号

chown rstutio_login_user /usr/local/lib/R/site-library


在rstutio中输入 如下 安装sparklyr

install.packages("sparklyr")


输入如下命令,连接到本地或指定host的spark

library(sparklyr)
sc <- spark_connect(master = "local")


远程链接Spark需要在spark环境中的 R配置文件 Renviron.site 中配置SPARK_HOME

例如:SPARK_HOME=/opt/spark/spark-2.0.0-bin-hadoop2.6

关于本地与集群链接spark http://spark.rstudio.com/deployment.html

关于sparklyr的安装与示例 http://spark.rstudio.com/

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息