问题1:执行spark-shell进入交互界面时INFO信息过多
解决方法:
cd /usr/local/spark/conf
cp log4j.properties.template log4j.properties
编辑log4j.properties,将“log4j.rootCategory=INFO,console”修改为“log4j.rootCategory=WARN,console”
问题2:训练推荐模型执行val model=ALS.train(ratingsRDD,10,10,0.01)时报java.long.stackoverflowerror
解决方法:
将迭代次数(即第2个10),这个数调低一些,比如修改为9,8,7,...
我这里修改为4,即执行val model=ALS.train(ratingsRDD,10,4,0.01)
问题3:java.lang.ClassNotFoundException: scala.Cloneable
将scala-library-2.11.8.jar拷贝到工程lib目录下
问题4:java.lang.ClassNotFoundException: org.spark_project.guava.cache.CacheLoader
将spark-network-common_2.11-2.1.0.jar复制到lib目录下。
问题5:java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder
将slf4j-log4j12-1.7.16.jar复制到lib目录下
问题6:Caused by: java.lang.ClassNotFoundException: org.apache.log4j.spi.Filter
将log4j-1.2.17.jar添加进去