今天进行了Sqoop的安装部署工作。
1、导入Sqoop的tar包到/export/server下,并进行解压。
cd export/servers 进入相应目录 tar zxvf sqoop-1.4.6.bin__hadoop-2.0.4-alpha.tar.gz 解压Sqoop包 mv sqoop-1.4.6.bin__hadoop-2.0.4-alpha sqoop 给Sqoop重命名
2、Sqoop配置Hadoop、Hive路径
查看自己的Hadoop、Hive路径
cd /export/server 进入目录 cd hadoop-3.3.0/ 进入Hadoop目录 pwd 查看 /export/server/hadoop-3.3.0 这个是结果 cd .. 返回上一级目录 cd apache-hive-3.1.2-bin/ 进入hive目录 pwd 查看 /export/server/apache-hive-3.1.2-bin
修改配置文件
cd sqoop 进入scoop目录 cd conf 进入conf目录 ll 查看conf下文件 总用量 28 -rw-rw-r-- 1 root root 3895 4月 27 2015 oraoop-site-template.xml -rw-rw-r-- 1 root root 1404 4月 27 2015 sqoop-env-template.cmd -rwxr-xr-x 1 root root 1345 4月 27 2015 sqoop-env-template.sh -rw-rw-r-- 1 root root 5531 4月 27 2015 sqoop-site-template.xml -rw-rw-r-- 1 root root 5531 4月 27 2015 sqoop-site.xml mv sqoop-env-template.sh sqoop-env.sh 修改默认名称 vim sqoop-env.sh 编辑
文件信息
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # included in all the hadoop scripts with source command # should not be executable directly # also should not be passed any arguments, since we need original $* # Set Hadoop-specific environment variables here. #Set path to where bin/hadoop is available export HADOOP_COMMON_HOME=/export/server/hadoop-3.3.0 #Set path to where hadoop-*-core.jar is available export HADOOP_MAPRED_HOME=/export/server/hadoop-3.3.0 #set the path to where bin/hbase is available #export HBASE_HOME= #Set the path to where bin/hive is available export HIVE_HOME=/export/server/apache-hive-3.1.2-bin #Set the path for where zookeper config dir is #export ZOOCFGDIR=
标黄的是修改了的地方。
3、Sqoop配置mysql
这里需要导入mysql的连接驱动jar包,我这里是到hive lib下复制的。
cd /export/server/apache-hive-3.1.2-bin/lib/ ll cp mysql-connector-java-5.1.32.jar /export/server/sqoop/lib/ 复制移动 cd /export/server/sqoop/ bin/sqoop list-databases --connect jdbc:mysql://localhost:3306/ --username root --password hadoop 配置
到这里就配置成功了。
标签:bin,sqoop,部署,root,Sqoop,hadoop,server,export,安装 From: https://www.cnblogs.com/wjingbo/p/16619131.html