我使用brew在Mac上安装了Hadoop,然后对其进行了配置。然后我安装了Sqoop,当我尝试运行Sqoop时出现以下错误:
错误:/usr/local/Cellar/sqoop/1.4.6/../hadoop不存在! 请将$ HADOOP_COMMON_HOME设置为Hadoop安装的根目录。
我的Hadoop运行正常,我甚至在〜/ .bash_profile 和 sqoop-env.sh
中设置了HADOOP_COMMON_HOME的路径这是我的sqoop env文件:
>>>from random import randint
mylist = ["H","S", "C", "D"]
carddeck = []
shuffledeck = []
suit= -1
index = 0
>>>for x in range (1,5):
suit = suit +1
for x in range (1,14):`
suitname = mylist[suit]
carddeck.append(str(x) + " " + suitname)
>>>for x in range (51, -1, -1):
index = randint(0,x)
shuffledeck.apend(card[deck[index]])
del carddeck[index]
答案 0 :(得分:0)
我之前做过brew install hadoop
做一些Spark事情。我不认为我必须编辑Hadoop本身的任何配置,
但是brew install sqoop
似乎开箱即用,可以找到Hadoop配置。不确定你从sqoop-env.sh
到哪里,但刚刚安装它,这是我的。
[jomoore@libexec] $ cat /usr/local/Cellar/sqoop/1.4.6/libexec/conf/sqoop-env.sh
export HADOOP_HOME="/usr/local"
export HBASE_HOME="/usr/local"
export HIVE_HOME="/usr/local"
export ZOOCFGDIR="/usr/local/etc/zookeeper"
如果我们在... $HADOOP_HOME/bin
[jomoore@libexec] $ ls -l /usr/local/bin/ | grep hadoop
lrwxr-xr-x 1 jomoore admin 45 Mar 13 10:24 container-executor -> ../Cellar/hadoop/3.0.0/bin/container-executor
lrwxr-xr-x 1 jomoore admin 33 Mar 13 10:24 hadoop -> ../Cellar/hadoop/3.0.0/bin/hadoop
lrwxr-xr-x 1 jomoore admin 31 Mar 13 10:24 hdfs -> ../Cellar/hadoop/3.0.0/bin/hdfs
lrwxr-xr-x 1 jomoore admin 33 Mar 13 10:24 mapred -> ../Cellar/hadoop/3.0.0/bin/mapred
lrwxr-xr-x 1 jomoore admin 50 Mar 13 10:24 test-container-executor -> ../Cellar/hadoop/3.0.0/bin/test-container-executor
lrwxr-xr-x 1 jomoore admin 31 Mar 13 10:24 yarn -> ../Cellar/hadoop/3.0.0/bin/yarn
由于我没有安装Accumulo,Hive或Zookeeper,这些其他警告只是噪音。
[jomoore@libexec] $ sqoop
Warning: /usr/local/Cellar/sqoop/1.4.6/libexec/bin/../../hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /usr/local/Cellar/sqoop/1.4.6/libexec/bin/../../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
Warning: /usr/local/Cellar/sqoop/1.4.6/libexec/bin/../../zookeeper does not exist! Accumulo imports will fail.
Please set $ZOOKEEPER_HOME to the root of your Zookeeper installation.
ERROR: Cannot execute /usr/local/libexec/hadoop-config.sh.
最后的错误实际上是在这里寻找文件,在Brew包中可能不应该是libexec/libexec
$ find /usr/local/Cellar -name hadoop-config.sh
/usr/local/Cellar/hadoop/3.0.0/libexec/libexec/hadoop-config.sh