我无法在分布式模式下设置hbase。当我在一台机器上设置它时,它工作正常(独立模式)。我的Zookeeper,hmaster和区域服务器正常启动 但是当我去hbase shell并寻找状态时。它显示了我0区域服务器。我附加了区域服务器的日志。加上我的主(namenode)和slave(datanode)的主机文件。我已尝试使用stackoverflow上的每个P& C来更改主机文件,但是对我来说不起作用。
2013-06-24 15:03:45,844 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server naresh-pc/192.168.0.108:2181. Will not attempt to authenticate using SASL (unknown error)
2013-06-24 15:03:45,845 WARN org.apache.zookeeper.ClientCnxn: Session 0x13f75807d960001 for server null, unexpected error, closing socket connection and attempting to reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:692)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
Slave /etc/hosts :
127.0.0.1 localhost
127.0.1.1 ubuntu-pc
#ip for hadoop
192.168.0.108 master
192.168.0.126 slave
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Master /etc/hosts :
127.0.0.1 localhost
127.0.1.1 naresh-pc
#ip for hadoop
192.168.0.108 master
192.168.0.126 slave
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
hbase-site.xml:
<configuration>
<property>
<name>hbase.master</name>
<value>master:60000</value>
<description>The host and port that the HBase master runs at.
A value of 'local' runs the master and a regionserver
in a single process.
</description>
</property>
<property>
<name>hbase.rootdir</name>
<value>hdfs://master:54310/hbase</value>
<description>The directory shared by region servers.</description>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
<description>The mode the cluster will be in. Possible values are
false: standalone and pseudo-distributed setups with managed
Zookeeper true: fully-distributed with unmanaged Zookeeper
Quorum (see hbase-env.sh)
</description>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
<description>Property from ZooKeeper's config zoo.cfg.
The port at which the clients will connect.
</description>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>master</value>
<description>Comma separated list of servers in the ZooKeeper Quorum.
For example,
"host1.mydomain.com,host2.mydomain.com".
By default this is set to localhost for local and
pseudo-distributed modes of operation. For a
fully-distributed setup, this should be set to a full
list of ZooKeeper quorum servers. If
HBASE_MANAGES_ZK is set in hbase-env.sh
this is the list of servers which we will start/stop
ZooKeeper on.
</description>
</property>
</configuration>
Zookeeper log:
2013-06-28 18:22:26,781 WARN org.apache.zookeeper.server.NIOServerCnxn: caught end of stream exception
EndOfStreamException: Unable to read additional data from client sessionid 0x13f8ac0b91b0002, likely client has closed socket
at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:220)
at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208)
at java.lang.Thread.run(Thread.java:722)
2013-06-28 18:22:26,858 INFO org.apache.zookeeper.server.NIOServerCnxn: Closed socket connection for client /192.168.0.108:57447 which had sessionid 0x13f8ac0b91b0002
2013-06-28 18:25:21,001 INFO org.apache.zookeeper.server.ZooKeeperServer: Expiring session 0x13f8ac0b91b0002, timeout of 180000ms exceeded
2013-06-28 18:25:21,002 INFO org.apache.zookeeper.server.PrepRequestProcessor: Processed session termination for sessionid: 0x13f8ac0b91b0002
Master Log:
2013-06-28 18:22:41,932 INFO org.apache.hadoop.hbase.master.ServerManager: Waiting for region servers count to settle; currently checked in 0, slept for 1502022 ms
2013-06-28 18:22:43,457 INFO org.apache.hadoop.hbase.master.ServerManager: Waiting for region servers count to settle; currently checked in 0, slept for 1503547 ms
答案 0 :(得分:0)
从hosts文件中删除127.0.1.1并转向IPV6。这应该可以解决问题。
答案 1 :(得分:0)
您的Regionserver正在naresh-pc上寻找HMaster,但您的/ etc / hosts文件中没有任何此类条目。请确保您的配置正确。
答案 2 :(得分:0)
您可以尝试所有这些方法吗?
确保您的/conf/regionservers
文件只有一个条目:slave
不知道您使用的是哪个HBase版本,而是使用端口54310
代替hbase-site.xml中hbase.rootdir
属性的9000
端口使用端口Opening socket connection to server naresh-pc/192.168.0.108:2181
您的/ etc / hosts文件,在主服务器和从服务器上都应仅具有以下自定义条目:
127.0.0.1本地主机
192.168.0.108主控
192.168.0.126奴隶
我担心您的日志状态为naresh-pc
很明显,系统认为Zookeeper位于主机master
上,但是在配置中,您正在将主机绑定到hbase.zookeeper.property.dataDir
主机上的Zookeeper仲裁,HBase将绑定到该主机。那是个问题。以我的经验,HBase对主机名非常挑剔,因此请确保它们在所有配置和/ etc / hosts文件中都同步。
此外,这可能是一个小问题,但在.xml文件中指定zookeper数据目录以具有使群集正常工作的最小设置集也不会受到损害:$CountA = 1
$CountB = 0
Function PasswordExpiration
{
While ($CountB -ne 5)
{
$CountA = $CountA + 1
$CountB = $CountB + 1
$FinalPath = "c:\support\PasswordExpiration\PasswordExpiration"+$CountB+"Days.csv"
$FilterEndDate = (Get-Date).AddDays($CountA).Date
$FilterStartDate = (Get-Date).AddDays($CountB).Date
Get-ADUser -Filter * -Properties "DisplayName", "msDS-UserPasswordExpiryTimeComputed" ,
EmailAddress, DisplayName, PasswordNeverExpires |
where EmailAddress -ne $null |
where { $_.passwordNeverExpires -eq $false } |
where {$_.enabled -eq $true}|
Select-Object -Property "Displayname", GivenName , EmailAddress,@{Name="Expiration Date";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}}, PasswordNeverExpires, enabled |
Where-Object { $_.'Expiration Date' -lt $FilterEndDate} |
Where-Object { $_.'Expiration Date' -gt $FilterStartDate} |
Export-Csv -Path $FinalPath -Encoding ascii -NoTypeInformation
}
}