Home > Database > Mysql Tutorial > body text

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

WBOY
Release: 2016-06-07 16:10:41
Original
1771 people have browsed it

安装 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
Copy after login

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

服务端

配置

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

MRv1
alternatives --set sqoop2-tomcat-conf /etc/sqoop2/tomcat-conf.mr1
Copy after login

安装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
Copy after login

停止
$ sudo /sbin/service sqoop2-server stop
Copy after login


检验是否启动成功

$ wget -qO - localhost:12000/sqoop/version
Copy after login

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

客户端

启动客户端
sqoop2
Copy after login

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

sqoop:000> 
Copy after login

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

测试一下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]
Copy after login




Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!