Sqoop配置
Posted studynotessl
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Sqoop配置相关的知识,希望对你有一定的参考价值。
解压和重命名文件
tar -zxvf sqoop-1.4.7.bin__hadoop-2.6.0.tar.gz
mkdir /opt/sqoop
mv sqoop-1.4.7.bin__hadoop-2.6.0 /opt/sqoop/sqoop1.4.7
进入sqoop的配置目录
cd /opt/sqoop/sqoop1.4.7/conf/
#将sqoop-env-template.sh复制一份并命名为sqoop-env.sh
cat sqoop-env-template.sh >> sqoop-env.sh
#编辑sqoop-env.sh 加入安装了组件的对应路径
vim sqoop-env.sh
#Set path to where bin/hadoop is available
export HADOOP_COMMON_HOME=/opt/hadoop/hadoop2.7
#Set path to where hadoop-*-core.jar is available
export HADOOP_MAPRED_HOME=/opt/hadoop/hadoop2.7
#Set the path to where bin/hive is available
export HIVE_HOME=/opt/hive/hive2.1
配置环境变量
vim /etc/profile
#sqoop config
export SQOOP_HOME=/opt/sqoop/sqoop1.4.7
export PATH=.:$JAVA_HOME/bin:$SCALA_HOME/bin:$SPARK_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$ZK_HOME/bin:$HBASE_HOME/bin:$HIVE_HOME/bin:$KAFKA_HOME/bin:$SQOOP_HOME/bin:$FLUME_HOME/bin:$STORM_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$SQOOP_HOME/lib
刷新配置文件
source /etc/profile
启动mysql
service mysqld start
测试连接MySQL
sqoop list-databases --connect jdbc:mysql://localhost:3306/ --username root -P
以上是关于Sqoop配置的主要内容,如果未能解决你的问题,请参考以下文章