Sqoop-1.4.7安装

一、准备工作


  1. 预先安装Hadoop(伪分布即可),可参考Hadoop2.7.3环境搭建之伪分布式
  2. 预先下载sqoop编译后安装包
    1. 下载地址
    2. 下载的版本:sqoop-1.4.7.bin__hadoop-2.6.0.tar.gz

二、安装配置


  1. 解压安装

    tar -zvxf sqoop-1.4.7.bin__hadoop-2.6.0.tar.gz -C /training/
    
  2. 配置环境变量
    执行:vi ~/.bash_profile
    添加如下内容:

    #sqoop
    export SQOOP_HOME=/training/sqoop-1.4.7.bin__hadoop-2.6.0
    export PATH=$PATH:$SQOOP_HOME/bin
    
  3. 配置sqoop文件

    1. 配置【configure-sqoop】
      执行:vi /training/sqoop-1.4.7.bin__hadoop-2.6.0/bin/configure-sqoop
      在打开的文件中,将HCAT_HOME和ACCUMULO_HOME相关部分内容注释掉

    2. 配置【sqoop-site.xml】
      执行:vi /training/sqoop-1.4.7.bin__hadoop-2.6.0/conf/sqoop-site.xml,配置内容如下:

      <?xml version="1.0"?>
      <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
      <configuration>
      
        <property>
          <name>sqoop.metastore.client.enable.autoconnect</name>
          <value>true</value>
          <description>If true, Sqoop will connect to a local metastore
            for job management when no other metastore arguments are
            provided.
          </description>
        </property>
        
        <property>
          <name>sqoop.metastore.client.autoconnect.url</name>
          <value>jdbc:hsqldb:file:/tmp/sqoop-meta/meta.db;shutdown=true</value>
          <description>The connect string to use when connecting to a
            job-management metastore. If unspecified, uses ~/.sqoop/.
            You can specify a different path here.
          </description>
        </property>
        
        <property>
          <name>sqoop.metastore.client.autoconnect.username</name>
          <value>SA</value>
          <description>The username to bind to the metastore.
          </description>
        </property>
        
        <property>
          <name>sqoop.metastore.client.autoconnect.password</name>
          <value></value>
          <description>The password to bind to the metastore.
          </description>
        </property>
        
        <property>
          <name>sqoop.metastore.client.record.password</name>
          <value>true</value>
          <description>If true, allow saved passwords in the metastore.
          </description>
        </property>
        
        <property>
          <name>sqoop.metastore.server.location</name>
          <value>/tmp/sqoop-metastore/shared.db</value>
          <description>Path to the shared metastore database files.
          If this is not set, it will be placed in ~/.sqoop/.
          </description>
        </property>
      
        <property>
          <name>sqoop.metastore.server.port</name>
          <value>16000</value>
          <description>Port that this metastore should listen on.
          </description>
        </property>
      </configuration>
      
    3. 配置【sqoop-env.sh】
      执行:vi sqoop-env.sh,添加如下内容:

      #Set path to where bin/hadoop is available
      export HADOOP_COMMON_HOME=/training/hadoop-2.7.3
      
      #Set path to where hadoop-*-core.jar is available
      export HADOOP_MAPRED_HOME=/training/hadoop-2.7.3
      
      #set the path to where bin/hbase is available
      export HBASE_HOME=/training/hbase-1.3.1
      
      #Set the path to where bin/hive is available
      export HIVE_HOME=/training/apache-hive-2.3.3-bin
      
      #Set the path for where zookeper config dir is
      export ZOOCFGDIR=/training/zookeeper-3.4.5
      
  4. 将MySQL数据库的驱动(使用5.x版本,不要使用高版本的)需上传到sqoop安装目录下的lib目录下
    下载地址

  5. 由于sqoop缺少java-json.jar包进行解析json,需上传到sqoop安装目录下的lib目录下
    下载地址
    提取码:hkmv

三、验证


  1. 命令行中,输入:sqoop version,看到如下即为安装成功:
    在这里插入图片描述
  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

若兰幽竹

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值