无法初始化架构 dbType Derby
hduser1@knime:/usr/local/apache-hive-2.3.6-bin/bin$ schematool -dbType derby -initSchema
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
at org.apache.hadoop.conf.Configuration.set(Configuration.java:1357)
at org.apache.hadoop.conf.Configuration.set(Configuration.java:1338)
at org.apache.hadoop.mapred.JobConf.setJar(JobConf.java:518)
at org.apache.hadoop.mapred.JobConf.setJarByClass(JobConf.java:536)
at org.apache.hadoop.mapred.JobConf.<init>(JobConf.java:430)
at org.apache.hadoop.hive.conf.HiveConf.initialize(HiveConf.java:4045)
at org.apache.hadoop.hive.conf.HiveConf.<init>(HiveConf.java:4008)
at org.apache.hive.beeline.HiveSchemaTool.<init>(HiveSchemaTool.java:82)
at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:1117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.hadoop.util.RunJar.run(RunJar.java:318)
at org.apache.hadoop.util.RunJar.main(RunJar.java:232)
答案1
- 这是由于 Hadoop 公共库和 Hive 库中的 gauva jar 文件的版本不匹配造成的。
根据我的安装位置,下面是执行的命令。步骤 1:通过以下命令在本地复制 Hive jar 文件。
sudo cp /usr/local/apache-hive-2.3.6/lib/guava-14.0.1 homehduser1/hivejar
步骤2:备份旧 jar 文件后,执行以下命令将最新的 jar 文件从 Hadoop 移动到 hive lib 文件夹
cp /usr/local/hadoop/share/hadoop/common/lib/guava-27.0-jre.jar /usr/local/apache-hive-2.3.6-bin/lib