After sqoop installed, also need some pit father's configuration, the process under the record where Jin and encountered trouble:
1. Download sqoop driver package and add mysql
http://mirror.bit.edu.cn/apache/sqoop/, download, download as sqoop-1.4.7.bin__hadoop-2.6.0.tar.gz,
The MySQL (db driver package or other) into the lib Sqoop directory. The mysql-connector-java-5.1.38.tar.gz.
2. Configure Environment Variables
2.1 should HADOOP_MAPRED_HOME added to the system environment, otherwise it will error /usr/software/sqoop/bin/../../hadoop/mapreduce does not exist!
Need vi / etc / profiles plus
SQOOP_HOME=/usr/software/hadoop
export HADOOP_MAPRED_HOME=/usr/software/hadoop export SQOOP_HOME=/usr/software/hadoop
2.2 The following is not a default configuration, the configuration can not feel, when necessary, can be configured, it inside HADOOP_MAPRED_HOME, HIVE_HOME and so on with a good to
/usr/software/sqoop/conf/sqoop-env.sh
3. Other configuration
3.1===
Could not load org.apache.hadoop.hive.conf.HiveConf. Make sure HIVE_CONF_DIR is set correctly.
Workaround: / etc / Profile added last
HIVE_HOME=/usr/software/hive
export HIVE_CONF_DIR=/usr/software/hive/conf export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$HIVE_HOME/lib/*
Then perform root> . / Etc / Profile,
3.2===
ERROR exec.DDLTask: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectMapper.readerFor(Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/ObjectReader;
Reasons: jackson package sqoop version conflicts with the use of lead hive
Solution: The jackson * .jar hive under the lib directory are copied to the lib sqoop and remove low version jackson at sqoop / lib * .jar
cp -rf [hive]/lib/jackson*.jar [sqoop]/lib/
3.3===
ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
Solution:
a. /conf/hive-site.xml] hive to the next copy [$ {SQOOP_HOME} / conf
b. Edit file jdk jdk1.8 / jre / lib / security / java.policy, and . / etc / Profile
. VI / usr / Software / Java / jdk1 . 8 /jre/lib/security/java.policy
# specific configuration is as follows: Add the following to the file
grant {
permission javax.management.MBeanTrustPermission "register";
};
3.4 --- The following excerpt from the online issue but I did not encounter busy
Create a job when error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/json/JSONObject
Reasons: because sqoop lack java-json.jar package.
Solution:
java-json.jar Download: http: //www.java2s.com/Code/Jar/j/Downloadjavajsonjar.htm
the java-json.jar into / usr / local / sqoop / lib
3.6 ---
hdfs dfs -rm -r [folder name]