sqoop的安装部署

1 下载
  1. 下载地址
  2. 作者使用的是sqoop-1.4.6-cdh5.7.0.tar.gz版本
2 上传到linux上,并解压
[hadoop@zhangyu software]$ tar -xzvf sqoop-1.4.6-cdh5.7.0.tar.gz
修改用户和用户组
[hadoop@zhangyu software]$ sudo chown hadoop:hadoop sqoop-1.4.6-cdh5.7.0
sudo chown hadoop:hadoop sqoop/*
改成sqoop
[hadoop@zhangyu software]$ sudo mv sqoop-1.4.6-cdh5.7.0 sqoop
3 拷贝mysql的jdbc驱动包mysql-connector-java-5.1.45-bin.jar到sqoop/lib目录下
(这里我直接拷贝的hive下面已经下载好的驱动)
[hadoop@zhangyu lib]$ sudo cp /opt/software/hive/lib/mysql-connector-java-5.1.45-bin.jar .
4 配置环境变量
[hadoop@zhangyu sqoop]$ sudo vi /etc/profile
添加自己的配置
export SQOOP_HOME=/opt/software/sqoop 
export PATH=$PATH:$SQOOP_HOME/bin
5 复制sqoop/conf/sqoop-env-template.sh为sqoop-env.sh,添加配置
[hadoop@zhangyu conf]$ cp sqoop-env-template.sh sqoop-env.sh

#Setpath to where bin/hadoop is available
exportHADOOP_COMMON_HOME=/opt/software/hadoop
#Setpath to where hadoop-*-core.jar isavailable
exportHADOOP_MAPRED_HOME=/opt/software/hadoop
#setthe path to where bin/hbase isavailable
#exportHBASE_HOME=/opt/software/hbase 
#Setthe path to where bin/hive is available
exportHIVE_HOME= /opt/software/hive
#Setthe path for where zookeper config diris
#exportZOOCFGDIR= /opt/software/zookeeper
6 测试
[hadoop@zhangyu conf]$ sqoop version
Warning: /opt/software/sqoop/../hbase does not exist! HBase imports will fail.
Please set $HBASE_HOME to the root of your HBase installation.
Warning: /opt/software/sqoop/../hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /opt/software/sqoop/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
Warning: /opt/software/sqoop/../zookeeper does not exist! Accumulo imports will fail.
Please set $ZOOKEEPER_HOME to the root of your Zookeeper installation.
18/01/14 12:47:03 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.7.0
Sqoop 1.4.6-cdh5.7.0
git commit id 
Compiled by jenkins on Wed Mar 23 11:30:51 PDT 2016

[hadoop@zhangyu conf]$ sqoop import --help

这里的警告是因为我没有配置hbase,zookeeper,HCatalog

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Sure! Here's a step-by-step guide to deploying Sqoop on Ubuntu: 1. Install Java Development Kit (JDK): - Open Terminal and run the command: `sudo apt update` - Install OpenJDK by running: `sudo apt install openjdk-8-jdk` 2. Verify Java installation: - Run the command: `java -version` - You should see java version information printed on the console. 3. Download and install Sqoop: - Visit the Apache Sqoop website (https://sqoop.apache.org/) and navigate to the "Downloads" section. - Choose the latest stable release and copy the download link for the binary package (e.g., sqoop-x.x.x.bin__hadoop-x.x.x.tar.gz). - In Terminal, navigate to the directory where you want to install Sqoop. - Download the package using the command: `wget [download_link]` (replace [download_link] with the actual download link). - Extract the downloaded package using: `tar -xvf sqoop-x.x.x.bin__hadoop-x.x.x.tar.gz` (replace x.x.x with the version number). 4. Configure Sqoop: - Open the Sqoop configuration file using a text editor: `sudo nano sqoop-x.x.x.bin__hadoop-x.x.x/conf/sqoop-env.sh` - Set the JAVA_HOME variable to your JDK installation path. For example: `export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64` - Save and close the file. 5. Set up environment variables: - Open the ~/.bashrc file in a text editor: `nano ~/.bashrc` - Add the following lines at the end of the file: ``` export SQOOP_HOME=/path/to/sqoop export PATH=$PATH:$SQOOP_HOME/bin ``` - Save and close the file. - Run `source ~/.bashrc` to apply the changes. 6. Test Sqoop installation: - Run the command: `sqoop version` - You should see the Sqoop version information printed on the console without any errors. Congratulations! You have successfully deployed Sqoop on Ubuntu. You can now use Sqoop for data transfer between Hadoop and relational databases.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值