我是靠谱客的博主 可爱蜜蜂,最近开发中收集的这篇文章主要介绍Hadoop集群中sqoop的安装与使用,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

Sqoop的下载安装
sqoop下载地址:http://mirror.bit.edu.cn/apache/sqoop/

1、创建sqoop目录
[root@test1 /home]# mkdir sqoop mkdir sqoop
[root@test1 /home]# cd sqoop
2、解压sqoop
[root@test1 /home]#   tar -zxvf sqoop-1.4.4.bin__hadoop-2.0.4-alpha.tar.gz -C /home/sqoop/
3、修改配置文件
修改sqoop-env.sh配置文件,添加Hadoop环境
[root@test1 /home]#  mv sqoop-1.4.4.bin__hadoop-2.0.4-alpha/ sqoop-1.4.4
[root@test1 /home]#  cd   sqoop-1.4.4
[root@test1 /home]#   cd conf
[root@test1 /home]#   cp sqoop-env-template.sh sqoop-env.sh
[root@test1 /home]#   vi  sqoop-env.sh

#Set path to where bin/hadoop is available
export HADOOP_COMMON_HOME=/home/hadoop/hadoop //hadoop的安装目录

#Set path to where hadoop-*-core.jar is available
export HADOOP_MAPRED_HOME=/home/hadoop/hadoop //hadoop的安装目录
4、环境变量修改
[root@test1 conf]# vi /etc/profile
export SQOOP_HOME=/home/sqoop/sqoop-1.4.4
export PATH=$PATH:$SQOOP_HOME/bin:

5、查看sqoop是否安装成功

[root@test1 conf]# sqoop help
Warning: /usr/lib/hbase does not exist! HBase imports will fail.
Please set $HBASE_HOME to the root of your HBase installation.
Warning: /usr/lib/hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
usage: sqoop COMMAND [ARGS]

Available commands:
  codegen            Generate code to interact with database records
  create-hive-table  Import a table definition into Hive
  eval               Evaluate a SQL statement and display the results
  export             Export an HDFS directory to a database table
  help               List available commands
  import             Import a table from a database to HDFS
  import-all-tables  Import tables from a database to HDFS
  job                Work with saved jobs
  list-databases     List available databases on a server
  list-tables        List available tables in a database
  merge              Merge results of incremental imports
  metastore          Run a standalone Sqoop metastore
  version            Display version information

See 'sqoop help COMMAND' for information on a specific command.

MySQL的下载安装与修改密码

[root@test1 /]#  yum install mysql
[root@test1 /]#  yum install mysql-server
//查看mysql是否安装成功
[root@test1 /]#  yum list installed | grep mysql
//打开mysql服务
[root@test1 /]#  service mysqld start
//进入mysql
[root@test1 /]# mysql -u root -p   //直接回车,第一次进入mysql里,是没有密码的,输入密码会报错
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 4
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
//修改密码:
mysql> set password for root@localhost=password('123456');
Query OK, 0 rows affected (0.00 sec)

最后

以上就是可爱蜜蜂为你收集整理的Hadoop集群中sqoop的安装与使用的全部内容,希望文章能够帮你解决Hadoop集群中sqoop的安装与使用所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(43)

评论列表共有 0 条评论

立即
投稿
返回
顶部