Home >Database >Mysql Tutorial >Alex的Hadoop菜鸟教程:第6课Sqoop2安装教程

Alex的Hadoop菜鸟教程:第6课Sqoop2安装教程

WBOY
WBOYOriginal
2016-06-07 16:10:411810browse

安装 sqoop 分为服务端和客户端,先安装服务端 $ sudo yum install sqoop2-server 再安装客户端 $ sudo yum install sqoop2-client 服务端 配置 分为 MRv1 和 YARN(Map Reduce 2代)两种情况 YARN alternatives --set sqoop2-tomcat-conf /etc/sqoop2/tomcat-

安装

sqoop 分为服务端和客户端,先安装服务端
$ sudo yum install sqoop2-server

再安装客户端
$ sudo yum install sqoop2-client

服务端

配置

分为 MRv1 和 YARN(Map Reduce 2代)两种情况
YARN
alternatives --set sqoop2-tomcat-conf /etc/sqoop2/tomcat-conf.dist

MRv1
alternatives --set sqoop2-tomcat-conf /etc/sqoop2/tomcat-conf.mr1

安装JDBC驱动

先下载jdbc驱动 http://dev.mysql.com/downloads/file.php?id=454397 下载完后解压开有一个 mysql-connector-java-5.1.34-bin.jar 拷贝到 /var/lib/sqoop2/ 这个目录下

启动Sqoop2

启动
$ sudo /sbin/service sqoop2-server start

停止
$ sudo /sbin/service sqoop2-server stop


检验是否启动成功

$ wget -qO - localhost:12000/sqoop/version

会输出
{"version":"1.99.2-cdh5.0.0",...}

客户端

启动客户端
sqoop2

输出
Sqoop home directory: /usr/lib/sqoop2
Sqoop Shell: Type 'help' or '\h' for help.

sqoop:000> 

连接服务端,假设你的服务端是localhost
sqoop:000> set server --host localhost

测试一下sqoop命令
sqoop:000> show version --all
client version:
  Sqoop 1.99.3-cdh5.0.1 revision Unknown 
  Compiled by jenkins on Tue May  6 14:02:38 PDT 2014
server version:
  Sqoop 1.99.3-cdh5.0.1 revision Unknown 
  Compiled by jenkins on Tue May  6 14:02:38 PDT 2014
Protocol version:
  [1]




Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn