Sqoop安装配置

目录

 

一、安装准备

二、安装Sqoop

三、配置Sqoop

四、测试


一、安装准备

Sqoop安装包:

 

二、安装Sqoop

1.上传文件到hadoop01虚拟机的/export/software目录

Sqoop安装配置_第1张图片

2.解压并移动到servers目录

[root@hadoop01 software]# tar -zxvf sqoop-1.4.6.bin__hadoop-2.0.gz -C /export/servers/

3.重命名

[root@hadoop01 servers]# mv sqoop-1.4.6.bin__hadoop-2.0.4-alpha/ sqoop-1.4.6

三、配置Sqoop

1.进入sqoop的conf目录下,修改配置文件

[root@hadoop01 servers]# cd /export/servers/sqoop-1.4.6/conf/
[root@hadoop01 conf]# cp sqoop-env-template.sh sqoop-env.sh
[root@hadoop01 conf]# vi sqoop-env.sh   

修改为:


#Set path to where bin/hadoop is available
export HADOOP_COMMON_HOME=/export/servers/hadoop

#Set path to where hadoop-*-core.jar is available
export HADOOP_MAPRED_HOME=/export/servers/hadoop

#Set the path to where bin/hive is available
export HIVE_HOME=/export/servers/apache-hive-1.2.2-bin

2.配置环境变量

[root@hadoop01 conf]# vi /etc/profile

添加:

#sqoop
export SQOOP_HOME=/export/servers/sqoop-1.4.6
export PATH=$PATH:$SQOOP_HOME/bin

刷新环境变量:

[root@hadoop01 conf]# source /etc/profile

3.导入jdbc驱动

[root@hadoop01 conf]# cp /export/software/mysql-connector-java-5.1.47/mysql-connector-java-5.1.47.jar /export/servers/sqoop-1.4.6/lib/

四、测试

1.启动mysql

[root@hadoop01 conf]# /etc/init.d/mysqld start

2.运行sqoop命令

[root@hadoop01 conf]# sqoop list-databases --connect jdbc:mysql://localhost:3306/ --username root --password 123456

Sqoop安装配置_第2张图片

 

成功!!!

你可能感兴趣的:(大数据技术)