---恢复内容开始---

环境配置——

  • 操作系统:CentOS 6.5
  • JDK版本:1.7.0_67
  • Hadoop集群版本:CDH 5.3.0

安装过程——

1、(1)安装R

yum install -y R

(2)出现问题:

yum 安装软件时,报错:No package XXX available.

[root@localhost ~]# yum -y install redis
Loaded plugins: fastestmirror
No package redis available.
Nothing to do
(3)解决方案

配置一台CentOS 7.x或RHEL 7.x的系统使用Fedora EPEL  repos和第三方软件包安装各种软件包。请注意,这些软件包没有正式获得任何的CentOS或Red Hat的支持,但提供了许多流行的包和应用程序。

显示以上错误,有以下2种原因:

1、dns问题;

2、镜像连接错误;

DNS问题

首先测试下网络连接,如果ping不通,需要设置下DNS。

[root@localhost ~]# ping www.baidu.com
XXXXXXXXXXXXXXXXX
[root@localhost ~]# echo "nameserver 8.8.8.8">>/etc/resolv.conf

再次ping即可ping通了。

镜像连接错误问题

具体原因:使用yum搜索某些rpm包,找不到包是因为CentOS是RedHat企业版编译过来的,去掉了所有关于版权问题的东西。安装EPEL后可以很好的解决这个问题。EPEL(Extra Packages for Enterprise Linux )即企业版Linux的扩展包,提供了很多可共Centos使用的组件,安装完这个以后基本常用的rpm都可以找到。

Method #1 » 从企业版Linux库配置包中安装扩展包。(推荐 )

[root@localhost ~]# sudo yum install epel-release
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-5 will be installed
--> Finished Dependency Resolution Dependencies Resolved ================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
epel-release noarch 7-5 extras 14 k Transaction Summary
================================================================================
Install 1 Package Total download size: 14 k
Installed size: 24 k
Is this ok [y/d/N]: y
Downloading packages:
epel-release-7-5.noarch.rpm | 14 kB 00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : epel-release-7-5.noarch 1/1
Verifying : epel-release-7-5.noarch 1/1 Installed:
epel-release.noarch 0:7-5 Complete!
(4)最后运行下列代码 即可完成安装
yum install -y R

2、安装curl-devel(非常重要!否则无法进行RCurl包的安装,进而无法安装devtools)

yum install -y curl-devel


3.在R shell中安装devtools
install.packages("RCurl")
install.packages("devtools")

install.packages("devtools")


出现错误:

