本文共 4548 字,大约阅读时间需要 15 分钟。
[root@centos opt]# wget http://archive.apache.org/dist/sqoop/1.4.6/sqoop-1.4.6.bin__hadoop-2.0.4-alpha.tar.gz
[root@centos opt]# tar -zxvf sqoop-1.4.6.bin__hadoop-2.0.4-alpha.tar.gz[root@centos opt]# mv sqoop-1.4.6.bin__hadoop-2.0.4-alpha sqoop-1.4.6
[root@centos conf]# vi sqoop-env.sh[root@centos conf]# cat 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 availableexport HADOOP_COMMON_HOME=/opt/hadoop-2.7.4#Set path to where hadoop-*-core.jar is availablexport HADOOP_MAPRED_HOME=/opt/hadoop-2.7.4#set the path to where bin/hbase is availableexport HBASE_HOME=/opt/hbase-1.2.6#Set the path to where bin/hive is available#export HIVE_HOME=#Set the path for where zookeper config dir isexport ZOOCFGDIR=/opt/zookeeper-3.4.6/conf
export SQOOP_HOME=/opt/sqoop-1.4.6export PATH=$PATH:$SQOOP_HOME/bin
[root@centos lib]# sqoop help/opt/sqoop-1.4.6/conf/sqoop-env.sh: line 26: xport: command not foundWarning: /opt/sqoop-1.4.6/../hcatalog does not exist! HCatalog jobs will fail.Please set $HCAT_HOME to the root of your HCatalog installation.Warning: /opt/sqoop-1.4.6/../accumulo does not exist! Accumulo imports will fail.Please set $ACCUMULO_HOME to the root of your Accumulo installation.Warning: /opt/sqoop-1.4.6/../zookeeper does not exist! Accumulo imports will fail.Please set $ZOOKEEPER_HOME to the root of your Zookeeper installation.18/01/01 11:52:08 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6usage: 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 import-mainframe Import datasets from a mainframe server 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 informationSee 'sqoop help COMMAND' for information on a specific command.[root@centos lib]# sqoop version/opt/sqoop-1.4.6/conf/sqoop-env.sh: line 26: xport: command not foundWarning: /opt/sqoop-1.4.6/../hcatalog does not exist! HCatalog jobs will fail.Please set $HCAT_HOME to the root of your HCatalog installation.Warning: /opt/sqoop-1.4.6/../accumulo does not exist! Accumulo imports will fail.Please set $ACCUMULO_HOME to the root of your Accumulo installation.Warning: /opt/sqoop-1.4.6/../zookeeper does not exist! Accumulo imports will fail.Please set $ZOOKEEPER_HOME to the root of your Zookeeper installation.18/01/01 11:52:54 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6Sqoop 1.4.6git commit id c0c5a81723759fa575844a0a1eae8f510fa32c25Compiled by root on Mon Apr 27 14:38:36 CST 2015