1

我正在尝试使用 xd-singlenode 和 xd-shell 将 Spring XD 流存储到 Hortonworks 沙箱 2.0 版。没有创建 xd 目录,也没有流存储在 Hortonworks hadoop hdfs 中。

环境:Apple OSX 10.9.3,在 Oracle Virtualbox(Red Hat 64 位)中运行的 Hortonworks Sandbox,使用桥接模式网络。我在我的 WiFi 路由器中为 Virtualbox MAC 地址分配了一个固定的 IP 地址(192.168.178.30)。当我使用 OSX Safari 浏览到 192.168.178.30:8000 时,我可以使用 Hortonworks 菜单,例如文件浏览器、Pig、Beeswax (Hive) 等。Hortonworks 菜单中的“检查错误配置”会导致:

Configuration files located in /etc/hue/conf.empty 
All OK. Configuration check passed.

我使用 Homebrew 安装 Spring XD。我在 OSX 中更改了 /usr/local/Cellar/springxd/1.0.0.M6/libexec/xd/config/servers.yml 文件以包含

# Hadoop properties
spring:
  hadoop:
   fsUri: hdfs://192.168.178.30:8020

#Zookeeper properties
# client connect string: host1:port1,host2:port2,...,hostN:portN
zk:
  client:
     connect: 192.168.178.30:2181

在 Virtualbox 中,我将文件 /etc/hadoop/conf.empty/hadoop-env.sh 更改为包括:

export HADOOP_OPTS="${HADOOP_OPTS} -Djava.security.krb5.realm= -Djava.security.krb5.kdc="

export HADOOP_OPTS="${HADOOP_OPTS} -Djava.security.krb5.conf=/dev/null"

我使用以下命令在 OSX 中启动 Spring XD:

./xd-singlenode --hadoopDistro hadoop22

在第二个 OSX 终端中:

./xd-shell --hadoopDistro hadoop22

在 xd-shell 我输入:

 hadoop config fs --namenode hdfs://192.168.178.30:8020

xd-shell 中的“hadoop fs ls /”命令会导致:

Hadoop configuration changed, re-initializing shell...
2014-06-24 00:55:56.632 java[7804:5d03] Unable to load realm info from SCDynamicStore
00:55:56,672  WARN Spring Shell util.NativeCodeLoader:62 - Unable to load native-hadoop     library for your platform... using builtin-java classes where applicable
Found 6 items
drwxrwxrwt   - yarn   hadoop          0 2013-10-21 00:19 /app-logs
drwxr-xr-x   - hdfs   hdfs            0 2013-10-21 00:08 /apps
drwxr-xr-x   - mapred hdfs            0 2013-10-21 00:10 /mapred
drwxr-xr-x   - hdfs   hdfs            0 2013-10-21 00:10 /mr-history
drwxrwxrwx   - hdfs   hdfs            0 2013-10-28 16:34 /tmp
drwxr-xr-x   - hdfs   hdfs            0 2013-10-28 16:34 /user

当我使用命令创建 Spring XD 流时

stream create --name twvoetbal --definition "twittersearch --consumerKey='<mykey>' --consumerSecret='<mysecret>' --query='voetbal' | file" --deploy

然后在 OSX 中创建 /tmp/xd/output/twvoetbal.out 文件。Spring XD 接缝工作,包括我的 Twitter 开发人员密钥。

当我使用命令创建 Spring XD 流时

stream create --name twvoetbal --definition "twittersearch --consumerKey='<mykey>' --consumerSecret='<mysecret>' --query='voetbal' | hdfs" --deploy

然后在 hadoop hdfs 中没有创建 xd 目录和文件。

问题:

  1. 如何解决 xd-shell 中的“无法从 SCDynamicStore 加载领域信息”错误?
  2. 如何解决 xd-shell 中的“WARN Spring Shell util.NativeCodeLoader:62 - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable”错误?
  3. 我还能做错什么?
4

1 回答 1

2

WARN 消息只是噪音——我总是忽略它们。您是否在沙箱上创建了 xd 目录?您需要授予运行 xd-singlenode 的用户创建所需目录的权限。

您可以以 root 身份 ssh 到沙箱(密码是 hadoop)并运行以下命令:

sudo -u hdfs hdfs dfs -mkdir /xd
sudo -u hdfs hdfs dfs -chmod 777 /xd

我们有一个关于在 XD 中使用 Hadoop VM 的简短文章: https ://github.com/spring-projects/spring-xd/wiki/Using-Hadoop-VMs-with-Spring-XD#hortonworks-sandbox

于 2014-06-25T14:00:01.480 回答