CaffeOnSpark 安装遇到的一系列问题

本文记录了在安装CaffeOnSpark过程中遇到的挑战,包括Hadoop集群配置错误(JAVA_HOME未设置,HDFS目录问题),Spark集群启动问题(Master启动参数错误),CMake和OpenCV安装问题(CUDA版本冲突,OpenCV下载链接失效),以及Caffe和CaffeOnSpark编译问题(库文件缺失,Makefile配置不一致,maven和protobuf版本问题,scala版本不兼容)。通过逐一排查和调整,最终解决了所有问题。

入职虹软第一天:任务搭建一个搭建一个CaffeOnSpark的测试集群 ,状态:未完成。

遇到的问题:
1在搭建 Hadoop 集群的时候,按照配置执行完两个重要的配置:core-site.xml 和 hdfs-site.xml
然后运行命令: ./bin/hdfs namenode -format
出现这样的错误:
提示 Error: JAVA_HOME is not set and could not be found.
原因: 在hadoop-env.sh 中没有设置导入本地 java 环境
解决方法: hadoop-env.sh 中把export JAVA_HOME = ${JAVA_HOME} 修改:
Export JAVA_HOME = /usr/local/java/jdk1.8.0_141 (自己的本地环境,解决)

2 在启动hdfs 的时候,namenode 无法启动,secondaryNode 启动 datanode 启动,查看日志: Directory /tmp/hadoop-javoft/dfs/name is in an inconsistent state: storage directory does not exist or is not accessible.
原因: 需要在对应的目录下 创建 tmp 文件夹
深层原因: core-site.xml 中配置了:

    <property>
        <name>hadoop.tmp.dir</name>
        <value>/usr/hadoop/tmp</value>
        (备注:请先在 /usr/hadoop 目录下建立 tmp 文件夹)
        <description>A base for other temporary directories.</description>
    </property>

tmp 目录,注意:一定要写对路径。。。

Day 2 :
启动spark 集群的时候发现就一个 worker 启动了,在失效节点上 jps 命令显示:

8656 DataNode
8785 NodeManager
9000 Worker
9066 Jps

过了一会再次 jps 命令如下:

8656 DataNode
8785 NodeManager
9110 Jps

在web 端用8080 端口查看时也只显示一个 worker active
调用 失效节点的 log 显示:

17/10/19 09:09:23 INFO Worker: Retrying connection to master (attempt # 16)
17/10/19 09:09:23 INFO Worker: Connecting to master c1:7077...
17/10/19 09:09:23 WARN Worker: Failed to connect to master c1:7077
org.apache.spark.SparkException: Exception thrown in awaitResult:
无法连接到xxx.xxx.xxx.xx:7077

在网上尝试找了很多方法行不通,最终解决方法: 添加master 启动参数
./sbin/start-master.sh -h master_ip (如:./sbin/start-master.sh –h 172.17.11.68)
按这种方式启动 master 后 在slave 上打这些命令:
./sbin/start-slave.sh spark://172.17.11.68:7077 发现成功启动,在对应的 8088 web 页面也看到的到 worker 的存在。。。

结论:用-h参数启动Master,连接到Master的UI,确保URL是spark://master_ip:7077,而非spark://host_name:7077。这样Slave连接Master的问题不会再出现。

备注: 我在失效的节点上 用 nmap 命令连接 master:7077 端口,发现 端口是 closed的
在 主机上用 netstat –anp 查看所有的端口发现 7077 是 tcp6 并且是 监听状态。。。一直以为是端口被关闭造成的,很尴尬
(参考:http://blog.youkuaiyun.com/ybdesire/article/details/70666544

安装 cmake 时出错:

arcsoft@c1:/usr/cmake$ ./bootstrap 
-bash: ./bootstrap: No such file or directory
arcsoft@c1:/usr/cmake$ sudo ./bootstrap
sudo: ./bootstrap: command not found
arcsoft@c1:/usr/cmake$ make
make: *** No targets specified and no makefile found.  Stop.

现在尝试把版本换成3.9 发现3.9不行,在安装包中没有 bootstrap 文件,现在换包 3.9-cmake-tar.gz 重新尝试,成功。

安装 OpenCV 3.2 时尝试 cmake 发生如下错误:

CMake Error at 3rdparty/ippicv/downloader.cmake:77 (message):
  ICV: Failed to download ICV package: ippicv_linux_20151201.tgz.
  Status=1;"Unsupported protocol"
Call Stack (most recent call first):
  3rdparty/ippicv/downloader.cmake:110 (_icv_downloader)
  cmake/OpenCVFindIPP.cmake:243 (include)
  cmake/OpenCVFindLibsPerf.cmake:37 (include)
  CMakeLists.txt:558 (include)

错误原因: 在OpenCV 目录下的 3rdparty/ippicv/download/目录下有一个 ippcv_linux_20151201.tgz 文件失效了,去网上重新下一个,解决此bug

过了一会再次尝试 的时候:

Error copying file (if different) from "/usr/opencv/version_string.tmp" to "/usr/opencv/modules/core/version_string.inc".
CMake Warning at CMakeLists.txt:1356 (message):
  The source directory is the same as binary directory.  "make clean" may
  damage the source tree
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake 
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值