[Sqoop]Sqoop安装与部署

  1. 云栖社区>
  2. 博客>
  3. 正文

[Sqoop]Sqoop安装与部署

sjf0115 2016-10-08 15:52:32 浏览952
展开阅读全文
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/SunnyYoona/article/details/52757310
1. 下载

http://www.apache.org/dyn/closer.lua/sqoop/1.4.6

2. 解压


  1. xiaosi@Qunar:~$ sudo tar -zxvf sqoop-1.4.6.bin__hadoop-2.0.4-alpha.tar.gz -C /opt

进行重命名:


  1. xiaosi@Qunar:/opt$ sudo mv sqoop-1.4.6.bin__hadoop-2.0.4-alpha sqoop-1.4.6
3. 配置环境变量

  1. # sqoop
  2. export SQOOP_HOME=/opt/sqoop-1.4.6
  3. export PATH=${SQOOP_HOME}/bin:$PATH
4. 配置文件

  1. xiaosi@Qunar:/opt/sqoop-1.4.6/conf$ sudo mv  sqoop-env-template.sh  sqoop-env.sh

进行如下修改:


  1. # Set Hadoop-specific environment variables here.
  2. #Set path to where bin/hadoop is available
  3. export HADOOP_COMMON_HOME=/opt/hadoop-2.7.2
  4. #Set path to where hadoop-*-core.jar is available
  5. export HADOOP_MAPRED_HOME=/opt/hadoop-2.7.2
  6. #set the path to where bin/hbase is available
  7. #export HBASE_HOME=
  8. #Set the path to where bin/hive is available
  9. export HIVE_HOME=/opt/apache-hive-2.0.0-bin
  10. #Set the path for where zookeper config dir is
  11. #export ZOOCFGDIR=/opt/zookeeper-3.4.8

如果数据读取不涉及hbase和hive,那么相关hbase和hive的配置可以不用配置;如果集群有独立的zookeeper集群,那么配置zookeeper,反之,不用配置。

5. Copy Jar包

所需的包:hadoop-core包、mysql的jdbc包(或Oracle的jdbc包等)


  1. xiaosi@Qunar:~$ sudo mv hadoop-core-1.2.1.jar /opt/sqoop-1.4.6/lib/
  2. xiaosi@Qunar:~$ sudo mv mysql-connector-java-5.1.38.jar /opt/sqoop-1.4.6/lib/
6. 测试验证

  1. xiaosi@Qunar:/opt/sqoop-1.4.6/bin$ sqoop list-databases --connect jdbc:mysql://localhost:3306 --username root -password root
  2. Warning: /opt/sqoop-1.4.6/../hbase does not exist! HBase imports will fail.
  3. Please set $HBASE_HOME to the root of your HBase installation.
  4. Warning: /opt/sqoop-1.4.6/../hcatalog does not exist! HCatalog jobs will fail.
  5. Please set $HCAT_HOME to the root of your HCatalog installation.
  6. Warning: /opt/sqoop-1.4.6/../accumulo does not exist! Accumulo imports will fail.
  7. Please set $ACCUMULO_HOME to the root of your Accumulo installation.
  8. 16/10/08 15:43:03 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6
  9. 16/10/08 15:43:03 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
  10. 16/10/08 15:43:03 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
  11. information_schema
  12. hive_db
  13. mysql
  14. performance_schema
  15. phpmyadmin
  16. test






网友评论

登录后评论
0/500
评论
sjf0115
+ 关注