[plain] view plain copy
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
* deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
* rpm: libcurl-devel (Fedora, CentOS, RHEL)
* csw: libcurl_dev (Solaris)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘curl’
* removing ‘/home/jifeng/R/x86_64-unknown-linux-gnu-library/3.1/curl’
* installing *source* package ‘whisker’ ...
** package ‘whisker’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (whisker)
* installing *source* package ‘digest’ ...
** package ‘digest’ successfully unpacked and MD5 sums checked
** libs [plain] view plain copy
configure: error: in `/tmp/RtmpkQMD9t/R.INSTALL6c1166a0db0e/git2r':
configure: error:
---------------------------------------------
OpenSSL library required Please install:
libssl-dev (deb) or openssl-devel (rpm)
---------------------------------------------
See `config.log' for more details
ERROR: configuration failed for package ‘git2r’
* removing ‘/home/jifeng/R/x86_64-unknown-linux-gnu-library/3.1/git2r’
* installing *source* package ‘stringr’ ...
** package ‘stringr’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (stringr)
* installing *source* package ‘xml2’ ...
** package ‘xml2’ successfully unpacked and MD5 sums checked
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lxml2
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libxml-2.0 was not found. Try installing:
* deb: libxml2-dev (Debian, Ubuntu, etc)
* rpm: libxml2-devel (Fedora, CentOS, RHEL)
* csw: libxml2_dev (Solaris)
If libxml-2.0 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libxml-2.0.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘xml2’
* removing ‘/home/jifeng/R/x86_64-unknown-linux-gnu-library/3.1/xml2’
* installing *source* package ‘memoise’ ...
** package ‘memoise’ successfully unpacked and MD5 sums checked
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (memoise)
ERROR: dependency ‘curl’ is not available for package ‘httr’
* removing ‘/home/jifeng/R/x86_64-unknown-linux-gnu-library/3.1/httr’
* installing *source* package ‘evaluate’ ...
** package ‘evaluate’ successfully unpacked and MD5 sums checked
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (evaluate)
* installing *source* package ‘roxygen2’ ...
** package ‘roxygen2’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/local/lib64/R/include -DNDEBUG -I/usr/local/include -I"/home/jifeng/R/x86_64-unknown-linux-gnu-library/3.1/Rcpp/include" -fpic -g -O2 -c RcppExports.cpp -o RcppExports.o
g++ -I/usr/local/lib64/R/include -DNDEBUG -I/usr/local/include -I"/home/jifeng/R/x86_64-unknown-linux-gnu-library/3.1/Rcpp/include" -fpic -g -O2 -c isComplete.cpp -o isComplete.o
g++ -I/usr/local/lib64/R/include -DNDEBUG -I/usr/local/include -I"/home/jifeng/R/x86_64-unknown-linux-gnu-library/3.1/Rcpp/include" -fpic -g -O2 -c leadingSpaces.cpp -o leadingSpaces.o
g++ -I/usr/local/lib64/R/include -DNDEBUG -I/usr/local/include -I"/home/jifeng/R/x86_64-unknown-linux-gnu-library/3.1/Rcpp/include" -fpic -g -O2 -c parser.cpp -o parser.o
g++ -I/usr/local/lib64/R/include -DNDEBUG -I/usr/local/include -I"/home/jifeng/R/x86_64-unknown-linux-gnu-library/3.1/Rcpp/include" -fpic -g -O2 -c wrapString.cpp -o wrapString.o
g++ -shared -L/usr/local/lib64 -o roxygen2.so RcppExports.o isComplete.o leadingSpaces.o parser.o wrapString.o -L/usr/local/lib64/R/lib -lR
installing to /home/jifeng/R/x86_64-unknown-linux-gnu-library/3.1/roxygen2/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (roxygen2)
ERROR: dependencies ‘curl’, ‘xml2’ are not available for package ‘rversions’
* removing ‘/home/jifeng/R/x86_64-unknown-linux-gnu-library/3.1/rversions’
ERROR: dependencies ‘httr’, ‘curl’, ‘rversions’, ‘git2r’ are not available for package ‘devtools’
* removing ‘/home/jifeng/R/x86_64-unknown-linux-gnu-library/3.1/devtools’ The downloaded source packages are in
‘/tmp/Rtmp1A16li/downloaded_packages’
Warning messages:
1: In install.packages("devtools") :
installation of package ‘curl’ had non-zero exit status
2: In install.packages("devtools") :
installation of package ‘git2r’ had non-zero exit status
3: In install.packages("devtools") :
installation of package ‘xml2’ had non-zero exit status
4: In install.packages("devtools") :
installation of package ‘httr’ had non-zero exit status
5: In install.packages("devtools") :
installation of package ‘rversions’ had non-zero exit status
6: In install.packages("devtools") :
installation of package ‘devtools’ had non-zero exit status 根据错误安装,我这里安装了 [plain] view plain copy
[root@feng03 ~]# yum install libcurl-devel
[root@feng03 ~]# yum install openssl-devel
[root@feng03 ~]# yum install libxml2-devel 进入R shell
>install.packages("git2r")
>install.packages("xml2")
>install.packages("rversions")

  

步骤4: 安装好rJava及devtools,接下来安装SparkR


library(devtools)
install_github("amplab-extras/SparkR-pkg", subdir="pkg")
出现错误
Launching sbt from sbt/sbt-launch-0.13.6.jar
Error: Invalid or corrupt jarfile sbt/sbt-launch-0.13.6.jar
make: *** [target/scala-2.10/sparkr-assembly-0.1.jar] 错误 1
ERROR: compilation failed for package ‘SparkR’
* removing ‘/home/ndscbigdata/R/x86_64-pc-linux-gnu-library/3.2/SparkR’
错误: Command failed (1)

解决:

进入spark安装包中的R目录,直接输入如下命令,直接就DONE了。
 
cd进入目录

/data1/bigdata/spark-1.6.1/R/lib/SparkR

 R -e "devtools::install('.')"

---恢复内容结束---

