1、安裝shell
1.解壓
2.引入環境變量
vi ~/.bashrc
export SQOOP_HOME=/home/hadoop/sqoop/sqoop-1.99.7-bin-hadoop200
export PATH=$PATH:$SQOOP_HOME/bin
export SQOOP_SERVER_EXTRA_LIB=$SQOOP_HOME/extra
export CATALINA_BASE=$SQOOP_HOME/server
export LOGDIR=$SQOOP_HOME/logs/
3.修改配置文件
cd /apps/sqoop/server/conf
a:
vi sqoop.properties
org.apache.sqoop.submission.engine.mapreduce.configuration.directory=/apps/hadoop-2.8.1/etc/hadoopapache
b:
vi catalina.properties
common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/../lib/*.jar,/apps/hadoop-2.8.1/share/hadoop/common/*.jar,/apps/hadoop-2.8.1/share/hadoop/common/lib/*.jar,/apps/hadoop-2.8.1/share/hadoop/hdfs/*.jar,/apps/hadoop-2.8.1/share/hadoop/hdfs/lib/*.jar,/apps/hadoop-2.8.1/share/hadoop/mapreduce/*.jar,/apps/hadoop-2.8.1/share/hadoop/mapreduce/lib/*.jar,/apps/hadoop-2.8.1/share/hadoop/tools/lib/*.jar,/apps/hadoop-2.8.1/share/hadoop/yarn/*.jar,/apps/hadoop-2.8.1/share/hadoop/yarn/lib/*.jar,/apps/hadoop-2.8.1/share/hadoop/httpfs/tomcat/lib/*.jartomcat
2、執行bash
1.Start or stop the sqoop server
sqoop.sh server start/stop
2.Start the sqoop shell
sqoop.sh client
3、問題app
問題: org.apache.sqoop.common.SqoopException: GENERIC_JDBC_CONNECTOR_0005:No column is found to partition data
解決:
而後我對個人sqoop job作了updateoop
有以下信息
Schema name: datamart
Table name:table_name
Table SQL statement:
Table column names:
Partition column name:
Null value allowed for the partition column:
Boundary query:server
Partition column name分區的列名,正好我把表table_name的分佈鍵 id 加了上去,而後start job --jid 1
執行成功hadoop