那些安装CDH集群过程中踩过的坑......(比较全)
Posted 格格巫 MMQ!!
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了那些安装CDH集群过程中踩过的坑......(比较全)相关的知识,希望对你有一定的参考价值。
一、登录Cloudera Manager (http://192.168.201.128:7180/cmf/login)时,无法访问web页面
针对此问题网上有较多的解决方案(e.g. https://www.cnblogs.com/zlslch/p/7078119.html), 如果还不能解决你的问题,请看下面的解决方案。
登录mysql数据库(或利用Navicat),会发现有一个mysql数据库(下图所示),在mysql数据库中有一个user表,将User="root"的两条记录进行删除
select * from user;
delete from user where User=‘root’;
再次登录http://192.168.201.128:7180/cmf/login,发现登录成功!
二、利用Navicat连接MySql数据库时,错误信息:Can’t connect to MySQL server on ‘xxxxx’(10038)
解决方案:
查看网络的端口信息:netstat -ntpl,下图状态为正常状态(不是请进行如下操作),如果没有netstat,在CentOS 7下利用yum -y install net-tools进行安装。
查看防火墙的状态,发现3306的端口是丢弃状态:
iptables -vnL
这里要清除防火墙中链中的规则
iptables -F
再次连接MySql数据库,发现连接成功!
三、无法启动NameNode,查看日志发现如下错误…
复制代码
Exception in thread “main” org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.hdfs.server.namenode.SafeModeException): Cannot delete /tmp/hadoop-yarn/staging/hadoop/.staging/job_1490689337938_0001. Name node is in safe mode.
The reported blocks 48 needs additional 5 blocks to reach the threshold 0.9990 of total blocks 53.
The number of live datanodes 2 has reached the minimum number 0. Safe mode will be turned off automatically once the thresholds have been reached.
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkNameNodeSafeMode(FSNamesystem.java:1327)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.delete(FSNamesystem.java:3713)
at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.delete(NameNodeRpcServer.java:953)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.delete(ClientNamenodeProtocolServerSideTranslatorPB.java:611)
at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol
2.
c
a
l
l
B
l
o
c
k
i
n
g
M
e
t
h
o
d
(
C
l
i
e
n
t
N
a
m
e
n
o
d
e
P
r
o
t
o
c
o
l
P
r
o
t
o
s
.
j
a
v
a
)
a
t
o
r
g
.
a
p
a
c
h
e
.
h
a
d
o
o
p
.
i
p
c
.
P
r
o
t
o
b
u
f
R
p
c
E
n
g
i
n
e
2.callBlockingMethod(ClientNamenodeProtocolProtos.java) at org.apache.hadoop.ipc.ProtobufRpcEngine
2.callBlockingMethod(ClientNamenodeProtocolProtos.java)atorg.apache.hadoop.ipc.ProtobufRpcEngineServer
P
r
o
t
o
B
u
f
R
p
c
I
n
v
o
k
e
r
.
c
a
l
l
(
P
r
o
t
o
b
u
f
R
p
c
E
n
g
i
n
e
.
j
a
v
a
:
616
)
a
t
o
r
g
.
a
p
a
c
h
e
.
h
a
d
o
o
p
.
i
p
c
.
R
P
C
ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:616) at org.apache.hadoop.ipc.RPC
ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:616)atorg.apache.hadoop.ipc.RPCServer.call(RPC.java:982)
at org.apache.hadoop.ipc.Server$Handler
1.
r
u
n
(
S
e
r
v
e
r
.
j
a
v
a
:
2049
)
a
t
o
r
g
.
a
p
a
c
h
e
.
h
a
d
o
o
p
.
i
p
c
.
S
e
r
v
e
r
1.run(Server.java:2049) at org.apache.hadoop.ipc.Server
1.run(Server.java:2049)atorg.apache.hadoop.ipc.ServerHandler
1.
r
u
n
(
S
e
r
v
e
r
.
j
a
v
a
:
2045
)
a
t
j
a
v
a
.
s
e
c
u
r
i
t
y
.
A
c
c
e
s
s
C
o
n
t
r
o
l
l
e
r
.
d
o
P
r
i
v
i
l
e
g
e
d
(
N
a
t
i
v
e
M
e
t
h
o
d
)
a
t
j
a
v
a
x
.
s
e
c
u
r
i
t
y
.
a
u
t
h
.
S
u
b
j
e
c
t
.
d
o
A
s
(
S
u
b
j
e
c
t
.
j
a
v
a
:
422
)
a
t
o
r
g
.
a
p
a
c
h
e
.
h
a
d
o
o
p
.
s
e
c
u
r
i
t
y
.
U
s
e
r
G
r
o
u
p
I
n
f
o
r
m
a
t
i
o
n
.
d
o
A
s
(
U
s
e
r
G
r
o
u
p
I
n
f
o
r
m
a
t
i
o
n
.
j
a
v
a
:
1698
)
a
t
o
r
g
.
a
p
a
c
h
e
.
h
a
d
o
o
p
.
i
p
c
.
S
e
r
v
e
r
1.run(Server.java:2045) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:422) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1698) at org.apache.hadoop.ipc.Server
1.run(Server.java:2045)atjava.security.AccessController.doPrivileged(NativeMethod)atjavax.security.auth.Subject.doAs(Subject.java:422)atorg.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1698)atorg.apache.hadoop.ipc.ServerHandler.run(Server.java:2045)
复制代码
什么是安全模式?
安全模式是HDFS所处的一种特殊状态,在这种状态下,文件系统只接受读数据请求,而不接受删除、修改等变更请求。在NameNode主节点启动时,HDFS首先进入安全模式,DataNode在启动的时候会向namenode汇报可用的block等状态,当整个系统达到安全标准时,HDFS自动离开安全模式。如果HDFS出于安全模式下,则文件block不能进行任何的副本复制操作,因此达到最小的副本数量要求是基于datanode启动时的状态来判定的,启动时不会再做任何复制(从而达到最小副本数量要求)原博文:https://blog.csdn.net/bingduanlbd/article/details/51900512。
1、集群升级维护时手动进入安全模式
hadoop dfsadmin -safemode enter
2、退出安全模式:
hadoop dfsadmin -safemode leave
3、返回安全模式是否开启的信息
hadoop dfsadmin -safemode get
因此,当发现namenode处于安全模式,无法启动时,可以使用hadoop dfsadmin -safemode leave退出安全模式,重启namenode解决问题!
四、INFO hdfs.DFSClient: Exception in createBlockOutputStream java.net.NoRouteToHostException: No route to host
复制代码 以上是关于那些安装CDH集群过程中踩过的坑......(比较全)的主要内容,如果未能解决你的问题,请参考以下文章
16/07/27 01:29:26 INFO hdfs.DFSClient: Exception in createBlockOutputStream
java.net.NoRouteToHostException: No route to host
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:531)
at org.apache.hadoop.hdfs.DFSOutputStream.createSocketForPipeline(DFSOutputStream.java:1537)
at org.apache.hadoop.hdfs.DFSOutputStream
D
a
t
a
S
t
r
e
a
m
e
r
.
c
r
e
a
t
e
B
l
o
c
k
O
u
t
p
u
t
S
t
r
e
a
m
(
D
F
S
O
u
t
p
u
t
S
t
r
e
a
m
.
j
a
v
a
:
1313
)
a
t
o
r
g
.
a
p
a
c
h
e
.
h
a
d
o
o
p
.
h
d
f
s
.
D
F
S
O
u
t
p
u
t
S
t
r
e
a
m
DataStreamer.createBlockOutputStream(DFSOutputStream.java:1313) at org.apache.hadoop.hdfs.DFSOutputStream
DataStreamer.createBlockOutputStream(DFSOutputStream.java:1313)atorg.apache.hadoop.hdfs.DFSOutputStreamDataStreamer.nextBlockOutputStream(DFSOutputStream.java:1266)
at org.apache.hadoop.hdfs.DFSOutputStream
D
a
t
a
S
t
r
e
a
m
e
r
.
r
u
n
(
D
F
S
O
u
t
p
u
t
S
t
r
e
a
m
.
j
a
v
a
:
449
)
16
/
07
/
2701
:
29
:
26
I
N
F
O
h
d
f
s
.
D
F
S
C
l
i
e
n
t
:
A
b
a
n
d
o
n
i
n
g
B
P
−
555863411
−
172.16.95.100
−
1469590594354
:
b
l
k
1
07374182
5
1
00116
/
07
/
2701
:
29
:
26
I
N
F
O
h
d
f
s
.
D
F
S
C
l
i
e
n
t
:
E
x
c
l
u
d
i
n
g
d
a
t
a
n
o
d
e
D
a
t
a
n
o
d
e
I
n
f
o
W
i
t
h
S
t
o
r
a
g
e
[
172.16.95.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