• 《OD大数据实战》Sqoop入门实例


    官网地址:

    http://archive.cloudera.com/cdh5/cdh/5/sqoop-1.4.5-cdh5.3.6/SqoopUserGuide.html

    一、环境搭建

    1. 下载

    sqoop-1.4.5-cdh5.3.6.tar.gz

    2. 解压

    tar -zxvf sqoop-1.4.5-cdh5.3.6.tar.gz -C /opt/modules/cdh/

    3. 修改配置

    1)修改sqoop-env.sh

    #Set path to where bin/hadoop is available
    export HADOOP_COMMON_HOME=/opt/modules/cdh/hadoop-2.5.0-cdh5.3.6
    
    #Set path to where hadoop-*-core.jar is available
    export HADOOP_MAPRED_HOME=/opt/modules/cdh/hadoop-2.5.0-cdh5.3.6
    
    #set the path to where bin/hbase is available
    export HBASE_HOME=/opt/modules/cdh/hbase-0.98.6-cdh5.3.6
    
    #Set the path to where bin/hive is available
    export HIVE_HOME=/opt/modules/cdh/hive-0.13.1-cdh5.3.6

    2)修改sqoop-site.xml

    4. copy 依赖的jar包

    cd /opt/modules/cdh/sqoop-1.4.5-cdh5.3.6/lib/

    1)copy mysql jar包

    cp /opt/software/mysql-connector-java-5.1.27-bin.jar /opt/modules/cdh/sqoop-1.4.5-cdh5.3.6/lib ./

    2)copy hadoop jar包

    cp /opt/modules/cdh/hadoop-2.5.0-cdh5.3.6/share/hadoop/common/hadoop-common-2.5.0-cdh5.3.6.jar ./
    
    cp /opt/modules/cdh/hadoop-2.5.0-cdh5.3.6/share/hadoop/hdfs/hadoop-hdfs-2.5.0-cdh5.3.6.jar ./
    
    cp /opt/modules/cdh/hadoop-2.5.0-cdh5.3.6/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.5.0-cdh5.3.6.jar ./

    5. 检验是否安装成功

    sqoop version

    6. 去除警告信息

    vim bin/vim configure-sqoop

    ## Moved to be a runtime check in sqoop.
    #if [ ! -d "${HCAT_HOME}" ]; then
      #echo "Warning: $HCAT_HOME does not exist! HCatalog jobs will fail."
      #echo 'Please set $HCAT_HOME to the root of your HCatalog installation.'
    #fi
    
    #if [ ! -d "${ACCUMULO_HOME}" ]; then
      #echo "Warning: $ACCUMULO_HOME does not exist! Accumulo imports will fail."
      #echo 'Please set $ACCUMULO_HOME to the root of your Accumulo installation.'
    #fi
    #if [ ! -d "${ZOOKEEPER_HOME}" ]; then
      #echo "Warning: $ZOOKEEPER_HOME does not exist! Accumulo imports will fail."
      #echo 'Please set $ZOOKEEPER_HOME to the root of your Zookeeper installation.'
    #fi

    二、Sqoop命令介绍

    1、 Sqoop总共有14个命令

  • 相关阅读:
    ITU 测试向量 下载地址
    转:数字集群移动通信系统技术体制综述及优选准则
    转:留一手教你在美国亚马逊网购
    离散度的测量(来自百度百科)与应用(自己理解)
    G.718的mos分
    【转】关于Alchemy
    Ogg Squish 0.98 源代码
    转:分布式视频编码关键技术及其发展趋势
    分布式视频编码概述与应用(来自百度百科)和WynerZiv Coding算法
    @PostConstruct和@PreDestroy注解在spring源码中生效的流程
  • 原文地址:https://www.cnblogs.com/yeahwell/p/5778821.html
Copyright © 2020-2023  润新知