新网创想网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
本篇内容介绍了“如何修改编译hadoop”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
成都创新互联公司是专业的文登网站建设公司,文登接单;提供网站制作、成都网站建设,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行文登网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!
spark 3.1.x
hive 1.2.x
hadoop 2.6.0-cdh-5.13.1
由于好多公司的yarn集群用的是cdh版本的,用Cloudera Manager管理的。而截止到目前为止,spark的最新版本已经到了3.1.1。而对于cdh 2.6.0-5.13.1来说目前支持的hive版本为1.2.1,所以我们做一下集中尝试:
直接修改pom文件中的hive对应的版本
直接修改编译的hadoop版本
在spark运行的时候,动态加载hive对应的版本包
直接在spark的父pom文件增加如下proflie信息:
hive-1.2 1.2.1 1.2 2.6.0 3.2.10
运行
./dev/make-distribution.sh --name 2.6.0-cdh6.13.1 --pip --tgz -Phive-1.2 -Phive-thriftserver -Pyarn
报错:
[INFO] --- scala-maven-plugin:4.3.0:compile (scala-compile-first) @ spark-hive_2.12 --- [INFO] Using incremental compilation using Mixed compile order [INFO] Compiler bridge file: .sbt/1.0/zinc/org.scala-sbt/org.scala-sbt-compiler-bridge_2.12-1.3.1-bin_2.12.10__52.0-1.3.1_20191012T045515.jar [INFO] compiler plugin: BasicArtifact(com.github.ghik,silencer-plugin_2.12.10,1.6.0,null) [INFO] Compiling 29 Scala sources and 2 Java sources to spark/sql/hive/target/scala-2.12/classes ... [ERROR] [Error] spark/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveShim.scala:29: object SerializationUtilities is not a msmber of package org.apache.hadoop.hive.ql.exec [ERROR] [Error] spark/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveShim.scala:150: not found: value SerializationUtilities [ERROR] [Error] spark/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveShim.scala:154: not found: value SerializationUtilities [ERROR] [Error] spark/sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala:350: too many arguments (4) for constructor SimpleGenericUDAFParameterInfo: (x$1: Array[org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector], x$2: Boolean, x$3: Boolean)org.apache.hadoop.hive.ql.udf.generic.SimpleGenericUDAFParameterInfo [ERROR] four errors found
说明hive1.2.1版本的不兼容
直接修改hadoop的版本为2.6.0-cdh6.13.1
运行如下命令:
./dev/make-distribution.sh --name 2.6.0-cdh6.13.1 --pip --tgz -Phive-1.2 -Phive-thriftserver -Pyarn -Dhadoop.version=2.6.0-cdh6.13.1
报错:
[INFO] --- scala-maven-plugin:4.3.0:compile (scala-compile-first) @ spark-core_2.12 --- [INFO] Using incremental compilation using Mixed compile order [INFO] Compiler bridge file: .sbt/1.0/zinc/org.scala-sbt/org.scala-sbt-compiler-bridge_2.12-1.3.1-bin_2.12.10__52.0-1.3.1_20191012T045515.jar [INFO] compiler plugin: BasicArtifact(com.github.ghik,silencer-plugin_2.12.10,1.6.0,null) [INFO] Compiling 560 Scala sources and 99 Java sources to spark/core/target/scala-2.12/classes ... [ERROR] [Error] spark/core/src/main/scala/org/apache/spark/ui/HttpSecurityFilter.scala:107: type mismatch; found : K where type K required: String [ERROR] [Error] spark/core/src/main/scala/org/apache/spark/ui/HttpSecurityFilter.scala:107: value map is not a member of V [ERROR] [Error] spark/core/src/main/scala/org/apache/spark/ui/HttpSecurityFilter.scala:107: missing argument list for method stripXSS in class XssSafeRequest Unapplied methods are only converted to functions when a function type is expected. You can make this conversion explicit by writing `stripXSS _` or `stripXSS(_)` instead of `stripXSS`. [ERROR] [Error] spark/core/src/main/scala/org/apache/spark/ui/PagedTable.scala:307: value startsWith is not a member of K [ERROR] [Error] spark/core/src/main/scala/org/apache/spark/util/Utils.scala:580: value toLowerCase is not a member of object org.apache.hadoop.util.StringUtils [ERROR] 5 errors found
说明对2.6.0-cdh6.13.1版本的不兼容
根据官网的说明 ,spark从1.4.0 开始就能和不同的hive元数据进行交互,也就是说spark编译的hive内部版本和spark访问hive的元数据是独立的,可以配置不同的hive版本进行对应元数据的访问。
“如何修改编译hadoop”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注创新互联网站,小编将为大家输出更多高质量的实用文章!