centos 部署 SparkR的更多相关文章

  1. 跳过 centos部署 webpy的各种坑

    用centos部署webpy发现的各种坑: 1.python 版本: 2.中文编码: 3.web模块路径: 在命令行里输入python,能import web,但是网站错误报告一直报告没有找到web模 ...

  2. 【Linux】Centos部署MySQL

    将CentOS部署MySQL需要本地配置环境.本地编译MySQL,耗时较长的情况,优化为编译成型MySQL并打包,推送并按配置部署. 首先需要在一台机器配置好环境,搭个YUM源,并将所需要的包取出备用 ...

  3. Tigase XMPP Server在CentOS部署和配置

    Tigase XMPP Server在CentOS部署与配置 作者:chszs,转载需注明.博客主页:http://blog.csdn.net/chszs 以下讲述Tigase XMPP Server ...

  4. SpringBoot入门教程(二)CentOS部署SpringBoot项目从0到1

    在之前的博文<详解intellij idea搭建SpringBoot>介绍了idea搭建SpringBoot的详细过程, 并在<CentOS安装Tomcat>中介绍了Tomca ...

  5. 为什么使用centos部署服务器

    这个是实验室同学面试的时候,面试官问的一个问题? 为什么选择centos系统,为什么centos系统用的比较多呢? 首先我们说下redhat红帽公司,它是全球最大的linux服务提供商,它的服务是最好 ...

  6. CentOS下SparkR安装部署:hadoop2.7.3+spark2.0.0+scale2.11.8+hive2.1.0

    注:之前本人写了一篇SparkR的安装部署文章:SparkR安装部署及数据分析实例,当时SparkR项目还没正式入主Spark,需要自己下载SparkR安装包,但现在spark已经支持R接口,so更新 ...

  7. hadoop集群搭建--CentOS部署Hadoop服务

    在了解了Hadoop的相关知识后,接下来就是Hadoop环境的搭建,搭建Hadoop环境是正式学习大数据的开始,接下来就开始搭建环境!我们用到环境为:VMware 12+CentOS6.4 hadoo ...

  8. CentOS部署yapi

    转载自 https://www.linuxidc.com/Linux/2018-01/150513.htm 在mongoDB添加yum源时,源路径有修改,原文中的路径404不可用 一.准备工作 1.1 ...

  9. netcore项目在Centos部署:nohup和supervisor方式

    Centos上部署netcore项目 1 准备工作 在Centos上部署netcore应用程序有两种常用方式:nohup和supervisord,这里简单演示一下这两种部署方式. 首先我们写一个简单的 ...

随机推荐

  1. Linux时间子系统(十二) periodic tick

    一.tick device概念介绍 1.数据结构 在内核中,使用struct tick_device来抽象系统中的tick设备,如下: struct tick_device {     struct ...

  2. jquery 事件注冊 与反复事件处理

    <!doctype html> <html lang="us"> <head> <meta charset="utf-8&quo ...

  3. MFC改变对话框背景颜色

    原文链接: http://blog.sina.com.cn/s/blog_59955afc0100spjz.html 方法一:调用CWinApp类的成员函数SetDialogBkColor来实现. - ...

  4. 使用dockerfile 构建springboot 的docker镜像

    1 新建一个 springboot 项目,并将其打包成 jar 文件.生成demo1.jar 文件 请参考 使用springBoot搭建REATFul风格的web demo 2 编写 dockerfi ...

  5. cocos2dx 3.x避免空customCommand

    1,导致性能悲剧的写法: class A:public CCNode{ public: A(){ m_sprite=NULL; m_isDrawDebug=false; } virtual~A(){} ...

  6. 深入理解Docker Volume(二)

      一开始,认为Volume是用来持久化的,但是这实际上不对,因为认为Volume是用来持久化的同学一定是认为容器无法持久化,所以有了Volume来帮助容器持久化,事实上,容器会一直存在,除非你删除他 ...

  7. 【VBA研究】浮点数计算总是有误差的

    作者:iamlaosong 数字有两种表达方式.一种是整数,一种是浮点数.浮点数是属于有理数中某特定子集的数的数字表示,在计算机中用以近似表示随意某个实数.详细的说,这个实数由一个整数或定点数(即尾数 ...

  8. vim+cscope简易教程

    Cscope具有纯正的Unix血统,它最早是由贝尔实验室为PDP-11计算机开发的,后来成为商用的AT&T Unix发行版的组成部分.直到2000年4月,这个工具才由SCO公司以BSD lic ...

  9. 使用 JavaScript 实现对 PDF 的全文索引

    Mozilla实验室最近已经收到了许多为一个项目做出的尝试,这一项目的野心令人印象深刻:在一个浏览器中仅仅使用Javascript来对PDF进行渲染.PDF文档的结构令人难以置信的复杂,因此要祝pdf ...

  10. Modbus 通讯协议

    摘要 工业控制已从单机控制走向集中监控.集散控制,如今已进入网络时代,工业控制器连网也为网络管理提供了方便.Modbus就是工业控制器的网络协议中的一种. 关键词 Modbus协议,串行通信,LRC校 ...