一、安装Sqoop
- 解压并修改权限
sudo tar -zxvf sqoop-1.4.7.bin__hadoop-2.6.0.tar.gz -C /opt/bigdata/
cd /opt/bigdata/
sudo mv sqoop-1.4.7.bin__hadoop-2.6.0/ sqoop-1.4.7
sudo chown -R hadoop:hadoop sqoop-1.4.7/
- 配置环境变量
export SQOOP_HOME=/opt/bigdata/sqoop-1.4.7
export PATH=$SQOOP_HOME/bin:$PATH
source /etc/profile
- 配置sqoop-env.sh
cd sqoop-1.4.7/conf/
sudo cp sqoop-env-template.sh sqoop-env.sh
如下所示:
#Set path to where bin/hadoop is available
export HADOOP_COMMON_HOME=/opt/bigdata/hadoop-2.9.2
#Set path to where hadoop-*-core.jar is available
export HADOOP_MAPRED_HOME=/opt/bigdata/hadoop-2.9.2
#set the path to where bin/hbase is available
export HBASE_HOME=/opt/bigdata/hbase-2.2.6
#Set the path to where bin/hive is available
export HIVE_HOME=/opt/bigdata/hive-2.3.7
- 将mysql驱动复制到lib目录下
cp hive-2.3.7/lib/mysql-connector-java-5.1.48.jar sqoop-1.4.7/lib/
- 测试是否安装成功
sqoop-version