Sqoop的搭建和部署

1、Sqoop的简介

Sqoop是一款开源的工具,主要用于在Hadoop(Hive)与传统的数据库(mysql、postgresql…)间进行数据的传递,可以将一个关系型数据库(例如 : MySQL ,Oracle ,Postgres等)中的数据导进到Hadoop的HDFS中,也可以将HDFS的数据导进到关系型数据库中。
sqoop1最新版本是1.4.7,sqoop2最新版本是1.99.7
sqoop2特征不完整,不建议用于生产部署。

1.1、sqoop依赖环境

组件架包及版本下载地址
jdkjdk-8u152-linux-x64.tar.gzhttps://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
hadoophadoop-2.7.7.tar.gzhttps://archive.apache.org/dist/hadoop/common/
hbasehbase-1.2.6-bin.tar.gzhttp://mirror.bit.edu.cn/apache/hadoop/common/http://archive.apache.org/dist/hbase/
hiveapache-hive-2.3.7-bin.tar.gzhttp://mirror.bit.edu.cn/apache/hive/
zookeeperzookeeper-3.4.14.tar.gzhttps://mirrors.bfsu.edu.cn/apache/zookeeper/
sqoopsqoop-1.4.6.bin__hadoop-2.0.4-alpha.tar.gzhttp://archive.apache.org/dist/sqoop/
MySQLMySQL-5.6.27-1.linux_glibc2.5.x86_64.rpm-bundle.tarhttps://downloads.mysql.com/archives/community/

以上基础的是hadoop,jdk,sqoop和mysql。
hbase和hive是基于hadoop的衍生物,储存文件就是hdfs。
zookeeper实行hadoop的高可用。

2、sqoop集群安装部署。

安装sqoop前集群的最低要求安装mysql,jdk和hadoop。
可以添加hbase,hive和zookeeper,进行试验。
参考hive,hbase,zookeeperhadoop这些进行搭建。

2.1、sqoop解压

tar zxf /opt/software/sqoop-1.4.6.bin__hadoop-2.0.4-alpha.tar.gz -C /opt/module

2.2、sqoop配置环境变量

/etc/profile中添加

# SQOOP_HOME
export SQOOP_HOME=/opt/module/sqoop-1.4.6.bin__hadoop-2.0.4-alpha
export PATH=$PATH:$SQOOP_HOME/bin

2.3、sqoop配置文件

进入conf,cp sqoop-env-template.sh sqoop-env.sh
将hadoop,hive,hbase,zookeeper的绝对路径进行填写。
在这里插入图片描述
将MySQL的驱动包放到sqoop的lib下面

cp /opt/software/mysql-connector-java-5.1.47-bin.jar /opt/module/sqoop-1.4.6.bin__hadoop-2.0.4-alpha/lib/

2.4、验证

在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 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、付费专栏及课程。

余额充值