Sqoop 1.99.3 with hadoop-2.3.0 使用1

使用 sqoop-1.99.3-bin-hadoop200
配置如下
1.解压
tar -xvf sqoop--bin-hadoop.tar.gz
2.加入配置文件 server/conf/catalina.properties 中的common.loader 属性加入hadoop2的lib
因为hadoop_home 下的lib是空的 所以指向 
/home/hadoop-2.3.0/share/hadoop/common/*.jar
/home/hadoop-2.3.0/share/hadoop/common/lib/*.jar
/home/hadoop-2.3.0/share/hadoop/yarn/*.jar
/home/hadoop-2.3.0/share/hadoop/hdfs/*.jar
/home/hadoop-2.3.0/share/hadoop/mapreduce/*.jar
启动后发现有问题, 查看 sqoop_home/server/log 报错了

Mar 19, 2014 8:08:55 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.apache.sqoop.server.ServerInitializer
java.lang.RuntimeException: Failure in server initialization
at org.apache.sqoop.core.SqoopServer.initialize(SqoopServer.java:57)
Caused by: org.apache.sqoop.common.SqoopException: MAPREDUCE_0002:Failure on submission engine initialization - Invalid Hadoop configuration directory (not a directory or permission issues): /etc/hadoop/conf/
at org.apache.sqoop.submission.mapreduce.MapreduceSubmissionEngine.initialize(MapreduceSubmissionEngine.java:94)
at org.apache.sqoop.framework.JobManager.initialize(JobManager.java:215)
at org.apache.sqoop.core.SqoopServer.initialize(SqoopServer.java:53)
... 25 more

找到了 server/conf/sqoop.properties 里面的属性要改成

# Hadoop configuration directory
#org.apache.sqoop.submission.engine.mapreduce.configuration.directory=/etc/hadoop/conf/
 org.apache.sqoop.submission.engine.mapreduce.configuration.directory=/home/hadoop-2.3.0/etc/hadoop
 
查看log 没有错误.进入./bin/sqoop.sh client
show version --all 查看有没错误。再次确认启动成功.

建立一个connection 根据提示输入
create connection --cid 1 (connection id为1)
Creating connection for connector with id 1
Please fill following values to create new connection object
Name: VPRCFJTBCOBI-02
Connection configuration
JDBC Driver Class: com.microsoft.sqlserver.jdbc.SQLServerDriver
JDBC Connection String: jdbc:sqlserver://VPRCFJTBCOBI-02\\BOE140:62064;DatabaseName=AdventureWorksDW2008R2;useUnicode=true;characterEncoding=UTF-8
Username: sa
Password: ********
JDBC Connection Properties:
There are currently 0 values in the map:
entry#
Security related configuration options
Max connections: 0
New connection was successfully created with validation status FINE and persistent id 2

 

查看下成果

show connector

+----+------------------------+---------+------------------------------------------------------+

| Id |          Name                    | Version |                        Class                         |

+----+------------------------+---------+------------------------------------------------------+

| 1  | generic-jdbc-connector | 1.99.3  | org.apache.sqoop.connector.jdbc.GenericJdbcConnector |

 

 

show connection
+----+-----------------+-----------+---------+
| Id |      Name       | Connector | Enabled |
+----+-----------------+-----------+---------+
| 2  | VPRCFJTBCOBI-02 | 1         | true    |
+----+-----------------+-----------+---------+

PS 建错了connection 就删了 delete connection --xid 1 也可以update connection --xid 1


 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值