Could not load org.apache.hadoop.hive.conf.HiveConf. Make sure HIVE_CONF_DIR is set correctly.
18/10/12 00:10:07 ERROR tool.ImportTool: Import failed: java.io.IOException: java.lang.ClassNotFoundException: org.apache.hadoop.hive.conf.HiveConf
Could not load org.apache.hadoop.hive.conf.HiveConf. Make sure HIVE_CONF_DIR is set correctly.
18/10/12 00:10:07 ERROR tool.ImportTool: Import failed: java.io.IOException: java.lang.ClassNotFoundException: org.apache.hadoop.hive.conf.HiveConf
cp hive/lib/hive-common-3.0.0.jar sqoop/lib/
把hive lib 里面的hive-common-xxxx.jar 包 放入 sqoop 的 lib 下面
再导入mysql 表到hive 的时候会报classNotFound 错误,参考 https://blog.csdn.net/quiet_girl/article/details/75160045
https://stackoverflow.com/questions/21599785/sqoop-not-able-to-import-table/21626010#21626010
错误原因:
因为在使用sqoop import命令时,生成的java文件会默认产生在当前目录下,而产生的.jar文件和.class文件会默认存放在/tmp/sqoop-/compile下,两者不在同一文件目录下,导致错误。所以,我们需要将java文件,.jar文件和.class文件放在同一目录下。
解决方法:
为了使数据不存放在根目录下,将产生的文件放在/opt/Hadoop/sqoop-1.4.6/tmp下,我们需要切换至/opt/Hadoop/sqoop-1.4.6/tmp目录下,使用如下命令:
cd /opt/Hadoop/sqoop-1.4.6/tmp
sqoop import --bindir ./ --connect jdbc:mysql://localhost:3306/hadoopguide --username root --password root --table widgets
执行后结果如下:
查看HDFS,发现mysql的widgets表格内容已经导入:
ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
https://blog.csdn.net/xuhao1233344/article/details/79992983
java 的安全策略问题:找到jre包, /Java/jre/lib/security 包下面的 java.policy 文件,编辑他,加上如下 代码
permission javax.management.MBeanTrustPermission "register";
ERROR exec.DDLTask: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectMapper.readerFor(Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/ObjectReader;
把$SQOOP_HOME/lib/jackson*.jar 文件bak, 把对应的$HIVE_HOME/lib/jackson*.jar 对应拷贝到SQOOP/lib 下.