我有一个亚马逊ec2实例,正在运行一个名为seqware的工具。它基本上是一个使用hbase后端的基因组数据查询引擎。我正在以伪分布式模式设置hbase的AMI上运行。我想在完全分布式模式下使用它。因此,我建立了一个2节点hadoop集群。一个节点是主节点,另一个是从节点。我可以在完全分布式模式下运行hadoop示例。为了使seqware使用我完全分散的设置,它需要6件事,即zookeeper仲裁,Zookeeper客户端端口,hbase master,mapred作业跟踪器,fs默认fs和fs名称。在设置文件中指定了哪些。我在文件中这样设置它:
HBASE.ZOOKEEPER.QUORUM=ip-10-x.x.x
HBASE.ZOOKEEPER.PROPERTY.CLIENTPORT=2181
HBASE.MASTER=ip-10-x.x.x:60010
MAPRED.JOB.TRACKER=ip-10-x.x.x:9001
FS.DEFAULT.NAME=hdfs://ip-10-x.x.x:9000
FS.DEFAULTFS=hdfs://ip-10-x.x.x:9000
但是,当我开始使用查询引擎时,我遇到了Zookeeper连接丢失异常。我在seqware的authorized_keys中拥有主服务器的公钥,反之亦然,但是我不能这样做
ssh ip-10.x.x.x
甚至使用公共(public)DNS:
ssh {public DNS of instance}
其中ip-10.x.x.x是实例的ip地址,我必须使用用户名进行操作:
ssh {username}@ip-10-x.x.x
要么
ssh username@{public DNS of instance}
我可以在没有从主节点到从属hadoop实例的用户名的情况下使用ssh,反之亦然,并且我在配置文件中拥有的IP地址没有用户名
我尝试将用户名添加到设置中的IP地址之前,以为它有99%的可能性不起作用,而且我也没有失望,我仍然遇到同样的异常
我需要做些什么,以便可以像从主节点和从节点之间那样,从seqware实例SSH到hadoop和hbase主节点,而不必指定用户名。
这是在hadoop主服务器上配置Zookeeper的方式:
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://ip-10-x.x.x:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>ip-10-x.x.x</value>
</property>
<property>
<name>dfs.replication</name>
<value>2</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/home/{username}/hbase/zookeeper</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
</property>
</configuration>
关于seqware的内部实现,我不能自信地说,但是我知道它使用设置文件来设置zookeepr和hbase master的位置。在默认的伪分布式工作设置中,这些是我前面提到的变量的值:
HBASE.ZOOKEEPER.QUORUM=localhost
HBASE.ZOOKEEPER.PROPERTY.CLIENTPORT=2181
HBASE.MASTER=localhost:60000
MAPRED.JOB.TRACKER=localhost:8021
FS.DEFAULT.NAME=hdfs://localhost:8020
FS.DEFAULTFS=hdfs://localhost:8020
这是zoo.cfg文件的样子:
# 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.
maxClientCnxns=50
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
dataDir=/var/lib/zookeeper
# the port at which the clients will connect
clientPort=2181
Zookeeper堆栈跟踪:
[seqware@master target]$ java -classpath seqware-distribution-0.13.6.8-qe-full.jar
com.github.seqware.queryengine.system.ReferenceCreator hg_19 keyValue_ref.out
[SeqWare Query Engine] 0 [main] ERROR org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper - ZooKeeper exists failed after 3 retries
[SeqWare Query Engine] 1 [main] ERROR org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher - hconnection Received unexpected KeeperException, re-throwing exception org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master at
org.apache.zookeeper.KeeperException.create(KeeperException.java:99) at
org.apache.zookeeper.KeeperException.create(KeeperException.java:51) at
org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1021)
at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:154) at org.apache.hadoop.hbase.zookeeper.ZKUtil.watchAndCheckExists(ZKUtil.java:226)at org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker.start(ZooKeeperNodeTracker.java:82) at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.setupZookeeperTrackers(HConnectionManager.java:580)
2013年8月13日
显然,基于seqware constants.java文件,需要为远程hbase设置设置的变量不是我正在编辑的变量,而是qe变量:https://github.com/SeqWare/seqware/blob/develop/seqware-queryengine/src/main/java/com/github/seqware/queryengine/Constants.java
我已经对它们进行了这样的编辑:
# SEQWARE QUERY ENGINE AND GENERAL HADOOP SETTINGS
#
HBASE.ZOOKEEPER.QUORUM=localhost
HBASE.ZOOKEEPER.PROPERTY.CLIENTPORT=2181
HBASE.MASTER=localhost:60000
MAPRED.JOB.TRACKER=localhost:8021
FS.DEFAULT.NAME=hdfs://localhost:8020
FS.DEFAULTFS=hdfs://localhost:8020
FS.HDFS.IMPL=org.apache.hadoop.hdfs.DistributedFileSystem
#
# SEQWARE QUERY ENGINE SETTINGS
#
QE_NAMESPACE=SeqWareQE
QE_DEVELOPMENT_DEPENDENCY=file:/home/seqware/jars/seqware-distribution-0.13.6.5-qe-full.jar
QE_PERSIST=true
QE_HBASE_REMOTE_TESTING=true
QE_HBASE_PROPERTIES=HBOOT
QE_HBOOT_HBASE_ZOOKEEPER_QUORUM=ip-10-x.x.x.ec2.internal
QE_HBOOT_HBASE_ZOOKEEPER_PROPERTY_CLIENTPORT=2181
QE_HBOOT_HBASE_MASTER=ip-10-x.x.x.ec2.internal:60010
QE_HBOOT_MAPRED_JOB_TRACKER=ip-10-x.x.x.ec2.internal:9001
QE_HBOOT_FS_DEFAULT_NAME=hdfs://ip-10-x.x.x.ec2.internal:9000
QE_HBOOT_FS_DEFAULTFS=hdfs://ip-10-x.x.x.ec2.internal:9000
QE_HBOOT_FS_HDFS_IMPL=org.apache.hadoop.hdfs.DistributedFileSystem
我再也没有得到Zookeeper异常(exception)了,但是创建工作空间的命令只是挂了几分钟,然后才停止。
我在zookepper日志中发现了此错误,我不确定这是否意味着Zookeeper崩溃或失去了与所声明客户端的连接。我不知道为什么它要接受来自端口36997、36998、37000和37034的套接字连接,而且我甚至都没有在ec2安全组上授予它们的许可:
2013-08-13 16:44:55,560 INFO org.apache.zookeeper.server.ZooKeeperServer: Established session 0x1407890cb630000 with negotiated timeout 180000 for client /10.x.x.x:36997
2013-08-13 16:44:57,633 INFO org.apache.zookeeper.server.NIOServerCnxnFactory: Accepted socket connection from /10.x.x.x:36998
2013-08-13 16:44:57,662 INFO org.apache.zookeeper.server.ZooKeeperServer: Client attempting to establish new session at /10.x.x.x:36998
2013-08-13 16:44:57,666 INFO org.apache.zookeeper.server.ZooKeeperServer: Established session 0x1407890cb630001 with negotiated timeout 180000 for client /10.x.x.x:36998
2013-08-13 16:44:57,917 INFO org.apache.zookeeper.server.PrepRequestProcessor: Got user-level KeeperException when processing sessionid:0x1407890cb630001 type:create cxid:0x8 zxid:0x219 txntype:-1 reqpath:n/a Error Path:/hbase/online-snapshot/acquired Error:KeeperErrorCode = NodeExists for /hbase/online-snapshot/acquired
2013-08-13 16:44:58,450 INFO org.apache.zookeeper.server.PrepRequestProcessor: Got user-level KeeperException when processing sessionid:0x1407890cb630000 type:create cxid:0xb zxid:0x21a txntype:-1 reqpath:n/a Error Path:/hbase/master Error:KeeperErrorCode = NodeExists for /hbase/master
2013-08-13 16:45:00,927 INFO org.apache.zookeeper.server.NIOServerCnxnFactory: Accepted socket connection from /10.x.x.x:37000
2013-08-13 16:45:00,928 INFO org.apache.zookeeper.server.ZooKeeperServer: Client attempting to establish new session at /10.x.x.x:37000
2013-08-13 16:45:00,930 INFO org.apache.zookeeper.server.ZooKeeperServer: Established session 0x1407890cb630002 with negotiated timeout 180000 for client /10.x.x.x:37000
2013-08-13 16:45:02,165 INFO org.apache.zookeeper.server.PrepRequestProcessor: Got user-level KeeperException when processing sessionid:0x1407890cb630000 type:create cxid:0x24 zxid:0x221 txntype:-1 reqpath:n/a Error Path:/hbase/online-snapshot/acquired Error:KeeperErrorCode = NodeExists for /hbase/online-snapshot/acquired
2013-08-13 16:45:14,172 INFO org.apache.zookeeper.server.NIOServerCnxnFactory: Accepted socket connection from /10.x.x.x:37034
2013-08-13 16:45:14,173 INFO org.apache.zookeeper.server.ZooKeeperServer: Client attempting to establish new session at /10.x.x.x:37034
2013-08-13 16:45:14,178 INFO org.apache.zookeeper.server.ZooKeeperServer: Established session 0x1407890cb630003 with negotiated timeout 180000 for client /10.x.x.x:37034
2013-08-13 16:47:51,000 INFO org.apache.zookeeper.server.ZooKeeperServer: Expiring session 0x1407800784a0003, timeout of 180000ms exceeded
2013-08-13 16:47:51,001 INFO org.apache.zookeeper.server.ZooKeeperServer: Expiring session 0x1407800784a0001, timeout of 180000ms exceeded
2013-08-13 16:47:51,001 INFO org.apache.zookeeper.server.ZooKeeperServer: Expiring session 0x1407800784a0000, timeout of 180000ms exceeded
2013-08-13 16:47:51,001 INFO org.apache.zookeeper.server.ZooKeeperServer: Expiring session 0x1407800784a0002, timeout of 180000ms exceeded
2013-08-13 16:47:51,001 INFO org.apache.zookeeper.server.PrepRequestProcessor: Processed session termination for sessionid: 0x1407800784a0003
2013-08-13 16:47:51,001 INFO org.apache.zookeeper.server.PrepRequestProcessor: Processed session termination for sessionid: 0x1407800784a0001
2013-08-13 16:47:51,001 INFO org.apache.zookeeper.server.PrepRequestProcessor: Processed session termination for sessionid: 0x1407800784a0000
2013-08-13 16:47:51,002 INFO org.apache.zookeeper.server.PrepRequestProcessor: Processed session termination for sessionid: 0x1407800784a0002
我查看了hbase Web界面,它显示了表实际上是在创建的,但是创建的命令从不返回响应,它们只是挂起。
最佳答案
尝试改变,
<property>
<name>hbase.zookeeper.quorum</name>
<value>ip-10-x.x.x</value>
</property>
为此,
<property>
<name>hbase.zookeeper.quorum</name>
<value>localhost</value>
</property>
然后重新启动hbase和Zookeeper
并且,也建议将此作为您的seqware配置
# SEQWARE QUERY ENGINE AND GENERAL HADOOP SETTINGS
#
HBASE.ZOOKEEPER.QUORUM=localhost
HBASE.ZOOKEEPER.PROPERTY.CLIENTPORT=2181
HBASE.MASTER=localhost:60000
MAPRED.JOB.TRACKER=localhost:8021
FS.DEFAULT.NAME=hdfs://localhost:8020
FS.DEFAULTFS=hdfs://localhost:8020
FS.HDFS.IMPL=org.apache.hadoop.hdfs.DistributedFileSystem
#
# SEQWARE QUERY ENGINE SETTINGS
#
QE_NAMESPACE=SeqWareQE
QE_DEVELOPMENT_DEPENDENCY=file:/home/seqware/jars/seqware-distribution-0.13.6.5-qe-full.jar
QE_PERSIST=true
QE_HBASE_REMOTE_TESTING=true
QE_HBASE_PROPERTIES=HBOOT
QE_HBOOT_HBASE_ZOOKEEPER_QUORUM=ip-10-x.x.x.ec2.internal
QE_HBOOT_HBASE_ZOOKEEPER_PROPERTY_CLIENTPORT=2181
QE_HBOOT_HBASE_MASTER=ip-10-x.x.x.ec2.internal:60010
QE_HBOOT_MAPRED_JOB_TRACKER=ip-10-x.x.x.ec2.internal:9001
QE_HBOOT_FS_DEFAULT_NAME=hdfs://ip-10-x.x.x.ec2.internal:9000
QE_HBOOT_FS_DEFAULTFS=hdfs://ip-10-x.x.x.ec2.internal:9000
QE_HBOOT_FS_HDFS_IMPL=org.apache.hadoop.hdfs.DistributedFileSystem
另外,请尝试使用here和here指南。
您还提到了有关Zookeeper端口可能尚未打开的问题。为了测试目的,建议您禁用防火墙。因为我之前已经看到几个问题,这是因为防火墙阻止了重要端口。
关于hadoop - 无法ssh权限被拒绝。 HBase Hadoop,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/18194527/