如果使用Zookeeper用户启动了“ ZooKeeperServer未运行”。如果以root身份启动,则可以正常工作

时间:2019-03-26 16:50:41

标签: hadoop hdfs apache-zookeeper hortonworks-data-platform

如果我们从HortonWorks Ambari GUI启动Zookeeper,则表明Zookeeper服务器是绿色的,正在运行,由zookeeper用户运行,但实际上在日志文件中触发了数百万条警告,例如:

WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn @ 362]-由于java.io.IOException导致会话0x0关闭的异常:ZooKeeperServer未运行

这是个大问题,因为它实际上不起作用。 如果我们终止该进程并使用zkServer.sh start命令以root用户身份手动启动该进程,则当我们以root用户身份运行该进程时不会出现问题,并且运行良好。

这是个大问题,因为我们必须将zookeeper设置为由zookeeper用户运行。 我已检查权限:

/var/run/zookeeper
/var/log/zookeeper
/hadoop/zookeeper
/usr/hdp/3.1.0.0-78/zookeeper

,一切正常。 我真的不明白为什么当它以root身份运行时可以正常运行,而如果以zookeeper运行则不起作用。特定用户(纱线,hdfs,oozie等)运行的所有其他服务都只能在Zookeeper问题上正常运行。

如果有人有任何线索,请。 谢谢!!! 这是使用前台运行时的完整日志。

[zookeeper@testnn2 bin]$ ./zkServer.sh start-foreground
ZooKeeper JMX enabled by default
Using config: /usr/hdp/current/zookeeper-server/bin/../conf/zoo.cfg
2019-03-26 17:58:07,869 - INFO  [main:QuorumPeerConfig@103] - Reading configuration from: /usr/hdp/current/zookeeper-server/bin/../conf/zoo.cfg
2019-03-26 17:58:07,876 - WARN  [main:QuorumPeerConfig@291] - No server failure will be tolerated. You need at least 3 servers.
2019-03-26 17:58:07,876 - INFO  [main:QuorumPeerConfig@338] - Defaulting to majority quorums
2019-03-26 17:58:07,883 - INFO  [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 30
2019-03-26 17:58:07,884 - INFO  [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 24
2019-03-26 17:58:07,890 - INFO  [PurgeTask:DatadirCleanupManager$PurgeTask@138] - Purge task started.
2019-03-26 17:58:07,906 - INFO  [main:QuorumPeerMain@127] - Starting quorum peer
2019-03-26 17:58:07,908 - INFO  [PurgeTask:DatadirCleanupManager$PurgeTask@144] - Purge task completed.
2019-03-26 17:58:07,928 - INFO  [main:NIOServerCnxnFactory@94] - binding to port 0.0.0.0/0.0.0.0:2181
2019-03-26 17:58:07,947 - INFO  [main:QuorumPeer@992] - tickTime set to 3000
2019-03-26 17:58:07,947 - INFO  [main:QuorumPeer@1012] - minSessionTimeout set to -1
2019-03-26 17:58:07,948 - INFO  [main:QuorumPeer@1023] - maxSessionTimeout set to -1
2019-03-26 17:58:07,948 - INFO  [main:QuorumPeer@1038] - initLimit set to 10
2019-03-26 17:58:08,262 - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@197] - Accepted socket connection from /192.168.150.220:44292
2019-03-26 17:58:08,272 - INFO  [Thread-2:QuorumCnxManager$Listener@506] - My election bind port: testnn2.local/192.168.150.220:3888
2019-03-26 17:58:08,295 - INFO  [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2181:QuorumPeer@747] - LOOKING
2019-03-26 17:58:08,301 - INFO  [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2181:FastLeaderElection@815] - New election. My id =  2, proposed zxid=0x4000015ec
2019-03-26 17:58:08,317 - INFO  [WorkerReceiver[myid=2]:FastLeaderElection@597] - Notification: 1 (message format version), 2 (n.leader), 0x4000015ec (n.zxid), 0x1 (n.round), LOOKING (n.state), 2 (n.sid), 0x4 (n.peerEpoch) LOOKING (my state)
2019-03-26 17:58:08,391 - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@197] - Accepted socket connection from /192.168.150.210:44640
2019-03-26 17:58:08,393 - WARN  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@362] - Exception causing close of session 0x0 due to java.io.IOException: ZooKeeperServer not running

0 个答案:

没有答案