配置sqoop和mssql

将mssql 的jar包:sqljdbc4.jar 拷贝到SQOOP_HOME/lib下

 

配置sqoop  

cd /home/support/sqoop-1.4.5/conf  

 

cp sqoop-env-template.sh sqoop-env.sh

 

修改sqoop-env.sh文件

增加:

export HADOOP_COMMAND_HOME=/usr/local/hadoop-0.20.2

 

export HADOOP_MAPRED_HOME=/usr/local/hadoop-0.20.2

 

export HIVE_HOME=/usr/local/hive-0.7.1-bin

 

修改环境变量:

vi ~/.bashrc

 

新增配置:

export SQOOP_HOME=/usr/local/sqoop-1.4.5

 

设置环境变量MSSQL_CONNECTOR_HOME:

export MSSQL_CONNECTOR_HOME=/usr/local/sqoop-sqlserver-1.0

 

export PATH=$PATH:/usr/local/sqoop-1.4.5/bin

 

重新加载配置

source ~/.bashrc

 

必须先配置好了SQOOP_HOME才可以安装

cd /usr/local/sqoop-sqlserver-1.0

./install.sh

 

测试

sqoop eval --connect "jdbc:sqlserver://10.0.32.16:1433;databaseName=Mola_Analysis;username=myuser;password=mypwd" --query "select * from st_HelloWorld where StatDate = '2013-06-04'"

 

 

 

sqoop-sqlserver-1.0.tar.gz下载地址

http://pan.baidu.com/s/1eQ3omOU

你可能感兴趣的:(hadoop,MSSQL,sqoop)